I registered a 'Personal' app to try to download my personal minute-by-minute data. When I use the Fitbit API Debug Tool (OAuth2.0 tutorial page), I got an error at step 2, which says "Token response does not match the expected format; please check that you're using the correct OAuth 2.0 flow." Below is a screen shot to show this error.
I've chosen the 'Authorization code flow' at step 1. Can anyone give me a hint what might have gone wrong? Thanks!
Answered! Go to the Best Answer.
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Shushi2000, I see that what you do is actually just copying and pasting the curl from step 1A into step 2. This is not how it suppose to work. You need actually to execute your curl in command line, that you given at step 1A when you entered the code.
So, just copy that curl and run it in command line. You should get json response as a result. This son response you need to copy and paste at input section in step 2.
Also seems to be some 404 errors on the page.
Not sure if this has anything to do why this isnt working?
https://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha1.js
https://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js
Best AnswerHi,
The reason you are seeing this error - "Token response does not match the expected format; please check that you're using the correct OAuth 2.0 flow." is because you are pasting the Curl itself in the textbox instead of pasting the response of the Curl. It should work once you paste the response from the Curl that is generated.
Best AnswerI am passing it through Hurl.it and getting a 401 error.
{
"errors": [
{
"errorType": "invalid_request",
"message": "Authorization header required. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."
}
],
"success": false
}I have tried putting the the Basic value in the header and the authentication bit of Hurl.it
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Can you please PM to me what exactly you passing to hurl.it?
Best AnswerI am having the same problem. I've tried php wrappers and python wrappers, and I have no luck with this process.
When I hurl the curl string in the tutorial right from the fitbit developer page, I still get error messages. Any thoughts?
Best Answerdeleted, meant to send this message as PM.
bump
Best AnswerDeepaFitbit: Can you please give an example of how to paste the response from the Curl properly ?
Best AnswerHi kylarione,
Can you can you send me your curl please? I can then show you what I mean by the response from it.
Thanks,
Deepa
Best Answer
09-25-2017
10:33
- last edited on
09-25-2017
10:45
by
IoanbsuFitbit
09-25-2017
10:33
- last edited on
09-25-2017
10:45
by
IoanbsuFitbit
Here it is:
curl -X POST -i -H 'Authorization: Basic [EDITED:removed security sensitive data]' -H 'Content-Type: application/x-www-form-urlencoded' -d "clientId=228LRD" -d "grant_type=authorization_code" -d "redirect_uri=http%3A%2F%2Flocalhost%2Ffitbit%2F" -d "code=2c74274d307395eb1396cd9b2953532ee3988467" https://api.fitbit.com/oauth2/token
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Shushi2000, I see that what you do is actually just copying and pasting the curl from step 1A into step 2. This is not how it suppose to work. You need actually to execute your curl in command line, that you given at step 1A when you entered the code.
So, just copy that curl and run it in command line. You should get json response as a result. This son response you need to copy and paste at input section in step 2.
Could you be more specific? I have no idea what "copy the curl and run it in command line" means. Copy the whole text box? where in the command line? the python virtual environment? what is an example code I am supposed to paste in the box?
Best AnswerSometimes, you need to replace ' ' with " " at the authorization part of the CURL. Try putting all parts of the CURL request in one line, separated by space, also delete all slashes that separate rows ( / ).
Best Answer