Skip to main content

Plan against a known asset version

Use a project key, an asset with a completed analysis and an enabled ad profile. List profiles through GET /v1/ad-providers/profiles and use the returned provider, account and profile identifiers. This sample is for POST /v1/vod/matches or POST /v1/vod/airings. Replace all identifiers and the date with your own.
Poll GET /v1/vod/matches/{match_id} until a terminal state. The evaluation time for each moment is the planned start plus that moment’s offset. Review the per-moment results and provider snapshot. Campaign candidates describe contextual affinity. Delivery and measurement are confirmed later by the relevant provider. Reschedule with PATCH /v1/vod/airings/{airing_id} and cancel with POST /v1/vod/airings/{airing_id}/cancel. Use RFC 3339 dates with a zone. Report started and ended with actual times from your playout. The start notification triggers reevaluation against the actual time. Preserve the same Idempotency-Key when retrying an identical supported mutation. The event stream deduplicates by event_id.

Play a client-side VAST ad

  1. Create a playback with POST /v1/vod/playbacks using asset_id, channel_id and one routing choice. For a started airing you can provide airing_id. Use an explicit VAST profile, project_routing: true or a published adrouter_placement_id as appropriate.
  2. Prepare a break with POST /v1/vod/playbacks/{playback_id}/opportunities and {"cue_seconds":120}.
  3. At the cue, call POST /v1/vod/playbacks/{playback_id}/opportunities/{opportunity_id}/request. Pass the opaque ad_tag_url to a compatible VAST player such as IMA if eligible is true and a URL is present. Continue the content if the opportunity is unavailable, rejected, expired, already consumed or times out.
  4. Report progress to POST /v1/vod/playbacks/{playback_id}/events with a fresh event_id, type: "progress" and data.position_seconds. Use the ad integration’s VAST beacons to measure the spot.
In a project that never saved ordered lists, a direct GAM profile works as before: when no campaign matches the scene, the break is skipped, or the response carries the GAM tag without context key-values (reason: "provider_inventory", context.fallback: "unmatched") if the project requests a common ad. If the project requests a pre-roll, {"cue_seconds":0} returns that same tag as a pre-roll (context.fallback: "preroll"); otherwise the call returns 422. Both rules are off by default. In the At the breaks row of Settings → Delivery, Mid-roll every (minutes) (1 to 60, empty means none) asks for a mid-roll at that interval. IL asks the ad server for each break separately, so no ad rule is needed in Google Ad Manager; when you add a mid-roll step with the field empty, the screen fills in 10 minutes. The Display ad unit for the 300×250 Overlay is chosen in Settings → Adservers → Google Ad Manager and must belong to the network of the default GAM profile. These settings and the ordered lists feed the ad plan that the browser reads to request ads directly from each ad server, without going through this API. ILPlayer · Player SDK

Walk the ad-server steps of a break

When AdRouter is off and the project saved its lists (with Apps and TV chosen in Settings → General), create the playback without provider, connection_id, ad_profile_id, gam_profile_id, airing_id or adrouter_placement_id. The playback then answers "routing": "steps". With AdRouter on, or with any of those fields, the playback works as described above and has no routing. How the order works On these playbacks, /request answers the first step that can be asked and adds step (its index, from 0), steps_left, kind (contextual or common), provider, connection_id and ad_profile_id. context.skipped_steps lists the steps IL skipped, each with step, provider, kind and reason. An iADServer step answers reason: "requested". If the ad server of that step returns no ad, call POST /v1/vod/playbacks/{playback_id}/opportunities/{opportunity_id}/next with the step you received as after_step. The answer has the same shape. With no step left it answers {"eligible": false, "reason": "steps_exhausted", "steps_left": 0}: continue the content. A mid-roll list with an iADServer contextual step and a Google Ad Manager common step:
iADServer returns an empty VAST. Ask the next step:
Google Ad Manager also returns no ad. {"after_step": 1} answers {"eligible": false, "reason": "steps_exhausted", "steps_left": 0}. A scene blocked by Content Safety stops every step: nothing is asked. Any answer with eligible: false, from /request or /next, ends the break: resume the content. A diagnostic test records only the first request of each break. If the request response is lost after consumption, the server does not issue the tag a second time. Resume the program and let the next eligible break proceed. For SpringServe SSAI, use an airing signal. Advertising providers · End-to-end recipes

Graphics and Buy next to your app’s breaks

If your app plays its own breaks with this API and has the IL SDK, it can also show the scene graphics (Super, L, Overlay 300×250 where the platform allows it), the product with Buy in the scene, and Buy during an iADServer ad. Your backend keeps requesting the breaks; the SDK draws around them. Native apps
  1. Create the playback with "graphics": true in POST /v1/vod/playbacks. The response echoes "graphics": true; with "graphics": false it answers false, and a playback created without the field has no such key.
  2. From your backend, read GET /v1/vod/playbacks/{playback_id}/plan with a key that has read scope and pass the body to the app unchanged. It is the project’s ad plan with cuts: [] (you request the breaks through the API), the scenes, and commerce with a grant for that playback’s session. commerce.session is always the same for that playback.
  3. The app attaches the plan to the SDK and reports its breaks and ads: the positions with setBreaks before they arrive, then breakStarted, adStarted, adEnded and breakEnded (on the web and Samsung Tizen, setBreakAd and clearBreakAd for each ad). Each platform guide has the code: Media3 · Roku · AVPlayer · Samsung Tizen · Web.
  4. Request each break with /request and /next as usual.
GET …/plan answers 204 when there is nothing to draw: AdRouter on, analysis not finished, server-side insertion, playback ended, video changed since the playback started, or a plan with no scenes and no product. It may schedule a plan build and never touches the playback’s opportunities or steps. A version: 2 plan expires soon: read it again before expires_at. The scene and product windows are the project plan’s: they keep clear of the breaks IL would place, not of the ones your app plays. That is why the SDK applies scenes.pacing.cut_clearance_seconds only around the breaks the app reports. In a playback with graphics: true that walks steps ("routing": "steps"), an iADServer step with an iADServer video tag, whose iADServer connection still exists, answers with that step’s permanent tag, also when the step is contextual. The tag carries the playback’s session in sid and a correlator of its own for that break:
On a contextual step, iADServer chooses with its own evaluation of the context, as in the web plan. If the player fetches the same URL again (a retry, or a prefetch followed by playback), iADServer returns the same delivery instead of reserving another one. Only deliveries requested this way can carry Buy during the ad. An iADServer step without a tag, a Google Ad Manager step and any playback without graphics answer exactly as before. If the tag returns no ad, continue with /next and {"after_step": <step>}. commerce.break_url, the product route during an ad, is in the plan only when the playback has graphics: true, walks the saved steps, does not use AdRouter, the scene product is on, and the project saved at least one iADServer step with a tag. Without it there is no Buy during breaks; everything else works the same. The SDK names the break by its position, cut=at-<milliseconds> (at-0 for the pre-roll). What your app must do:
  • Report the breaks. The SDK cannot know an ad is on screen unless the app says so. Without reports, graphics follow content time, can end up over a break, and there is no Buy.
  • Attach with commerce.session. Use the plan’s commerce.session as the session when you attach the SDK. With another session there is no Buy during breaks.
  • Fetch ad_tag_url exactly as given. Do not add, change or remove sid or correlator.
What was tested. Buy during a break through this API was verified against a real iADServer in automated contract tests, not with a real app. The state of each platform is in Native apps.