OAuth 2 error - cannot get token


#1

Using Postman and doing a test to get the OAuth token

doing a POST to this URL: https://api.hubapi.com/oauth/v1/token

sending payload in the form url encoded:
grant_type:authorization_code
client_id:xxxxxxx-ea8846528xxxx
client_secret:xxxxx-55ce782xxx
redirect_uri:https://www.example.com/
code:xxx

and getting the result
{
“status”: “BAD_AUTH_CODE”,
“message”: “missing or unknown auth code”,
“correlationId”: “6a304540-138b-4a35-b715-06e38e3624b9”,
“requestId”: “20033ba67ed03e88dc940b51000123ad”
}


#2

got it working had to use the authorization first and get the code