Here's how to create or delete a PartnerLink resource. The Data Manager API
supports creating partner links for the following account types:
- Google Ads accounts
- Display & Video 360 partner or Display & Video 360 advertiser accounts
Create a link
Create a PartnerLink by sending a CreatePartnerLinkRequest.
Construct the request body
Create a PartnerLink resource. Here are the fields to set.
owning_accountIdentifies the advertiser account that owns the link. Set to a
ProductAccountobject.Set the
account_typeto theAccountTypeof the advertiser account.Set the
account_idto the ID of the advertiser account.Consult the destinations and headers guide for instructions on the ID to use for each type of advertiser.
partner_accountIdentifies the partner account. Set to a
ProductAccountobject.Set the
account_typeto theAccountTypeof the partner account. For example, if the link is from an advertiser account to a data partner account, set this field toDATA_PARTNER.Set the
account_idto the ID of the partner account.
Construct the request
To create a partner link, construct a CreatePartnerLinkRequest.
Set the
parentto the resource name of the advertiser account. Use the format:accountTypes/{account_type}/accounts/{account}Set the
partner_linkto thePartnerLinkresource you constructed.If your credentials are for a Google Account with access to a parent account of the advertiser account, such as a Google Ads manager account or a Display & Video 360 Partner account, set the
login-accountheader as described in Configure destinations and headers.
Here are sample requests in JSON to create a link to a data partner account in different types of advertiser accounts.
Google Ads
{ "parent": "accountTypes/GOOGLE_ADS/accounts/INSERT_GOOGLE_ADS_CUSTOMER_ID", "partner_link": { "owning_account": { "accountType": "GOOGLE_ADS", "accountId": "INSERT_GOOGLE_ADS_CUSTOMER_ID" }, "partner_account": { "accountType": "DATA_PARTNER", "accountId": "INSERT_DATA_PARTNER_ACCOUNT_ID" } } }
DV360 advertiser
{ "parent": "accountTypes/DISPLAY_VIDEO_ADVERTISER/accounts/INSERT_DISPLAY_VIDEO_ADVERTISER_ID", "partner_link": { "owning_account": { "accountType": "DISPLAY_VIDEO_ADVERTISER", "accountId": "INSERT_DISPLAY_VIDEO_ADVERTISER_ID" }, "partner_account": { "accountType": "DATA_PARTNER", "accountId": "INSERT_DATA_PARTNER_ACCOUNT_ID" } } }
DV360 partner
{ "parent": "accountTypes/DISPLAY_VIDEO_PARTNER/accounts/INSERT_DISPLAY_VIDEO_PARTNER_ID", "partner_link": { "owning_account": { "accountType": "DISPLAY_VIDEO_PARTNER", "accountId": "INSERT_DISPLAY_VIDEO_PARTNER_ID" }, "partner_account": { "accountType": "DATA_PARTNER", "accountId": "INSERT_DATA_PARTNER_ACCOUNT_ID" } } }
Send the request
Send the request and, if required, include
request headers. Use credentials for a Google Account with
access to the owning_account.
If the request succeeds, the response contains the created PartnerLink with
the id and name populated.
If the request fails, inspect the errors to determine the cause of the failure, update the request and headers to fix any issues, and then send the updated request and headers.
Delete a link
To delete a PartnerLink, send a DeletePartnerLinkRequest with the name
set to the resource name. Set headers if required.