Hi<

I am trying to use the sandbox and  ma having issues.  I am using
python and v201109.  I thought that the sandbox was to be filled with
data?

Anyway.. I ran the below to initialize my sandbox...

adwords_api_python_15.1.5/examples/adspygoogle/adwords/v201109/
account_management/get_client_customer_id.py I received a customer
id.  Great.

Now...nothing works.....

Here is my sample header file...and how I initialize

headers = {
      'email': '[email protected]',
      'password': 'test',
      'userAgent': 'Test',
      'developerToken': '[email protected]++USD',
    }
client = AdWordsClient(headers=headers)
client.use_mcc = True
client.SetClientCustomerId('1311089936')


Now...when I run GetCampaignService...this is what I get

No campaigns were found.

Usage: 1 units, 1 operations


Ok..then one would think I would have to create a campaign......here
is my error using the below code

 File "/home/ubuntu/workspace/AdNetScalesProduction/trunk/cron/
adhui_python_classes/testsand.py", line 126, in <module>
    addCampaign(client)
  File "/home/ubuntu/workspace/AdNetScalesProduction/trunk/cron/
adhui_python_classes/testsand.py", line 106, in addCampaign
    campaigns = campaign_service.Mutate(operations)[0]
  File "/usr/local/lib/python2.7/dist-packages/adspygoogle/common/
GenericApiService.py", line 320, in CallMethod
    self._HandleLogsAndErrors(buf, start_time, stop_time, error)
  File "/usr/local/lib/python2.7/dist-packages/adspygoogle/adwords/
GenericAdWordsService.py", line 250, in _HandleLogsAndErrors
    raise e
adspygoogle.adwords.AdWordsErrors.AdWordsApiError:
[OperationAccessDenied.ADD_OPERATION_NOT_PERMITTED @ operations[0]]


def addCampaign(client):
  # Initialize appropriate service.
  campaign_service = client.GetCampaignService(
      'https://adwords-sandbox.google.com', 'v201109')

  # Construct operations and add campaign.
  operations = [{
      'operator': 'ADD',
      'operand': {
          'name': 'Interplanetary Cruise #%s' % Utils.GetUniqueName(),
          'status': 'PAUSED',
          'biddingStrategy': {
              'xsi_type': 'ManualCPC'
          },
          'endDate': date(date.today().year + 1, 12, 31).strftime('%Y%m
%d'),
          'budget': {
              'period': 'DAILY',
              'amount': {
                  'microAmount': '50000000'
              },
              'deliveryMethod': 'STANDARD'
          },
          'networkSetting': {
              'targetGoogleSearch': 'true',
              'targetSearchNetwork': 'true',
              'targetContentNetwork': 'false',
              'targetContentContextual': 'false',
              'targetPartnerSearchNetwork': 'false'
          }
      }
  }]
  campaigns = campaign_service.Mutate(operations)[0]

  # Display results.
  for campaign in campaigns['value']:
    print ('Campaign with name \'%s\' and id \'%s\' was added.'
           % (campaign['name'], campaign['id']))

  print
  print ('Usage: %s units, %s operations' % (client.GetUnits(),
                                             client.GetOperations()))




-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords 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

Reply via email to