Early ad break notification v1
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
- ตัวระบุของสตรีมแบบสดที่เกี่ยวข้องซึ่งกำลังสร้างช่วงพักโฆษณา ตัวระบุนี้อาจเป็นค่าใดค่าหนึ่งต่อไปนี้
- "คีย์เนื้อหา" ของสตรีมแบบสด
- "คีย์เนื้อหาที่กำหนดเอง" ของสตรีมแบบสด ซึ่งช่วยให้คุณจัดการพื้นที่คีย์ของคุณเองได้โดยระบุสตริงตัวระบุของคุณเอง
- "รหัสแหล่งที่มาของเนื้อหา" และ "รหัสเนื้อหา" ของสตรีมแบบสด
หมายเหตุ: คุณต้องได้รับอนุญาตให้ใช้ตัวระบุประเภทนี้ โปรดติดต่อผู้จัดการฝ่ายดูแลลูกค้าเพื่อสอบถามข้อมูลเพิ่มเติม
- ระยะเวลาที่คาดไว้ของช่วงพักโฆษณาถัดไป ระยะเวลาต้องใกล้เคียงกับความยาวของช่วงพักโฆษณาจริงมากที่สุด
นอกจากช่องที่ต้องกรอกเหล่านี้แล้ว คุณยังส่งพารามิเตอร์การกำหนดเป้าหมายที่กำหนดเอง ชื่อเทมเพลตพ็อดโฆษณาที่จะใช้ หรือข้อมูล Cue Out ของ SCTE35 ได้ด้วย (หากมี)
ข้อกำหนดเบื้องต้น
หากต้องการใช้ EABN API คุณต้องสร้างบัญชีบริการและเพิ่มบัญชีนั้นลงในเครือข่าย Google Ad Manager
การสร้างบัญชีบริการ
หากต้องการสร้างบัญชีบริการสำหรับการเรียกใช้ EABN API ให้ทำตามขั้นตอนต่อไปนี้ - หากคุณมีบัญชี Google Cloud ให้ใช้โมดูล IAM เพื่อสร้างบัญชีบริการ ดูข้อมูลเพิ่มเติมได้ที่การสร้างและจัดการบัญชีบริการ - หากคุณไม่มีบัญชี Google Cloud ให้ทําตามขั้นตอนต่อไปนี้เพื่อสร้างบัญชีจาก Google API Console
- สร้างโปรเจ็กต์ใหม่หรือเลือกโปรเจ็กต์ที่มีอยู่
- ในหน้าข้อมูลเข้าสู่ระบบ ให้คลิกจัดการบัญชีบริการ
- ในหน้าบัญชีบริการ ให้คลิกสร้างบัญชีบริการ
- ในหน้าสร้างบัญชีบริการ ให้ป้อนรายละเอียดบัญชี จากนั้นคลิกสร้าง
เมื่อสร้างบัญชีบริการแล้ว ให้คัดลอกคีย์ JSON ของบัญชี ซึ่งจะใช้สำหรับการตรวจสอบสิทธิ์
การเปิดใช้ API
เมื่อสร้างบัญชีบริการแล้ว ให้ระบุข้อมูลต่อไปนี้แก่ผู้จัดการฝ่ายดูแลลูกค้าเพื่อเปิดใช้ API สําหรับบัญชี
- อีเมลบัญชี Google Cloud ของคุณ
- บัญชีบริการ
- รหัสเครือข่ายของเครือข่าย Google Ad Manager
หลังจากผู้จัดการฝ่ายดูแลลูกค้าเปิดใช้ API แล้ว ให้ทําตามขั้นตอนต่อไปนี้เพื่อเปิดใช้ API
- ในคลัง Google API ให้ค้นหา "Google Ad Manager Video API"
- คลิกเปิดใช้
หมายเหตุ: หาก API ไม่ปรากฏในผลการค้นหา ให้ติดต่อผู้จัดการฝ่ายดูแลลูกค้าเพื่อยืนยันว่าบัญชีของคุณเปิดใช้ DAI API แล้ว
การใช้ API
คุณเรียกใช้ EABN API ได้โดยใช้คำขอ JSON/REST
หากต้องการส่งการแจ้งเตือนช่วงพักโฆษณาก่อนเวลา ให้ส่งคำขอ POST ไปยัง URL EABN ที่ถูกต้องรายการใดรายการหนึ่งจาก 3 รายการ ทั้งนี้ขึ้นอยู่กับวิธีที่คุณต้องการระบุสตรีมแบบสด ส่วนต่อไปนี้จะอธิบายความแตกต่างระหว่าง 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
หากต้องการใช้รหัสแหล่งที่มาของเนื้อหาและแนวทาง 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 Ad Manager
asset_key
แสดงถึงคีย์ชิ้นงานที่แสดงในหน้ารายละเอียดของไลฟ์สด
custom_asset_key
แสดงคีย์เนื้อหาที่กำหนดเองของสตรีมแบบสด
content_source_id
แสดงถึงรหัสของแหล่งที่มาของเนื้อหาใน Google Ad Manager
content_id
แสดงถึงรหัสของเนื้อหาใน Google Ad Manager
หมายเหตุ: คู่ content_source_id
/content_id
ที่ระบุต้องเชื่อมโยงกับสตรีมแบบสดใน Google Ad Manager
เนื้อหาคําขอ - ใช้เพื่อสร้างช่วงพักโฆษณาเท่านั้น (POST)
วัตถุ |
expectedDuration
| ต้องระบุ | ระยะเวลาของช่วงพักโฆษณานี้จะใช้รูปแบบระยะเวลามาตรฐานของ Google (xx.xxxs โดยที่ xx.xxx คือจำนวนวินาที) |
customParams
| ไม่บังคับ | คู่คีย์-ค่าจะรวมอยู่ในคำขอโฆษณาของช่วงพักโฆษณานี้สำหรับการกำหนดเป้าหมายเกณฑ์ที่กำหนดเองใน AM360 โดยคั่นด้วย
=
และเข้าร่วมโดย
&
. ตัวอย่าง:
key=value&key2=value2,value3
ดูข้อมูลเพิ่มเติมเกี่ยวกับการกำหนดเป้าหมายได้ที่จัดเตรียมพารามิเตอร์การกำหนดเป้าหมายไปยังสตรีมของคุณ
|
podTemplateName
| ไม่บังคับ | ชื่อเทมเพลตพ็อดโฆษณา |
scte35CueOut
| ไม่บังคับ | ข้อมูลที่มีการเข้ารหัส Base64 จากข้อความสุดท้าย SCTE-35 ใส่ข้อมูลต่อไปนี้ได้
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
รวมถึงฟิลด์ name
เพิ่มเติมซึ่งมีรหัสมาตรฐานทั่วทั้ง Google ของช่วงพักโฆษณาที่สร้างขึ้น ระบบจะแสดงผลช่องนี้ในรูปแบบต่อไปนี้
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 }"]]