Hey Brahani, and thanks for the swift reply Sorry I couldn't get back to you sooner.
I can confirm that I'm using the AdWords API. I was mistaken to say it was the Ads API in the question description. I've been looking at the links you sent me, but I'm not getting anywhere. I tried generating the LABEL_REPORT by following this guide <https://developers.google.com/adwords/api/docs/samples/python/reporting>, which gives me this output: Report type "LABEL_REPORT" contains the following fields: - AccountDescriptiveName (String) := [] - AdGroupCreativesCount (Long) := [] - AdGroupCriteriaCount (Long) := [] - AdGroupsCount (Long) := [] - CampaignsCount (Long) := [] - ExternalCustomerId (Long) := [] - LabelId (Long) := [] - LabelName (String) := [] - UserListsCount (Long) := [] I've also tried using the LabelService.get() method to get all labels, and discovered something curious. I'll type out the print service = client.GetService("LabelService", version=API_VERSION) selector = { "fields": ["LabelId", "LabelName"] } result = service.get(selector) print(result) # Print: # { # 'totalNumEntries': 4 # 'Page.Type': 'LabelPage', # 'entries': [ # { # 'id': xxxxxxxxxx, # 'name': 'X', # 'attribute.... # }, # { # 'id': yyyyyyyyyy, # 'name': 'Y', # ... # }, # { # 'id': zzzzzzzzzz, # 'name': 'Stupid Labels', # ... # }, # { # 'id': wwwwwwwwww, # 'name': 'SomeLabel', # ... # } # ] #} The interesting thing here is that I'm finding 4 labels, but I can only see 3 of them when attempting to add labels to this account's Ads. As previously stated, the "Y" label is the one I'm missing in the GUI, which I'm guessing is connected to the EntityNotFound error I'm experiencing. To reiterate: I have several labels "X" on other accounts, and one label "Y" on another account, so I do believe that the label "Y" for this account exists, and that it's the one I'm getting, but that there's a link missing somewhere. The "Stupid Labels" label was created by my find_or_create() method, and I was able to label the ads after creating it. Here's the code I'm using to label ads after getting the ID from the find_or_create() method def add_label_to_ad(client, ad_id, adgroup_id, label_id): adgroupadservice = client.GetService("AdGroupAdService", version=API_VERSION) add_op = ( { "xsi_type": "AdGroupAdLabelOperation", "operator": "ADD", "operand": { "xsi_type": "AdGroupAdLabel", "adGroupId": adgroup_id, "adId": ad_id, "labelId": label_id, }, }, ) result = adgroupadservice.mutateLabel(add_op) return result fredag 13. desember 2019 18.05.58 UTC+1 skrev adsapiforumadvisor følgende: > > Hi Erik, > > Thank you for the detailed explanation. Based on the logs it looks like > you're using AdWords API. Could you please confirm if you're using Google > Ads API or AdWords API? You will be able to find the specific labels in the > account using the LabelService.get() > <https://developers.google.com/adwords/api/docs/reference/v201809/LabelService?hl=en#get_1> > > operation or the Label Report > <https://developers.google.com/adwords/api/docs/appendix/reports/label-report?hl=en> > > which will generate the Label name along with the Label Ids. It is not > possible to look up the Label Id through the Google Ads UI. Could you > please try the above methods and try assigning them to an ad? You may refer > to this guide > <https://developers.google.com/adwords/api/docs/guides/labels> for more > information. > > Regards, > Bharani, Google Ads API Team > > ref:_00D1U1174p._5001UOEUyn:ref > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/99b02bf5-cb5f-4653-a3e2-9077e73c4dd2%40googlegroups.com.
