建立新的資料區隔
您可以使用 curators.dataSegments.create 方法建立新的資料區隔。建立後,資料區隔會處於 ACTIVE 狀態,即時出價放送的交易或套裝組合即可指定該資料區隔。
如要讓媒體企劃人員在指定交易或套裝組合時看到資料區隔,請在收錄使用者介面的「資料區隔設定」分頁中,啟用「區隔顯示設定」。
下列範例會發出 HTTP POST 要求,並在 JSON 主體中包含 DataSegment 物件。要求會傳送至 API 端點,並使用指定設定建立資料區隔。
curl API 呼叫範例
要求
curl --request POST \
'https://authorizedbuyersmarketplace.googleapis.com/v1beta/curators/[YOUR_ACCOUNT_ID]/dataSegments?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"cpmFee":{"nanos":100,"units":0,"currencyCode":"USD"},"name":"curators/[YOUR_ACCOUNT_ID]/dataSegments/test-data-segment-2"}' \
--compressed
回覆
{
"name": "curators/[YOUR_ACCOUNT_ID]/dataSegments/test-data-segment-2",
"createTime": "2025-08-14T17:45:08.744379Z",
"updateTime": "2025-08-14T17:45:08.744379Z",
"cpmFee": {
"currencyCode": "USD",
"nanos": 100
},
"state": "ACTIVE"
}
修改現有資料區隔
如要修改現有資料區隔,可以使用 curators.dataSegments.patch 方法。舉例來說,您可以使用這個方法調整資料區隔的 cpmFee 欄位。
下列範例會發出 HTTP PATCH 要求,並在 JSON 主體中包含 DataSegment 物件。要求會傳送至 API 端點,修改指定的資料區隔,且只會修改 updateMask 中指定的 DataSegment.cpmFee.nanos 欄位。
curl API 呼叫範例
要求
curl --request PATCH \
'https://authorizedbuyersmarketplace.googleapis.com/v1beta/curators/[YOUR_ACCOUNT_ID]/dataSegments/test-data-segment-2?updateMask=cpmFee.nanos&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"cpmFee":{"nanos":50}}' \
--compressed
回覆
{
"name": "curators/[YOUR_ACCOUNT_ID]/dataSegments/test-data-segment-2",
"createTime": "2025-08-14T17:45:08.744Z",
"updateTime": "2025-08-14T17:56:02.200619Z",
"cpmFee": {
"currencyCode": "USD",
"nanos": 50
},
"state": "ACTIVE"
}