每个新订单项都需要声明是否会投放欧盟 (EU) 政治广告。Display & Video 360 API 和未提供声明的 SDF 上传操作将会失败。如需了解详情,请参阅我们的
弃用页面。
Method: advertisers.lineItems.duplicate
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
复制订单项。如果成功,则返回所创建的订单项的 ID。
无法使用 API 创建或更新 YouTube 及合作伙伴订单项。
此方法经常出现高延迟。我们建议您增加默认超时时间,以避免出错。
HTTP 请求
POST https://displayvideo.googleapis.com/v4/advertisers/{advertiserId}/lineItems/{lineItemId}:duplicate
网址采用 gRPC 转码语法。
路径参数
参数 |
advertiserId |
string (int64 format)
必需。相应订单项所属的广告客户的 ID。
|
lineItemId |
string (int64 format)
必需。要复制的订单项的 ID。
|
请求正文
请求正文中包含结构如下的数据:
字段 |
targetDisplayName |
string
新订单项的显示名称。 必须采用 UTF-8 编码,大小上限为 240 字节。
|
containsEuPoliticalAds |
enum (EuPoliticalAdvertisingStatus )
相应订单项是否会投放欧盟政治广告。 如果父广告客户中的 containsEuPoliticalAds 已设置为 DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING ,则除非另行指定,否则此字段将被分配 DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING 。然后,您可以使用界面、API 或结构化数据文件更新此字段。 创建新订单项时,必须分配此字段。否则,advertisers.lineItems.create 请求将失败。
|
响应正文
JSON 表示法 |
{
"duplicateLineItemId": string
} |
字段 |
duplicateLineItemId |
string (int64 format)
所创建订单项的 ID。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/display-video
如需了解详情,请参阅 OAuth 2.0 Overview。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-09。
[null,null,["最后更新时间 (UTC):2025-09-09。"],[],["The Display & Video 360 API v4 (beta) allows line item duplication via a POST request to `https://displayvideo.googleapis.com/v4/advertisers/{advertiserId}/lineItems/{lineItemId}:duplicate`. It requires `advertiserId` and `lineItemId` path parameters. The request body must include a `targetDisplayName` for the new item. The successful response provides a `duplicateLineItemId`. YouTube & Partners line items cannot be managed and high latency is common. The authorization scope needed is `https://www.googleapis.com/auth/display-video`.\n"],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.DuplicateLineItemResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nDuplicates a line item. Returns the ID of the created line item if successful.\n\nYouTube \\& Partners line items cannot be created or updated using the API.\n\n**This method regularly experiences high latency.** We recommend [increasing your default timeout](/display-video/api/guides/best-practices/timeouts#client_library_timeout) to avoid errors.\n\nHTTP request\n\n`POST https://displayvideo.googleapis.com/v4/advertisers/{advertiserId}/lineItems/{lineItemId}:duplicate`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| `advertiserId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. The ID of the advertiser this line item belongs to. |\n| `lineItemId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. The ID of the line item to duplicate. |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"targetDisplayName\": string, \"containsEuPoliticalAds\": enum (/display-video/api/reference/rest/v4/EuPoliticalAdvertisingStatus) } ``` |\n\n| Fields ||\n|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `targetDisplayName` | `string` The display name of the new line item. Must be UTF-8 encoded with a maximum size of 240 bytes. |\n| `containsEuPoliticalAds` | `enum (`[EuPoliticalAdvertisingStatus](/display-video/api/reference/rest/v4/EuPoliticalAdvertisingStatus)`)` Whether this line item will serve European Union political ads. If [containsEuPoliticalAds](/display-video/api/reference/rest/v4/advertisers#Advertiser.FIELDS.contains_eu_political_ads) has been set to `DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING` in the parent advertiser, then this field will be assigned `DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING` if not otherwise specified. This field can then be updated using the UI, API, or Structured Data Files. This field must be assigned when creating a new line item. Otherwise, **the `advertisers.lineItems.create` request will fail**. |\n\nResponse body If successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------|\n| ``` { \"duplicateLineItemId\": string } ``` |\n\n| Fields ||\n|-----------------------|----------------------------------------------------------------------------------------------------------------------|\n| `duplicateLineItemId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` The ID of the created line item. |\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/display-video`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]