I am trying to get access token for a user, but I keep receiving "status":"BAD_GRANT_TYPE","message":"missing or unknown grant type". I have tried encoding query params or passing them as one json param, but nothing worked.
Sep 21, 20192:26 AM - edited Sep 21, 20192:31 AM
Member
Cannot get an access token - unknown grant type
SOLVE
Hi, I am encountering similar issues with the curl response. In POSTMAN I am able to get a successful response, but when I replicate the settings in PHP with cURL, I am getting a "BAD_GRANT_TYPE" response.
Content Type should be set properly in the request. But I notice in the curl response, it shows content_type = application/json, is that correct?
But not working for me even after chnaging the order as follows:
grant_type=authorization_code
&client_id=xxx
&client_secret=xxx
&redirect_uri=https://api.hubapi.com/contacts/v1/lists/all/contacts/all
&code=code_here
And adding " Content-Type: application/x-www-form-urlencoded;charset=utf-8"