09-24-2019 03:02
09-24-2019 03:02
When i try to use this method to get token and refresh token to use in other methods, i get this message error:
Answered! Go to the Best Answer.
09-27-2019 06:32
09-27-2019 06:32
@JohnFitbit now, i already fixed the problem.
My problem is grant_type, i sent this in the query parameters but this camp needs to be sent in body.
Thanks for Help.
09-25-2019 16:19
09-25-2019 16:19
Hi @SamuelMira,
Welcome to the forums!
So that I may investigate, can you please provide me with your full POST request? I need to be able to see the URL endpoint, headers, and body. This should help me see how you are formatting your request and identify what may be throwing the error. Feel free to block out any sensitive information.
Hope to hear from you soon! Thanks!
09-26-2019 03:22
09-26-2019 03:22
First of all , thanks for the answer.
In the headers i give Authorization = Basic {Code base64} and Content-Type=application/x-www-form-urlencoded.
I sent de code directly in redirectURL because i see this in one example of this community.
09-26-2019 11:51 - edited 09-26-2019 11:52
09-26-2019 11:51 - edited 09-26-2019 11:52
@SamuelMira Are you coming across this error when trying to authorize your application or when trying to refresh your token?
Also, have you tried using the OAuth 2.0 Tutorial found in your application settings at dev.fitbit.com (https://dev.fitbit.com/apps/details/<Client_ID>)? It will take you through a demo of how to authorize your application, make a request, and refresh your tokens through curl.
If you still need assistance after going through the tutorial, please let me know and I'll be happy to assist you further.
09-27-2019 00:59
09-27-2019 00:59
@JohnFitbit I already followed tutorial but when i run curl on cmd i get the following error:
HTTP/1.1 401 Unauthorized
Date: Fri, 27 Sep 2019 07:55:45 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache, private
CF-Ray: 51cbeacacbebda6e-LIS
Alt-Svc: clear
Content-Language: en-EU
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Set-Cookie: JSESSIONID=852B6528835966803CF8A6C17674A7B3.fitbit1; Path=/; Secure; HttpOnly
Set-Cookie: fct=74929ea790cb4a8fb06f589921f7073a; Path=/; Secure; HttpOnly
Vary: Origin,Accept-Encoding
Via: 1.1 google
WWW-Authenticate: Bearer realm="api.fitbit.com"
X-Frame-Options: SAMEORIGIN
Server: cloudflare
{"errors":[{"errorType":"invalid_client","message":"Invalid authorization header format. The header was not recognized to be a valid header for any of known implementations or a client_id was not specified in case of a public client Received header = null. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],"success":false}
Have any idea what might be causing this?
09-27-2019 06:32
09-27-2019 06:32
@JohnFitbit now, i already fixed the problem.
My problem is grant_type, i sent this in the query parameters but this camp needs to be sent in body.
Thanks for Help.