Configuring Oauth flow

Hi, i’m trying to get the oauth flow working but getting error while trying to obtain initial access and refresh token, below is my curl request. can someone please help out and let me know what i’m doing wrong

curl --location ‘https://api.hubapi.com/oauth/v1/token’ \
--header ‘Content-Type: application/x-www-form-urlencoded’ \
--data-urlencode ‘grant_type=authorization_code’ \
--data-urlencode ‘code=mycode’ \
--data-urlencode ‘redirect_uri=localhost:3000’ \
--data-urlencode ‘client_id=myclientid’ \
--data-urlencode ‘client_secret=myclientsecret’

Hi @HImran8 :waving_hand:

Try updating your redirect_uri to include HTTP/S protocol. For example:

…

--data-urlencode ‘redirect_uri=http://localhost:3000’ \

…

Based on my testing, that should do the trick.

I hope this proves useful. Please let me know if you have any follow-up questions.