[400] missing or unknown grant type

Hi, i am trying to request my authorization_code via API Call: POST /oauth/v1/token.

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Body Request:

{
“grant_type”: “authorization_code”,
"client_id“: “e0***”,
"client_secret“: “b6***”,
"redirect_uri“: "https://app***“,
"code“: “eu1***”
}

still i get [400] missing or unknown grant type Error.

what am I doing wrong?

Hi @01976

Please use the following curl

curl --request POST \
 --url https://api.hubapi.com/oauth/v1/token \
 --header 'content-type: application/x-www-form-urlencoded' \
 --data 'grant_type=authorization_code&code=<PUT CODE HERE>&redirect_uri=<PUT REDIRECT URI SAME AS mentioned in app>&client_id=<PUT CLIENT ID HERE>&client_secret=<PUT CLIENT SECRET HERE>'

Hope this will helps you out. Please mark it as Solution Accepted & Upvote to help other Community member.
Thanks!