Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Cannot get an access token - unknown grant type
SOLVE
Member
Sep 21, 2017 5:11 AM
Hi,
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.
payload = {
'grant_type': 'authorization_code',
'client_id': 'f6***',
'client_secret': 'f2***',
'redirect_uri': 'https://sc***/',
'code': '5f***'
}
requests.post('https://api.hubapi.com/oauth/v1/token?', params=payload)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
1 Accepted solution
Accepted Solutions
Solution
HubSpot Employee
Sep 21, 2017 9:14 AM
@esthom Are you setting your content-type in the headers? Should be
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Sometimes not having the correct content-type can throw off a server trying to read your request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content