Label Object Associations

Amazon Ads API v1 - label to object associations

Documentation: https://advertising.amazon.com/API/docs/en-us/api-spec-v1-label-object-associations Specification: https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/AmazonAdsAPIALLLabelObjectAssociationsContract_prod_3p.json

One route, read only:

POST /adsApi/v1/query/labelObjectAssociations

Labels lists the labels that exist; this family lists what each one is applied to, so the pair answers “which labels do I have” and “what is tagged”.

The required member is labelObjectTypeFilter, not the adProductFilter the campaign families carry, and it takes exactly one value:

AD_GROUP, CAMPAIGN, DEAL, INVENTORY_GROUP

adProductFilter, labelIdFilter and labelObjectIdFilter are all optional, and the two id filters take 1 to 50 values each.

maxResults reaches 5000 here, far above the 100 of the campaign families, because associations grow with the number of tagged objects.

Warning

DEAL and INVENTORY_GROUP are deal-domain object types, where a Sponsored Ads seller profile answers 401, the same way it does on the DSP families.

Warning

The route answers 401 Unauthorized with Customer <account> is not authorized to access account on a Sponsored Ads seller profile, for both CAMPAIGN and AD_GROUP. Its sibling Labels refuses the same way, so the whole label family is not enabled for such a profile even though campaign_view is declared as sufficient.

The call is built from the contract and verified offline; it has not been exercised against the service from this account.

class ad_api.api.v1.LabelObjectAssociations(account='default', marketplace: Marketplaces = Marketplaces.EU, credentials=None, debug=False)

Amazon Ads API v1 - label to object associations

One route, read only:

POST /adsApi/v1/query/labelObjectAssociations

Labels itself lists the labels that exist. This family lists what each label is applied to, so the pair answers “which labels do I have” and “what is tagged”.

The required member is labelObjectTypeFilter, not the adProductFilter the campaign families carry, and it takes exactly one value:

AD_GROUP, CAMPAIGN, DEAL, INVENTORY_GROUP

query_label_object_associations(body: dict) → ApiResponse

Amazon Ads API v1 - Query Label Object Associations (operationId: QueryLabelObjectAssociation)

Request Body [Required]
labelObjectTypeFilter (dict) : [required] exactly one value | include (list<LabelObjectType>) : Enum [ AD_GROUP, CAMPAIGN, DEAL, INVENTORY_GROUP ]
adProductFilter (dict) : [optional] exactly one value
labelIdFilter (dict) : [optional] 1..50 ids
labelObjectIdFilter (dict) : [optional] 1..50 ids
maxResults (int) : 1..5000, default 100
nextToken (string)
Returns
labelObjectAssociations (list<LabelObjectAssociation>) : 0..5000 | labelObjectAssociationId (string) : [required] | labelId (string) : [required] the label being applied | labelObjectId (string) : [required] the object, e.g. a deal id or an ad group id | labelObjectType (LabelObjectType) : [required] | adProduct (AdProduct)
nextToken (string)

maxResults reaches 5000 here, far above the 100 of the campaign families, because associations grow with the number of tagged objects.

Requires one of these permissions:

campaign_edit, campaign_view