06-13-2016 10:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-13-2016 10:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.
Accepted Solutions
09-25-2017 10:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



09-25-2017 10:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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.
06-21-2016 07:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-21-2016 07:52
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I am getting the same.

06-21-2016 08:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-21-2016 08:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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

06-22-2016 10:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


06-22-2016 10:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi,
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.

06-24-2016 06:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-24-2016 06:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I 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

06-24-2016 10:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



06-24-2016 10:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Can you please PM to me what exactly you passing to hurl.it?

10-09-2016 09:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-09-2016 09:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I 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?

10-16-2016 10:29 - edited 10-16-2016 10:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-16-2016 10:29 - edited 10-16-2016 10:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
deleted, meant to send this message as PM.
bump

09-20-2017 11:59 - edited 09-20-2017 12:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-20-2017 11:59 - edited 09-20-2017 12:00
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
DeepaFitbit: Can you please give an example of how to paste the response from the Curl properly ?

09-21-2017 10:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-21-2017 10:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi 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

09-25-2017
10:33
- last edited on
09-25-2017
10:45
by
IoanbsuFitbit
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-25-2017
10:33
- last edited on
09-25-2017
10:45
by
IoanbsuFitbit
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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

09-25-2017 10:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



09-25-2017 10:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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.
04-07-2022 14:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-07-2022 14:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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?

09-19-2022 23:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-19-2022 23:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Sometimes, 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 ( / ).

