Get access token



When i get access token, I see this error

BadRequest - {“status”:“MISMATCH_REDIRECT_URI_AUTH_CODE”,“message”:“redirect URI does not match initial auth code URI”,“correlationId”:“38f1c394-81ae-4bc2-acde-56783785194e”,“requestId”:“07dd0b8b6207650f64418f5ceb4a60b5”}

ss - redirectUri at the time of receipt of the authorization code
redirectUri - redirectUri at the time of receipt of the access_token

If you see, they are equal.



Hi @Hub_Spot,

Can you send me the full request you’re sending, including headers?


Anybody can help me?


Hi @Hub_Spot

From my knowledge if you are using the OAuth and you specify the redirect url in your first request in the browser during the integration of your application you need to provide a page, lets say that this is page A.

In your request to Hubspot you need to point to the same website, that you have specified in the initial request (page A). If you send in the initial request the redirect_url a “localhost”, then if won’t be different on both HubSpot system and your System as it would point to local machine address. (unless it won’t return information that this is not a valid url).

Please try to use both requests (initialization) and your access token request with and see if that works.


Hi @H3xas,
Your advice has helped me. I’m really surprised that they don’t use localhost…
Thank you very much!


You’re welcome.
The page I advised is just a simple one. The main point is to use twice the same web address.

Cheers mate!