Im new to using AdWords API with Python, and Im trying to make some simple tasks such as pausing a campign vased on the label id, but its not working. Hoping for some help please;
#!/usr/bin/env python # # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """This example updates a campaign by setting its status to PAUSED. To get campaigns, run get_campaigns.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication information" section of our README. """ from googleads import adwords LABEL_ID = 'XXXXXXXXX' def main(client, label_id): # Initialize appropriate service. campaign_service = client.GetService('CampaignService', version='v201809') # Construct operations and update campaign. operations = [{ 'operator': 'SET', 'operand': { 'labelids': label_id, 'status': 'PAUSED' } }] campaigns = campaign_service.mutate(operations) # Display results. for campaign in campaigns['value']: print ('Campaign with name "%s" and id "%s" was updated.' % (campaign['name'], campaign['labelids'])) if __name__ == '__main__': # Initialize client object. adwords_client = adwords.AdWordsClient.LoadFromStorage() main(adwords_client, LABEL_ID) -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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]. Visit this group at https://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/9376884c-7fd0-42b3-87ca-e7df5f3d0247%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
