Early ad break notification v1
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
- 広告ブレークが作成される対応するライブ ストリームの ID。この識別子は次のいずれかです。
- ライブ ストリームの「アセットキー」。
- ライブ配信の「カスタム アセットキー」。独自の ID 文字列を指定して、独自のキースペースを管理できます。
- ライブ配信の「コンテンツ ソース ID」と「コンテンツ ID」。
注: この ID タイプを使用するには、有効にする必要があります。詳しくは、アカウント マネージャーにお問い合わせください。
- 次のミッドロール挿入点の推定時間。時間は、実際のミッドロール挿入点の長さにできるだけ近づける必要があります。
これらの必須フィールドに加えて、カスタム ターゲティング パラメータ、適用する広告連続配信テンプレートの名前、SCTE35 キューアウト データ(利用可能な場合)を送信することもできます。
前提条件
EABN API を使用するには、サービス アカウントを作成して、そのアカウントを Google アド マネージャー ネットワークに追加する必要があります。
サービス アカウントの作成
EABN API を呼び出すサービス アカウントを作成するには、次の手順を完了します。- Google Cloud アカウントがある場合は、IAM モジュールを使用してサービス アカウントを作成します。詳細については、サービス アカウントの作成と管理をご覧ください。- Google Cloud アカウントをお持ちでない場合は、Google API Console で次の手順に沿ってアカウントを作成します。
- 新しいプロジェクトを作成するか、既存のプロジェクトを選択します。
- [認証情報] ページで、[サービス アカウントを管理] をクリックします。
- [サービス アカウント] ページで、[サービス アカウントを作成] をクリックします。
- [サービス アカウントを作成] ページで、アカウントの詳細を入力します。次に、[作成] をクリックします。
サービス アカウントを作成したら、認証に使用されるアカウントの JSON キーをコピーします。
API の有効化
サービス アカウントを作成したら、アカウント マネージャーに次の情報を提供して、アカウントで API を有効にします。
- Google Cloud アカウントのメールアドレス
- サービス アカウント
- Google アド マネージャー ネットワークのネットワーク コード。
アカウント マネージャーが API を有効にしたら、次の手順で API を有効にします。
- Google API ライブラリで「Google Ad Manager Video API」を検索します。
- [有効にする] をクリックします。
注: 検索結果に API が表示されない場合は、アカウントで DAI API が有効になっていることをアカウント マネージャーにご確認ください。
API の使用
EABN API は、JSON/REST リクエストを使用して呼び出すことができます。
承認
EABN API を承認済みで呼び出すには、サービス アカウントの JSON キーとスコープ https://www.googleapis.com/auth/video-ads
を使用して OAuth2 サービス アカウントの認証情報を生成する必要があります。詳細については、サーバー間アプリケーションに OAuth 2.0 を使用するをご覧ください。
生成された承認トークンは、EABN API の呼び出しごとに Auth ヘッダーとして含める必要があります。
早期広告ブレーク通知を送信するには、ライブ配信を指定する方法に応じて、3 つの有効な EABN URL のいずれかに POST リクエストを送信します。以降のセクションでは、URL の違いについて説明します。また、リクエストとレスポンスの例も示します。
URL
早期広告ブレーク通知に使用できる有効な URL は 3 つあります。3 つのタイプすべてを使用して、ミッドロール挿入点(POST
)を作成したり、割り当てられたミッドロール挿入点のリストを取得したりできます(GET
)。
ライブ ストリームのアセットキーを使用するには、次のコマンドを使用します。
POST admanagervideo.googleapis.com/v1/networks/{network_code}/assets/{asset_key}/adBreaks
GET admanagervideo.googleapis.com/v1/networks/{network_code}/assets/{asset_key}/adBreaks
ライブ ストリームのカスタム アセットキーを使用するには、次のコマンドを使用します。
POST admanagervideo.googleapis.com/v1/networks/{network_code}/customAssets/{custom_asset_key}/adBreaks
GET admanagervideo.googleapis.com/v1/networks/{network_code}/customAssets/{custom_asset_key}/adBreaks
コンテンツ ソース ID と Content ID のアプローチを使用するには、次の手順を行います。
POST admanagervideo.googleapis.com/v1/networks/{network_code}/sources/{content_source_id}/content/{content_id}/adBreaks
GET admanagervideo.googleapis.com/v1/networks/{network_code}/sources/{content_source_id}/content/{content_id}/adBreaks
すべてのパラメータの場合:
network_code
は、Google アド マネージャー ネットワークのネットワーク コードを表します。
asset_key
は、ライブ配信の詳細ページに表示されるアセットキーを表します。
custom_asset_key
は、ライブ配信のカスタム アセットキーを表します。
content_source_id
は、Google アド マネージャーのコンテンツ ソースの ID を表します。
content_id
は、Google アド マネージャーのコンテンツの ID を表します。
注: 指定した content_source_id
/content_id
ペアは、Google アド マネージャーのライブ ストリームに関連付けられている必要があります。
リクエスト本文 - ミッドロール挿入点の作成にのみ使用(POST)
オブジェクト |
expectedDuration
| 必須 | このミッドロール挿入点の継続時間です。Google の標準の再生時間形式(xx.xxxs で、xx.xxx は秒数)で指定します。 |
customParams
| 省略可 | アド マネージャー 360 でカスタム条件をターゲティングする際に、この広告ブレークで広告リクエストに含める Key-Value ペアです。キーと値を
=
と
&
. 例:
key=value&key2=value2,value3
ターゲティングについて詳しくは、ストリームにターゲティング パラメータを指定するをご覧ください。
|
podTemplateName
| 省略可 | 連続配信広告のテンプレート名 |
scte35CueOut
| 省略可 | scte35 キューアウトの Base64 エンコード データです。次を含めることができます。
splice_insert()
または
time_signal()
コマンドを使用します。 例: |
リクエストの例
POST admanagervideo.googleapis.com/v1/networks/.../sources/.../content/.../adBreaks
Content-Type: application/json
Authorization: Bearer …
{
"expectedDuration": "30s",
"scte35CueOut": "/DA0AAAAAAAA///wBQb+cr0AUAAeAhxDVUVJSAAAjn/PAAGlmbAICAAAAAAsoKGKNAIAmsnRfg==",
"customParams": "param1=value1¶m2=value2",
"podTemplateName": "podtemplate"
}
レスポンスの本文
レスポンスの本文には、adBreak
オブジェクトで送信されたすべてのパラメータと、作成されたミッドロール挿入点の Google 全体の標準 ID を含む追加の name
フィールドが含まれます。このフィールドは次の形式で返されます。
networks/{network_code}/assets/{asset_key}/adBreaks/{ad_break_id}
レスポンスの例
HTTP/1.1 200 OK
{
"name": "networks/.../assets/.../adBreaks/1",
"expectedDuration": "30s",
"scte35CueOut": "/DA0AAAAAAAA///wBQb+cr0AUAAeAhxDVUVJSAAAjn/PAAGlmbAICAAAAAAsoKGKNAIAmsnRfg==",
"customParams": "param1=value1¶m2=value2",
"podTemplateName": "podtemplate"
}
GET admanagervideo.googleapis.com/v1/networks/.../sources/.../content/.../adBreaks
Content-Type: application/json
Authorization: Bearer …
レスポンスの本文
レスポンスの本文には、ストリームに割り当てられた広告ブレークごとに追加の breakState
フィールドを持つ広告ブレークが含まれます。breakState
フィールドは、次の値をサポートしています。
// Ad break decisioning has started.
BREAK_STATE_DECISIONED
// Break has started to be delivered to end users.
BREAK_STATE_COMPLETE
レスポンスの例
HTTP/1.1 200 OK
{
"name": "networks/.../assets/.../adBreaks/1",
"expectedDuration": "30s",
"breakState": "BREAK_STATE_COMPLETE"
}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-21 UTC。
[null,null,["最終更新日 2025-08-21 UTC。"],[[["\u003cp\u003eThe Early Ad Break Notification (EABN) API enables you to inform Google Ad Manager about upcoming ad breaks in live streams, including metadata, up to an hour in advance.\u003c/p\u003e\n"],["\u003cp\u003eTo use the EABN API, you must create a service account, add it to your Google Ad Manager network, and have the API enabled by your account manager.\u003c/p\u003e\n"],["\u003cp\u003eThe API requires the live stream identifier (asset key, custom asset key, or content source ID with content ID) and the expected ad break duration.\u003c/p\u003e\n"],["\u003cp\u003eYou can optionally include custom targeting parameters, an ad pod template name, and SCTE35 Cue Out data with your EABN requests.\u003c/p\u003e\n"],["\u003cp\u003eEABN requests are immutable, and subsequent requests for the same event are rejected until the break appears in the event's manifest.\u003c/p\u003e\n"]]],[],null,["# Early ad break notification v1\n\nUsing the Early Ad Break Notification API\n-----------------------------------------\n\n- The identifier of the corresponding live stream to which the ad break is being created. This identifier can be one of the following:\n- The \"Asset Key\" of the live stream.\n- The \"Custom Asset Key\" of the live stream, which allows you to manage your own key space by specifying your own identifier string.\n- The \"Content Source ID\" and the \"Content ID\" of the live stream.\n\nNote: You must be enabled to use this identifier type. For more information, contact your account manager.\n\n- The expected duration of the next ad break. The duration needs to be as close to the actual ad break length as possible.\n\nIn addition to these required fields, you can also send custom targeting parameters, the name of an ad pod template to apply, or SCTE35 Cue Out data, if available.\n\n### Prerequisites\n\nIn order to use the EABN API, you must create a service account and add the account to your Google Ad Manager network.\n\n#### Creating a service account\n\nTo create a service account for calling the EABN API, complete the following steps: - If you have a Google Cloud account, use the IAM module to create a service account. For more information, see [Creating and managing service accounts](//cloud.google.com/iam/docs/creating-managing-service-accounts). - If you do not have a Google Cloud account, complete the following steps to create one from the [Google API Console](//console.developers.google.com/apis/credentials/):\n\n1. Create a new project or select an existing project.\n2. In the **Credentials** page, click **Manage service accounts**.\n3. In the **Service accounts** page, click **CREATE SERVICE ACCOUNT**.\n4. In the **Create Service account** page, enter the account details. Then, click **CREATE**.\n\nOnce you have created a service account, copy the account's JSON key, which is used for authentication.\n\n#### Adding your service account to your Google Ad Manager network\n\nTo add your service account to your network, complete the steps in [Add a service account user for API access](//support.google.com/admanager/answer/6078734).\n\n### Enabling the API\n\nOnce you have created the service account, provide the following information to your account manager to enable the API for your account:\n\n- Your Google Cloud Account email address\n- Your service account\n- The Network Code of your Google Ad Manager Network.\n\nAfter the API has been enabled by your account manager, complete the following steps to enable the API:\n\n1. In the [Google API library](//console.developers.google.com/apis/library), search for \"Google Ad Manager Video API\".\n2. Click **ENABLE**.\n\nNote: If the API does not appear in the search results, contact your account manager to confirm that your account has been enabled for the DAI API.\n\n### Using the API\n\nYou can call the EABN API using JSON/REST requests.\n\n#### Authorization\n\nTo make authorized calls to the EABN API, you need to generate OAuth2 service account credentials using the JSON key from your service account and the scope `https://www.googleapis.com/auth/video-ads`. For more information, see [Using OAuth 2.0 for Server to Server Applications](https://developers.google.com/identity/protocols/oauth2/service-account).\n\nYou must include the resulting authorization token as an Auth header for each call to the EABN API.\n\n#### Sending an early ad break notification\n\nTo send an early ad break notification, send a POST request to one of the three valid EABN URLs, depending on how you prefer to specify the live stream. The following sections explain the differences between the URLs and provide request and response examples.\n\n##### URLs\n\nThere are three valid URLs for early ad break notification. You can use all three types to create an ad break (`POST`) or get the list of assigned ad breaks (`GET`).\n\nTo use the asset key of a live stream, use: \n\n POST admanagervideo.googleapis.com/v1/networks/{network_code}/assets/{asset_key}/adBreaks\n\n GET admanagervideo.googleapis.com/v1/networks/{network_code}/assets/{asset_key}/adBreaks\n\nTo use the custom asset key of a live stream, use: \n\n POST admanagervideo.googleapis.com/v1/networks/{network_code}/customAssets/{custom_asset_key}/adBreaks\n\n GET admanagervideo.googleapis.com/v1/networks/{network_code}/customAssets/{custom_asset_key}/adBreaks\n\nTo use the Content Source ID and Content ID approach, use: \n\n POST admanagervideo.googleapis.com/v1/networks/{network_code}/sources/{content_source_id}/content/{content_id}/adBreaks\n\n GET admanagervideo.googleapis.com/v1/networks/{network_code}/sources/{content_source_id}/content/{content_id}/adBreaks\n\nFor all the parameters:\n\n- `network_code` represents the network code of your Google Ad Manager network.\n- `asset_key` represents the asset key shown in your live stream details page.\n- `custom_asset_key` represents the custom asset key of your live stream.\n- `content_source_id` represents the id of a content source in Google Ad Manager.\n- `content_id` represents the id of a piece of content in Google Ad Manager.\n\nNote: The specified `content_source_id`/`content_id` pair must be associated with a live stream in Google Ad Manager.\n\n##### Request body - only used to create an Ad Break (POST)\n\n\u003cbr /\u003e\n\n| Object |||\n| \u003cbr /\u003e `expectedDuration` \u003cbr /\u003e | Required | The duration of this ad break, using Google's standard duration format (xx.xxxs where xx.xxx is the number of seconds) |\n| \u003cbr /\u003e `customParams` \u003cbr /\u003e | Optional | Key-value pairs to be included on ad requests for this break for custom criteria targeting in AM360, separated by \u003cbr /\u003e `=` and joined by `&` . Example: `key=value&key2=value2,value3` \u003cbr /\u003e For more information on targeting, see [Supply targeting parameters to your stream](//support.google.com/admanager/answer/7320899). |\n| \u003cbr /\u003e `podTemplateName` \u003cbr /\u003e | Optional | The ad pod template name |\n| \u003cbr /\u003e `scte35CueOut` \u003cbr /\u003e | Optional | Base-64-encoded data from the scte35 cue out. Can include the \u003cbr /\u003e `splice_insert()` or `time_signal()` command. Examples: - time_signal(): \u003cbr /\u003e `/DA0AAAAAAAA///wBQb+cr0AUAAeAhxDVUVJSAAAjn/PAAGlmbAICAAAAAAsoKGKNAIAmsnRfg==` \u003cbr /\u003e - splice_insert(): \u003cbr /\u003e `/DAvAAAAAAAA///wFAVIAACPf+/+c2nALv4AUsz1AAAAAAAKAAhDVUVJAAABNWLbowo=` \u003cbr /\u003e |\n|----------------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n\u003cbr /\u003e\n\n### Example requests\n\n##### Create an Ad Break\n\n POST admanagervideo.googleapis.com/v1/networks/.../sources/.../content/.../adBreaks\n Content-Type: application/json\n Authorization: Bearer ...\n {\n \"expectedDuration\": \"30s\",\n \"scte35CueOut\": \"/DA0AAAAAAAA///wBQb+cr0AUAAeAhxDVUVJSAAAjn/PAAGlmbAICAAAAAAsoKGKNAIAmsnRfg==\",\n \"customParams\": \"param1=value1¶m2=value2\",\n \"podTemplateName\": \"podtemplate\"\n }\n\n###### Response body\n\nThe response body contains all of the parameters sent in the `adBreak` object, as well as an additional `name` field, which contains the Google-wide standard ID of the created ad break. This field is returned in the following format: \n\n networks/{network_code}/assets/{asset_key}/adBreaks/{ad_break_id}\n\n###### Example response\n\n HTTP/1.1 200 OK\n {\n \"name\": \"networks/.../assets/.../adBreaks/1\",\n \"expectedDuration\": \"30s\",\n \"scte35CueOut\": \"/DA0AAAAAAAA///wBQb+cr0AUAAeAhxDVUVJSAAAjn/PAAGlmbAICAAAAAAsoKGKNAIAmsnRfg==\",\n \"customParams\": \"param1=value1¶m2=value2\",\n \"podTemplateName\": \"podtemplate\"\n }\n\n##### List assigned Ad Breaks\n\n GET admanagervideo.googleapis.com/v1/networks/.../sources/.../content/.../adBreaks\n Content-Type: application/json\n Authorization: Bearer ...\n\n###### Response body\n\nThe response body contains the ad breaks with an additional `breakState` field for each ad break assigned to the stream. `breakState` field supports the following values: \n\n // Ad break decisioning has started.\n BREAK_STATE_DECISIONED\n\n // Break has started to be delivered to end users.\n BREAK_STATE_COMPLETE\n\n###### Example response\n\n HTTP/1.1 200 OK\n {\n \"name\": \"networks/.../assets/.../adBreaks/1\",\n \"expectedDuration\": \"30s\",\n \"breakState\": \"BREAK_STATE_COMPLETE\"\n }"]]