The Video Stitcher API inserts ads into video assets. The adTagUri
field in
the body of a VOD session request specifies the URL from where ad metadata is
retrieved. The Video Stitcher API also includes user metadata when it makes the
request.
The /vodAdTagDetails
endpoint contains the following information:
- resolved ad tag
- user metadata
- request body and headers
- response body and headers
The /vodStitchDetails
endpoint contains the following information:
- ad break ID
- ad ID
- ad time offset (in seconds)
- reason if the ad was not inserted
- ad media metadata
This document describes how to inspect the ad tag details and stitch details
for a given VOD session. For more details, see the REST documentation for
VodAdTagDetail
and VodStitchDetail
.
Before you begin
Make sure that you're familiar with the steps to create a VOD session.
Suppose that you create a VOD session and receive the following session (some fields omitted):
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID" ... }
This page assumes the VOD session, as shown above, has already been created.
List ad tag details
To list the ad tag details for a VOD session, use the
projects.locations.vodSessions.vodAdTagDetails.list
method.
REST
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number located in the Project number field on the IAM Settings page
- LOCATION: the location of your session; use one of
the supported regions:
us-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
- SESSION_ID: the session ID for the VOD session
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "vodAdTagDetails" : [ { "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID/vodAdTagDetails/VOD_AD_TAG_DETAILS_ID", "adRequests": [ { "uri": "REQUEST_URL", "requestMetadata": "AD_TAG_REQUEST_METADATA", "responseMetadata": "AD_TAG_RESPONSE_METADATA" } ] } ] }
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
The response returns a list of VodAdTagDetail
objects. Each VodAdTagDetail
represents the ad retrieval metadata for an ad
tag, and each AdRequest
represents the ad
request metadata for a single ad request.
Additional results
The curl
response may include a nextPageToken
, which you can use to retrieve
additional results:
{ "vodAdTagDetails": [ ... ], "nextPageToken": "NEXT_PAGE_TOKEN" }
You can send another curl
request, including the value of
NEXT_PAGE_TOKEN, to list the additional objects. Append the following
to the URL in the preceding API call:
?pageToken=NEXT_PAGE_TOKEN
Get ad tag details
To get the details for a single VodAdTagDetail
object in a VOD session, use the
projects.locations.vodSessions.vodAdTagDetails.get
method.
REST
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number located in the Project number field on the IAM Settings page
- LOCATION: the location of your session; use one of
the supported regions:
us-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
- SESSION_ID: the session ID for the VOD session
- VOD_AD_TAG_DETAILS_ID: the ID for the VOD ad tag details
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID/vodAdTagDetails/VOD_AD_TAG_DETAILS_ID", "adRequests": [ { "uri": "REQUEST_URL", "requestMetadata": "AD_TAG_REQUEST_METADATA", "responseMetadata": "AD_TAG_RESPONSE_METADATA" } ] }
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
List stitch details
You can view detailed information about the ads that were stitched for any VOD session.
To list the stitch details for a VOD session, use the
projects.locations.vodSessions.vodStitchDetails.list
method.
REST
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number located in the Project number field on the IAM Settings page
- LOCATION: the location of your session; use one of
the supported regions:
us-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
- SESSION_ID: the session ID for the VOD session
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "vodStitchDetails" : [ { "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID/vodStitchDetails/VOD_STITCH_DETAIL_ID", "adStitchDetails": [ { "adBreakId": "AD_BREAK_ID", "adId": "AD_ID", "adTimeOffset": "AD_TIME_OFFSET", "skipReason": "SKIP_REASON", "media": "MEDIA_OBJECT" }, { "adBreakId": "my-other-ad-break-id", "adId": "my-other-ad-id", "adTimeOffset": "my-other-ad-time-offset", "skipReason": "my-other-skip-reason", "media": "my-other-media-object" } ] } ] }
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
The response returns a list of
VodStitchDetail
objects. Each
VodStitchDetail
represents the stitch detail for an ad tag, and each
adStitchDetails
object represents
the stitch detail for a single ad.
This response may include a nextPageToken
, which you can use to retrieve
additional results:
{ "vodStitchDetails": [ ... ], "nextPageToken": "NEXT_PAGE_TOKEN" }
You can then send another request, including the value of NEXT_PAGE_TOKEN, to list the additional stitch detail objects. Append the following to the URL in the preceding API call:
?pageToken=NEXT_PAGE_TOKEN
Get ad tag stitch detail
To get the stitch detail for a single ad tag for a VOD session, use the
projects.locations.vodSessions.vodStitchDetails.get
method.
REST
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number located in the Project number field on the IAM Settings page
- LOCATION: the location of your session; use one of
the supported regions:
us-central1
us-east1
us-west1
asia-east1
asia-south1
asia-southeast1
europe-west1
southamerica-east1
- SESSION_ID: the session ID for the VOD session
- VOD_STITCH_DETAILS_ID: the ID for the VOD stitch details
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/vodSessions/SESSION_ID/vodStitchDetails/VOD_STITCH_DETAIL_ID", "adStitchDetails": [ { "adBreakId": "AD_BREAK_ID", "adId": "AD_ID", "adTimeOffset": "AD_TIME_OFFSET", "skipReason": "SKIP_REASON", "media": "MEDIA_OBJECT" } ] }
Python
Before trying this sample, follow the Python setup instructions in the Video Stitcher API quickstart using client libraries. For more information, see the Video Stitcher API Python API reference documentation.
To authenticate to Video Stitcher API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.