How to get Access Token in OAuth 2.0


#1

Hi Community,

I’ve read documents related to how to get Access Token in OAuth 2.0 on developers.hubspot.com, but somehow I’m not getting where to pass below mentioned data in my website. Is that will be in URL query parameter or anything else?

Data:grant_type=authorization_code&client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&client_secret=yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy&redirect_uri=https://www.example.com/&code=zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz

it will be helpful if someone provide me solution for this.
Thanks in Advance.
Hardik Chauhan


#2

Hi @hardikchauhan,

Once you’ve followed the steps to initialize your Oauth connection and have your code

You’re going to put that information into the body of your request to the /oauth/v1/token endpoint to get your access and refresh tokens


#3

Hi @Derek_Gervais,
Thanks for your quick response, do I need to put that information in request url or in json body or anywhere else?


#4

Hi @hardikchauhan,

The information necessary to get the access & refresh tokens should all be in the POST body.


#5

Hi @Derek_Gervais,

Thanks, I’ve got an access token.