I am very new to the AdWords API and have done a lot of research and testing trying to authenticate and test the API. I believe I have followed the authentication flow correctly, but since I am consistently getting the same error I wanted to reach out to an AdWords API Team Member and see if they could tell me what I am missing.
I am using the googleads python client library to authenticate and interact with the AdWords API. This is a snippet of my code I am using (not including the exact values of my variables)
from googleads import adwords
from googleads import oauth2
from suds import WebFault
import json
scope = 'https://www.googleapis.com/auth/adwords'
key_file_path = 'FULL PATH OF MY JSON KEY FILE'
prod_man_token = 'PRODUCTION MANAGER DEVELOPMENT TOKEN'
test_man_cust_id = 'CUSTOMER ID FOR MY TEST MANAGER ACCOUNT (XXX-XXX-XXX)'
oauth2_client = oauth2.GoogleServiceAccountClient(scope, key_file=key_file_path)
adwords_client = adwords.AdWordsClient(prod_man_token, oauth2_client, client_customer_id=test_man_cust_id)
user_list_service = adwords_client.GetService('AdwordsUserListService')
operation = {'operator': 'ADD',
'operand': {'xsi_type': 'BasicUserList',
'name': 'Test List',
'description': 'Testing API',
'membershipLifeSpan': '365',
'conversionTypes': [],
# Optional field.
'status': 'OPEN'
}
}
operations = [json.dumps(operation)]
try:
result = user_list_service.mutate(operations)
print result
except WebFault, e:
print str(e)
I am able to create the oauth_client and adwords_client then use the adwords client to get the AdwordsUserListService, but when I try and execute the mutate call I get the following error:
Server raised fault: '[AuthenticationError.NOT_ADS_USER @ ; trigger:'<null>']'
Is there something I'm missing? I would be willing to give more specific account information to an API team member in a more private form.