Oath2 client was not found

958 views
Skip to first unread message

orensa...@gmail.com

unread,
Dec 28, 2017, 12:40:56 PM12/28/17
to AdWords API Forum
WARNING:googleads.common:Your default encoding, cp1252, is not UTF-8. Please run
 this script with UTF-8 encoding to avoid errors.
DEBUG:suds.transport.http:opening (https://adwords.google.com/api/adwords/cm/v20
1710/CampaignService?wsdl)
INFO:oauth2client.client:Refreshing access_token
INFO:oauth2client.client:Failed to retrieve access token: {
  "error" : "invalid_client",
  "error_description" : "The OAuth client was not found."
}
Traceback (most recent call last):
  File "get_campaigns.py", line 74, in <module>
    main(adwords_client)
  File "get_campaigns.py", line 56, in main
    page = campaign_service.get(selector)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\
googleads\common.py", line 762, in MakeSoapRequest
    self._header_handler.SetHeaders(self.suds_client)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\
googleads\adwords.py", line 561, in SetHeaders
    http_headers = self._adwords_client.oauth2_client.CreateHttpHeader()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\
googleads\oauth2.py", line 211, in CreateHttpHeader
    self.Refresh()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\
googleads\oauth2.py", line 226, in Refresh
    self.proxy_config.disable_certificate_validation)))
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\
oauth2client\client.py", line 545, in refresh
    self._refresh(http)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\
oauth2client\client.py", line 749, in _refresh
    self._do_refresh_request(http)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\site-packages\
oauth2client\client.py", line 819, in _do_refresh_request
    raise HttpAccessTokenRefreshError(error_msg, status=resp.status)
oauth2client.client.HttpAccessTokenRefreshError: invalid_client: The OAuth clien
t was not found.

Milind Sankeshware (AdWords API Team)

unread,
Dec 28, 2017, 4:34:12 PM12/28/17
to AdWords API Forum
Hi Oren,

Have you generated a refresh token? If not please follow the instruction in this guide to generate refresh token.

Could you also check if the OAuth2 client Id is associated with the clientCustomerId or one of its manager accounts? Please provide the SOAP request and response logs generated along with the email address used to generate your OAuth2 credentials so I can take a look. Please use Reply privately to author when responding.

Thanks,
Milind, AdWords API Team.

lijy...@gmail.com

unread,
Jan 2, 2018, 6:15:58 PM1/2/18
to AdWords API Forum
I use PHP version sdk has meet this problem too
It's because a PHP system function ini_restore() has been disable
Hope can help you

在 2017年12月29日星期五 UTC+8上午1:40:56,orensa...@gmail.com写道:
Reply all
Reply to author
Forward
0 new messages