À partir du 8 septembre 2025, chaque nouvelle ligne devra indiquer si elle diffusera ou non des annonces à caractère politique dans l'Union européenne (UE). Les importations de fichiers SDF et les appels à l'API Display & Video 360 qui ne fournissent pas de déclarations échoueront. Pour savoir comment mettre à jour votre intégration afin d'effectuer cette déclaration, consultez notre page sur les abandons de compatibilité.
Crée un élément de campagne dont les paramètres (y compris le ciblage) sont hérités de l'ordre d'insertion et un élément entityStatusENTITY_STATUS_DRAFT. Si l'opération aboutit, elle renvoie l'élément de campagne que vous venez de créer. Il existe des valeurs par défaut basées sur les trois champs:
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003eThis API endpoint generates a new line item with settings inherited from the insertion order and a draft status.\u003c/p\u003e\n"],["\u003cp\u003eYouTube & Partners line items are not supported by this endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThe request must specify the advertiser ID, insertion order ID, display name, and line item type.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful execution, the API returns the newly created LineItem object.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/display-video\u003c/code\u003e scope.\u003c/p\u003e\n"]]],[],null,["# Method: advertisers.lineItems.generateDefault\n\n| Display \\& Video 360 API v2 has sunset.\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- [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/v2/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/v2/advertisers.insertionOrders#InsertionOrder.FIELDS.insertion_order_type)\n- The insertion order's [automationType](/display-video/api/reference/rest/v2/advertisers.insertionOrders#InsertionOrderBudget.FIELDS.automation_type)\n- The given [lineItemType](/display-video/api/reference/rest/v2/advertisers.lineItems/generateDefault#body.request_body.FIELDS.line_item_type)\n\nYouTube \\& Partners line items cannot be created or updated using the API.\n\n### HTTP request\n\n`POST https://displayvideo.googleapis.com/v2/advertisers/{advertiserId}/lineItems:generateDefault`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path 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\n### Request 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/v2/advertisers.lineItems#LineItemType), \"mobileApp\": { object (/display-video/api/reference/rest/v2/advertisers.lineItems#MobileApp) } } ``` |\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/v2/advertisers.lineItems#LineItemType)`)` Required. The type of the line item. |\n| `mobileApp` | `object (`[MobileApp](/display-video/api/reference/rest/v2/advertisers.lineItems#MobileApp)`)` The mobile app promoted by the line item. This is applicable only when [lineItemType](/display-video/api/reference/rest/v2/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\n### Response body\n\nIf successful, the response body contains an instance of [LineItem](/display-video/api/reference/rest/v2/advertisers.lineItems#LineItem).\n\n### Authorization 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](https://developers.google.com/identity/protocols/OAuth2)."]]