How do I catch AdwordsApi::Errors::ReportXmlError error?

19 views
Skip to first unread message

Ankit Agarwal

unread,
Mar 31, 2020, 6:18:46 AM3/31/20
to AdWords API and Google Ads API Forum
I have been receiving an exception:
#<AdwordsApi::Errors::ReportXmlError: HTTP code: 400, error type: 'AuthenticationError.OAUTH_TOKEN_INVALID', trigger: '<null>', field path: ''>

But I am not able to handle this error. Can you please help me out here.

Google Ads API Forum Advisor Prod

unread,
Mar 31, 2020, 3:13:48 PM3/31/20
to ankit....@lsasoftware.com, adwor...@googlegroups.com

Hi Ankit,

Thank you for reaching out. AuthenticationError.OAUTH_TOKEN_INVALID error occurs when OAuth access token in the header is not valid. Could you please make sure that you generate the OAuth2 credentials using the email that has admin or standard access to the manager account? If it is confirmed, please follow this guide to re-generate the OAuth2 credentials and try it again. Please let me know if the issue persists.

Thanks and regards,
Xiaoming, Google Ads API Team

 


 

ref:_00D1U1174p._5001UZVLTB:ref

ankit agarwal

unread,
Mar 31, 2020, 3:25:04 PM3/31/20
to AdWords API and Google Ads API Forum
I know the reason behind this error. My question is, How can I catch this exception??

Google Ads API Forum Advisor Prod

unread,
Apr 1, 2020, 12:36:03 PM4/1/20
to ankit...@gmail.com, adwor...@googlegroups.com

Hi Ankit,

Thank you for reaching out. Please take a look at the source code in the try catch block in this code example on how to catch the OAuthException.



Thanks and regards,
Xiaoming, Google Ads API Team


 

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