Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Missing 'grant_type' parameter?

I am getting an error about missing the 'grant_type' parameter. However, my code does include it in the form body. Can anyone see an issue with my code??

 

Error Message:

[{"errorType":"invalid_request","message":"Missing 'grant_type' parameter value. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],"success":false}

 

Code:

form_body = dict(
clientId = FITBIT_CLIENT_ID,
grant_type = "authorization_code",
redirect_uri = FITBIT_REDIRECT_URI,
code = authorization_code,
)

headers = dict(
Authorization = "Basic %s" % FITBIT_SECRET,
ContentType = "application/x-www-form-urlencoded",
)

res = http.post(
url = FITBIT_TOKEN_URL,
headers = headers,
form_body = form_body,
)

Best Answer
0 Votes
0 REPLIES 0