08-05-2019 09:50
08-05-2019 09:50
curl: (6) Could not resolve host: Basic
curl: (6) Could not resolve host: 'vgjhgfvjhjhgjyhgjgjhgjhgjhgjhgjhjhgjgh'
curl: (6) Could not resolve host: application
HTTP/1.1 401 Unauthorized
Date: Mon, 04 Aug 2019 16:46:04 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache, private
CF-Ray: 504a389990ccvssd7104b-ORD
Content-Language: en-CA
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Vary: Origin,Accept-Encoding
WWW-Authenticate: Bearer realm="api.fitbit.com"
X-Frame-Options: SAMEORIGIN
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}
Why am I getting this as my CURL response? Kindly help, thanks.
Best Answer08-05-2019 10:23
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.
08-05-2019 10:23
Hi @ShreeTya
Below is an example of a curl statement taken from the OAuth 2.0 Tutorial referenced in the original post. Based on the error message, it looks like you have a syntax error with the authorization call. If this example doesn't help correct your syntax issue, please reply with the curl statement you're trying to execute.
curl -X POST -i https://api.fitbit.com/oauth2/token
-H 'Authorization: Basic <token>'
-H 'Content-Type: application/x-www-form-urlencoded'
-d "clientId=22DPJN"
-d "grant_type=authorization_code"
-d "redirect_uri=https%3A%2F%2Foauth.net%2Fcallback"
-d "code=<authorization code>"
Best Answer08-05-2019 10:46
08-05-2019 10:46
Thanks for your response. The problem isn't solved as yet with the new syntax that you just provided. commandln response was :The system cannot find the file specified.
The initial curl from my OAuth2.0 request for Authorization Code Flow :
curl -X POST -i -H 'Authorization: Basic XYZ' -H 'Content-Type: application/x-www-form-urlencoded' -d "clientId=22Mk23M" -d "grant_type=authorization_code" -d "redirect_uri=https%3A%2F%2Fwww.google.com%2F" -d "code=123" https://api.fitbit.com/oauth2/token
Best Answer08-05-2019 11:31
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.
08-05-2019 11:31
Hi @ShreeTya
I have created a support case for this problem and will reply to you via the case.
Gordon
Best Answer