500 internal error. Adding topics exclusions through Ads API

21 views
Skip to first unread message

Zig-Zag

unread,
Jun 6, 2019, 5:35:51 PM6/6/19
to AdWords API and Google Ads API Forum
Hello, i'm receive 500 internal error while trying to add topic exclusions using Ads API

here is part of the code:

campaign_service = client.get_service('CampaignService', version='v1')
campaign_criterion_service = client.get_service('CampaignCriterionService', version='v1')

campaign_criterion_operation = client.get_type('CampaignCriterionOperation', version='v1')

campaign_criterion = campaign_criterion_operation.create
campaign_criterion.campaign.value = campaign_service.campaign_path(customer_id, campaign_id)
campaign_criterion.negative.value = True

for category in ['Arts&Entertainment', 'Offbeat']:
    topic_path = campaign_criterion.topic.path.add()
    topic_path.value = category

campaign_criterion_service.mutate_campaign_criteria(customer_id, [campaign_criterion_operation])

also it would great to know if there is a better solution, like .extend(['Arts&Entertainment', 'Offbeat']), because .extend doesn't work in this case

Thanks!

Google Ads API Forum Advisor Prod

unread,
Jun 7, 2019, 3:30:46 AM6/7/19
to adwor...@googlegroups.com
Hi,

So I can further investigate, could you also provide the complete JSON logs generated when you encountered the "500 internal error"?

You may send your reply using the Reply privately to author option.

Thanks and regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UBlvqv:ref
Reply all
Reply to author
Forward
0 new messages