每个新订单项都需要声明是否会投放欧盟 (EU) 政治广告。Display & Video 360 API 和未提供声明的 SDF 上传操作将会失败。如需了解详情,请参阅我们的
弃用页面。
Method: advertisers.lineItems.duplicate
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
复制订单项。如果成功,则返回所创建的订单项的 ID。
无法使用 API 创建或更新 YouTube 及合作伙伴订单项。
此方法经常出现高延迟。我们建议您增加默认超时时间,以避免出错。
HTTP 请求
POST https://displayvideo.googleapis.com/v3/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。"],[[["\u003cp\u003eDuplicates an existing line item within a specified advertiser, returning the ID of the new line item.\u003c/p\u003e\n"],["\u003cp\u003eThe API request requires the advertiser ID and the ID of the line item to be duplicated.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify a display name for the new line item in the request body.\u003c/p\u003e\n"],["\u003cp\u003eThis method may experience high latency, so increasing your default timeout is recommended.\u003c/p\u003e\n"],["\u003cp\u003eYouTube & Partners line items cannot be duplicated using this API.\u003c/p\u003e\n"]]],["This content describes how to duplicate a line item via an API, excluding YouTube & Partners line items. The HTTP request uses a `POST` method with `advertiserId` and `lineItemId` as required path parameters. The request body requires a `targetDisplayName` for the new line item. Successful responses return a JSON with a `duplicateLineItemId` field. The API call requires OAuth scope authorization and regularly experiences high latency, recommending increased timeouts.\n"],null,["| Display \\& Video 360 API v3 is deprecated and will sunset on **October 7, 2025** . Migrate to [Display \\& Video 360 API v4](/display-video/api/reference/rest/v4) before sunset to avoid an interruption in service.\n- [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/v3/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/v3/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/v3/EuPoliticalAdvertisingStatus)`)` Whether this line item will serve European Union political ads. If [containsEuPoliticalAds](/display-video/api/reference/rest/v3/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)."]]