10-15-2022 15:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-15-2022 15:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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,
)
