รายการโฆษณาใหม่ทุกรายการต้องประกาศว่าจะแสดงโฆษณาทางการเมืองในสหภาพยุโรปหรือไม่ การอัปโหลด API ของ Display & Video 360 และ SDF ที่ไม่ได้ระบุการประกาศจะล้มเหลว ดูรายละเอียดเพิ่มเติมได้ที่
หน้าการเลิกใช้งาน
Method: advertisers.lineItems.generateDefault
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างรายการโฆษณาใหม่ที่มีการตั้งค่า (รวมถึงการกำหนดเป้าหมาย) ที่รับค่ามาจากใบสั่งซื้อการใส่โฆษณาและ ENTITY_STATUS_DRAFT
entityStatus
แสดงรายการโฆษณาที่สร้างขึ้นใหม่หากสำเร็จ ค่าเริ่มต้นจะอิงตาม 3 ฟิลด์ต่อไปนี้
สร้างหรืออัปเดตรายการโฆษณา YouTube และพาร์ทเนอร์โดยใช้ API ไม่ได้
คำขอ HTTP
POST https://displayvideo.googleapis.com/v4/advertisers/{advertiserId}/lineItems:generateDefault
URL ใช้ไวยากรณ์การแปลงรหัส gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
advertiserId |
string (int64 format)
ต้องระบุ รหัสของผู้ลงโฆษณาที่รายการโฆษณานี้เป็นของ
|
เนื้อความของคำขอ
เนื้อหาของคำขอมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
ช่อง |
insertionOrderId |
string (int64 format)
ต้องระบุ รหัสที่ไม่ซ้ำกันของใบสั่งซื้อที่รายการโฆษณาเป็นของ
|
displayName |
string
ต้องระบุ ชื่อที่แสดงของรายการโฆษณา ต้องเข้ารหัส UTF-8 โดยมีขนาดสูงสุด 240 ไบต์
|
lineItemType |
enum (LineItemType )
ต้องระบุ ประเภทของรายการโฆษณา
|
mobileApp |
object (MobileApp )
แอปบนอุปกรณ์เคลื่อนที่ที่รายการโฆษณาส่งเสริม ซึ่งจะมีผลเมื่อ lineItemType เป็น LINE_ITEM_TYPE_DISPLAY_MOBILE_APP_INSTALL หรือ LINE_ITEM_TYPE_VIDEO_MOBILE_APP_INSTALL เท่านั้น
|
containsEuPoliticalAds |
enum (EuPoliticalAdvertisingStatus )
รายการโฆษณานี้จะแสดงโฆษณาทางการเมืองในสหภาพยุโรปหรือไม่ หากตั้งค่า containsEuPoliticalAds เป็น DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING ในผู้ลงโฆษณาหลัก ระบบจะกำหนดค่า DOES_NOT_CONTAIN_EU_POLITICAL_ADVERTISING ให้ช่องนี้หากไม่ได้ระบุไว้เป็นอย่างอื่น จากนั้นจะอัปเดตฟิลด์นี้ได้โดยใช้ UI, API หรือไฟล์ Structured Data ต้องกำหนดฟิลด์นี้เมื่อสร้างรายการโฆษณาใหม่ ไม่เช่นนั้น คำขอ advertisers.lineItems.create จะไม่สำเร็จ
|
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ LineItem
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/display-video
ดูข้อมูลเพิ่มเติมได้ที่OAuth 2.0 Overview
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-09-09 UTC
[null,null,["อัปเดตล่าสุด 2025-09-09 UTC"],[],[],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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a new line item with settings (including targeting) inherited from the insertion order and an `ENTITY_STATUS_DRAFT` [entityStatus](/display-video/api/reference/rest/v4/advertisers.lineItems#LineItem.FIELDS.entity_status). Returns the newly created line item if successful. There are default values based on the three fields:\n\n- The insertion order's [insertionOrderType](/display-video/api/reference/rest/v4/advertisers.insertionOrders#InsertionOrder.FIELDS.insertion_order_type)\n- The insertion order's [automationType](/display-video/api/reference/rest/v4/advertisers.insertionOrders#InsertionOrderBudget.FIELDS.automation_type)\n- The given [lineItemType](/display-video/api/reference/rest/v4/advertisers.lineItems/generateDefault#body.request_body.FIELDS.line_item_type)\n\nYouTube \\& Partners line items cannot be created or updated using the API.\n\nHTTP request\n\n`POST https://displayvideo.googleapis.com/v4/advertisers/{advertiserId}/lineItems:generateDefault`\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\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"insertionOrderId\": string, \"displayName\": string, \"lineItemType\": enum (/display-video/api/reference/rest/v4/advertisers.lineItems#LineItemType), \"mobileApp\": { object (/display-video/api/reference/rest/v4/advertisers.lineItems#MobileApp) }, \"containsEuPoliticalAds\": enum (/display-video/api/reference/rest/v4/EuPoliticalAdvertisingStatus) } ``` |\n\n| Fields ||\n|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `insertionOrderId` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Required. The unique ID of the insertion order that the line item belongs to. |\n| `displayName` | `string` Required. The display name of the line item. Must be UTF-8 encoded with a maximum size of 240 bytes. |\n| `lineItemType` | `enum (`[LineItemType](/display-video/api/reference/rest/v4/advertisers.lineItems#LineItemType)`)` Required. The type of the line item. |\n| `mobileApp` | `object (`[MobileApp](/display-video/api/reference/rest/v4/advertisers.lineItems#MobileApp)`)` The mobile app promoted by the line item. This is applicable only when [lineItemType](/display-video/api/reference/rest/v4/advertisers.lineItems/generateDefault#body.request_body.FIELDS.line_item_type) is either `LINE_ITEM_TYPE_DISPLAY_MOBILE_APP_INSTALL` or `LINE_ITEM_TYPE_VIDEO_MOBILE_APP_INSTALL`. |\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\n\nIf successful, the response body contains an instance of [LineItem](/display-video/api/reference/rest/v4/advertisers.lineItems#LineItem).\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)."]]