Migrate from v1 to v2

Last update: 2022-12-06

Migrate your application

Migrating from v1 to v2 requires updating your endpoint URLs to call v2 and updating your application to account for breaking changes.

Update your API calls from v1 to v2

To use v2 instead of v1, you need to update your requests to use new v2 endpoints.

For example, to call the advertisers.get method with v1, you would use the following URL:

GET https://displayvideo.googleapis.com/v1/advertisers/advertiserId

For v2, update the URL to the following:

GET https://displayvideo.googleapis.com/v2/advertisers/advertiserId

If you are using a client library to make requests to the API, use the most recent version of the client library and update your configuration to use v2.

Make required changes

We’re introducing a number of breaking changes in v2. Review the following instructions and make the required changes relevant to your existing use of the Display & Video 360 API.

Update calls to targeting methods

Update calls to advertisers.lineItems service

  • The field inventorySourceIds has been removed. Manage inventory source assignment using AssignedTargetingOption resources of TARGETING_TYPE_INVENTORY_SOURCE.
  • The following LineItemWarningMessage enum values have been deprecated in v2 and will no longer be surfaced in LineItem.warningMessages:

  • The triggerId field has been removed from the LineItemFlight object and the LINE_ITEM_FLIGHT_DATE_TYPE_TRIGGER value has been removed from the LineItemFlightDateType enum type. v2 does not support setting line items to spend based on the activation of manual triggers.

Update calls to customBiddingAlgorithms service

The customBiddingAlgorithmState and modelReadiness fields have been replaced with the modelDetails field, which provides the readiness and suspension states of the existing algorithm model for each advertiser that has access through a list of CustomBiddingModelDetails objects.

Additional changes

In addition to the breaking changes listed above, v2 also introduces new features.

Features added to v2 after the initial launch can be found in our release notes.

Read-only access to YouTube line items

In v2, YouTube line items and their targeting settings can be retrieved using the advertisers.lineItems and advertisers.lineItems.targetingTypes.assignedTargetingOptions services, respectively. The API provides read-only access, meaning that any attempted write requests made to these line items will return an error. YouTube line items will be of one of the following LineItemType values:

New methods enabling better performance

In v2, the advertisers.lineItems service provides new methods to use in place of batched requests for better performance and reduced quota consumption:

Partial write access for insertion order targeting

In v2, you can edit a subset targeting settings for InsertionOrder resources using new create and delete methods in the advertisers.insertionOrders.targetingTypes.assignedTargetingOptions service. The following targeting types can be fully managed at the insertion order level: