google-ads-doctor cannot fetch token using PHP

25 views
Skip to first unread message

Amit Lahiri

unread,
Apr 16, 2020, 12:21:05 PM4/16/20
to AdWords API and Google Ads API Forum
Hello. 

I am trying OAuth2 credentials and gnerate the access token using the library google-ads-doctor of PHP. But it is not getting generated and return the error below.

I have follow below steps as given in this page https://github.com/googleads/google-ads-doctor.
1. Update the file google_ads_php.ini with developer token, client customer id, client id, client secret and refresh token. Put the file in the root of 'google-ads-doctor' folder. 
2. Run the below commands one by one.
           c:\google-ads-doctor\oauthdoctor\bin\windows\386>oauthdoctor -language php -oauthtype web -configpath c:\google-ads-doctor\google_ads_php.ini
           It is asking for  Please enter a Google Ads account ID:
3. I have entered the client id from the google cloud console's OAuth Client credentials.
4. It generates the auth code and browser message was 'Auth code received'.
5. In the command line the below error was given.

oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "redirect_uri_mismatch",
  "error_description": "Bad Request"
}

Please tell me what I am missing. How do I resolve it? The issue arises since a long time. Please help me to resolve the issue. 


Regards & Thanks,
Amit 

Google Ads API Forum Advisor Prod

unread,
Apr 16, 2020, 4:35:22 PM4/16/20
to ala...@nuundigital.com, adwor...@googlegroups.com

Hi Amit,

Thank you for reaching out. Since this is a google-ads-doctor library related issue, please go to the Issue Tracker of the Github page for the google-ads-doctor library and post your issue there to raise your concerns to the library owner. They will be able to handle it for you. Please let me know if you have any Adwords API/ Google Ads API related issues.

Thanks and regards,
Xiaoming, Google Ads API Team

 


 

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