I have managed to generate developer_token, oauth client_id, oauth client_secret and oauth refresh_token, using the steps described here, and I've set their values in the googleads.yaml. I did not set any value to client_customer_id, because of an issue in the UI (opened a thread with google adwords product team). However, when I reached this step, I got AuthenticationError.OAUTH_TOKEN_INVALID. I'm using python 3.7, googleads 23.0.1 and code samples from here.

The code I'm running:

client = adwords.AdWordsClient.LoadFromStorage(f'{os.getcwd()}/oauth/googleads.test.yaml') # Initialize appropriate service. campaign_service = client.GetService('CampaignService', version='v201809') # Construct selector and get all campaigns. offset = 0 selector = {     'fields': ['Id', 'Name', 'Status'],     'paging': {         'startIndex': str(offset),         'numberResults': str(PAGE_SIZE)     } } more_pages = True while more_pages:     page = campaign_service.get(selector) # this is the line which raises the exception 

Any suggestions?

Highly appreciate your help, Tal

Tag:google-ads-api

Add a new comment.