בכל פריט חדש להזמנת שטחי פרסום צריך להצהיר אם הוא יציג מודעות פוליטיות באיחוד האירופי. העלאות של קובצי SDF ושל Display & Video 360 API שלא כוללות הצהרות ייכשלו. לפרטים נוספים אפשר לעיין ב
דף ההוצאות משימוש.
Method: advertisers.lineItems.generateDefault
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יוצר פריט חדש להזמנת פרסום עם הגדרות (כולל טירגוט) שמועברות מהזמנת הפרסום ועם ENTITY_STATUS_DRAFT
entityStatus
. אם הפעולה בוצעה ללא שגיאות, הפונקציה מחזירה את פריט הקו החדש שנוצר. יש ערכי ברירת מחדל שמבוססים על שלושת השדות:
אי אפשר ליצור או לעדכן פריטים מקמפיינים של YouTube והשותפים באמצעות ה-API.
בקשת HTTP
POST https://displayvideo.googleapis.com/v4/advertisers/{advertiserId}/lineItems:generateDefault
כתובת ה-URL כתובה בתחביר של gRPC Transcoding.
פרמטרים של נתיב
פרמטרים |
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 אם לא צוין ערך אחר. אחרי כן אפשר לעדכן את השדה הזה באמצעות ממשק המשתמש, API או קובצי נתונים מובנים. צריך להקצות את השדה הזה כשיוצרים פריט חדש. אחרת, הבקשה לadvertisers.lineItems.create תיכשל.
|
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכיל מופע של LineItem
.
היקפי הרשאה
נדרש היקף ההרשאות הבא של OAuth:
https://www.googleapis.com/auth/display-video
ניתן למצוא מידע נוסף כאן: OAuth 2.0 Overview.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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)."]]