Recent searches


No recent searches

receive "invalid_grant" error when attempting to get access token

Answered


Posted May 18, 2022

Instructions followed as described here: https://developer.zendesk.com/documentation/live-chat/getting-started/auth/ (which was very difficult to find, by the way!)

Making a POST request to this:

https://www.zopim.com/oauth2/token?grant_type=authorization_code&code=<redacted>&client_id=<redacted>&client_secret=<redacted>&redirect_uri=<redacted>&scope=read

Code is the code as provided to the redirect_uri in the previous step. An API client is active on the account. Response is as follows:

{
    "error": "invalid_grant"
}

What am I doing wrong?


0

4

4 comments

image avatar

Eric Nelson

Zendesk Developer Advocacy

Hey Nick,
 
It looks like you're putting the parameters as query strings when you should be including these in the body of the request. If you adjust the request so that the params are in the body as x-www-form-urlencoded key/value pairs it should function as expected.
 
Hope this helps,

0


Your solution didn't work. Same error.

0


image avatar

Eric Nelson

Zendesk Developer Advocacy

Hey Nick,

Can you provide your request so we can take a look?

0


Hi Eric,

I did eventually fix it. The issue was the redirect_uri was http not https. Error description from the API threw me off!

Thanks,

Nick

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post