Adding labels with BatchJobService

77 views
Skip to first unread message

Peter

unread,
Feb 9, 2016, 7:20:38 AM2/9/16
to AdWords API Forum
Hi,
I'm trying to add labels to adgroups using BatchJobService but encounter an error. I read in https://developers.google.com/adwords/api/docs/guides/batch-jobs that AdGroupsLabelOperation is a supported operation so I've built following operation that I try to upload (code based on add_complete_campaigns_using_batch_job.py in the Python library):

adgroup_operations = [{'operand': {'adGroupId': id_1, 'labelId': lbl_id1}, 'operator': 'ADD', 'xsi_type': 'AdGroupLabelOperation'}
                               , {'operand': {'adGroupId': id_2, 'labelId': lbl_id2}, 'operator': 'ADD', 'xsi_type': 'AdGroupLabelOperation'}]

batch_job_helper.UploadOperations(upload_url, adgroup_operations)

I get an "GoogleAdsValueError: Unrecognized service for the AdWords API. Service given: AdGroupLabelService" error. Is there a way I can use batch processing for labels?

Thanks,
Peter

Umesh Dengale

unread,
Feb 9, 2016, 11:20:32 AM2/9/16
to AdWords API Forum
Hi Peter,

Could you provide me privately more details about the processing errors, batchJobId or SOAP XML logs for the API call? Just click Reply privately to author in the forum when responding.

Regards,
Umesh, AdWords API Team.

Michael Cloonan (AdWords API Team)

unread,
Feb 9, 2016, 12:20:57 PM2/9/16
to AdWords API Forum
Hello,

This looks like it could be an error with the client library you're using. The client library should automatically choose the correct service for the given operation xsi_type, but it appears that it's not doing that. An AdGroupLabelOperation should be used with the AdGroupService, not the AdGroupLabelService (which doesn't exist).

It looks like this may be the Python library. If so, you can file an issue on their issue tracker here: https://github.com/googleads/googleads-python-lib/issues

If that is in fact some other language, you can look up their issue tracker in GitHub or let me know what language and I will find the issue tracker for you.

Regards,
Mike, AdWords API Team
Reply all
Reply to author
Forward
0 new messages