"error": "invalid_grant", "error_description": "Bad Request"

34 views
Skip to first unread message

Saeed Rehman

unread,
Jun 29, 2022, 2:41:26 AM6/29/22
to Google Ads API and AdWords API Forum

hi , i am trying to get access token but in response i am geting this error. can you please guide me where is the issue. is i am sending request is correct way?

my request is :
$request->body = array(
'code' => $code,
'client_id' => $this->getClientId(),
'client_secret' => $this->getClientSecret(),
'redirect_uri' => $this->getRedirectUrl(),
'grant_type' => 'authorization_code',
);

response is:
'body' => '{ "error": "invalid_grant", "error_description": "Bad Request" }' 

Google Ads API Forum Advisor

unread,
Jun 29, 2022, 4:17:10 AM6/29/22
to saeedre...@gmail.com, adwor...@googlegroups.com
Hi Saeed,

Thank you for raising this concern to the Google Ads API Forum. 

With regard to your concern, there might be some problem in setting OAuth credentials in your client library. Could you verify again, that you followed all steps given in the OAuth web application flow and Oauth desktop application flow? However, if the issue still persists could you please provide the complete API request and response logs with request-id and login-customer-id that generated on your end? This information will help our team to better check this. If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.

You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com

Best regards,
Google Logo
Jinky
Google Ads API Team
 


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