I am having trouble getting my access token when trying to authenticate using OAuth 2.0.
After retrieving a code using a callback URI, I am attempting to make a cURL requst as follows:
curl \
-H ‘Content-Type:application/x-www-form-urlencoded’ \
-X POST \
-d ‘{ "grant_type":"authorization_code”,\
”client_id":<client_id>,\
"client_secret":<client_id>,\
”redirect_uri":<my_url>,\
“code":<code>}’\
https://api.hubapi.com/oauth/v1/token
However, I get the following error:
{ "status":"BAD_GRANT_TYPE", "message":"missing or unknown grant type", "correlationId":"5e63d42e-46c5-4b03-8168-8b3cd82794e1", "requestId":"b732e441fb093ad8b6d76b9d30a21677"}
I have tried adding “charset=utf-8” and changing the header type to “application/json” but neither of those solve the issue.
Thank you!