Authorization Error - NO_CUSTOMER_FOUND

65 views
Skip to first unread message

Manu Puthia

unread,
Mar 2, 2020, 2:42:57 PM3/2/20
to AdWords API and Google Ads API Forum
Hi,

I am trying to run the below code to extract campaign information, however, I am getting the exception -->   zeep.exceptions.Fault: [AuthorizationError.NO_CUSTOMER_FOUND @ ]

I have created the client_id, secret and refresh token multiple times but with no luck. 



Note - I have copied the below script from googleads examples for testing.

from googleads import adwords


PAGE_SIZE = 100


def main(client):
# 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)
# Display results.
if 'entries' in page:
for campaign in page['entries']:
print('Campaign with id "%s", name "%s", and status "%s" was '
'found.' % (campaign['id'], campaign['name'],
campaign['status']))
else:
print('No campaigns were found.')
offset += PAGE_SIZE
selector['paging']['startIndex'] = str(offset)
more_pages = offset < int(page['totalNumEntries'])


if __name__ == '__main__':
adwords_client = adwords.AdWordsClient.LoadFromStorage(path='*****.yaml')
main(adwords_client)

Google Ads API Forum Advisor Prod

unread,
Mar 3, 2020, 2:43:08 PM3/3/20
to manu....@joist.com, adwor...@googlegroups.com

Hi Manu,

Thanks for reaching out. The AuthorizationError.NO_CUSTOMER_FOUND usually occurs when  client customer ID passed in the request header is invalid. Could you please check if you have added the correct client customer ID in the googleads.yaml file? If the issue persists, could you please provide the complete SOAP request and response logs along with the client customer id via Reply privately to the author option?

Thanks and regards,
Xiaoming, Google Ads API Team



 

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