07-06-2014 19:11
07-06-2014 19:11
I'am developing in Woklight an HTTP adapter (using javaScript) to retrieve data from fitbit.
Any idea how to pass the OAuth signature in a GET request parameters via "Authorization" HTTP header??
I receive following error:
"message": "No Authorization header provided in the request. Each call to Fitbit API should be OAuth signed"
Here is my adapter JavaScript GET request procedure:
var pathActivities = '1/user/-/activities/date/2014-07-01';
function getFitbitActivities(pathActivities) {
path = getPathElement(pathActivities);
var input = {
method : 'get',
returnedContentType : 'json',
path : path,
oauth_consumer_key :'b54a8e0fe4314969b52505768c5f1d08',
oauth_signature_method :'HMAC-SHA1',
oauth_timestamp : '1404691128',
oauth_nonce :'389925176',
oauth_version : '1.0',
oauth_token : 'c22c1aa3979578cd22502527a5e28321',
oauth_signature : '5IrAUFEBZIA3LwhjKT4gETGvF5k%3D'
};
return WL.Server.invokeHttp(input);
}
Answered! Go to the Best Answer.
Best Answer09-23-2014 08:32
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.
09-23-2014 08:32
You can specify any callback url you want.
As long as you have [Application Type] set to desktop, callback url won't be used, although it is required all the times indeed.
07-07-2014 10:33
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.
07-07-2014 10:33
Fitbit currently supports passing parameters via Authorization header only.
Please see 5.4.1 here: http://oauth.net/core/1.0a/#auth_header .
Instead of setting several oauth header parameters you only need to set one "Authorization" and put all oauth parameters comma-separated.
Best Answer07-07-2014 12:14
07-07-2014 12:14
Thanks for the documentation but still not clear:
- Do I need to specifically import the OAuth Core 1.0 Lib? or is part of any standard or Java libs?
- Do you have a coding example, preferable in JavaScript, how to build the Authorization header?
- Also is there any java/javaScript API how to get the Tokens, i.e. oauth_consumer_key, oauth_signature_method, oauth_nonce, oauth_version, oauth_token, oauth_signature ???
In the page that you indicated (http://oauth.net/core/1.0a/#anchor45) I see only URLs examples.
Best Answer07-08-2014 08:34
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.
07-08-2014 08:34
Hello.
There is java oauth 1.0 library that you need to specifically import.
The source code for this library is here: http://oauth.googlecode.com/svn/code/java/. If you want to use this library you'll need find, download and to import oauth.jar and oauth-provider.jar.
Related to javascript library you canuse any of libraries from here: http://oauth.net/code/
check out javascript section for js libraries. Ddo library in this secrion work great.
Also check out https://dev.fitbit.com/apps/oauthtutorialpage that will provide
Related to you question " is there any java/javaScript API how to get the Tokens, i.e. oauth_consumer_key, oauth_signature_method, oauth_nonce, oauth_version, oauth_token, oauth_signature ???" please refer to this documentation: https://wiki.fitbit.com/display/API/OAuth+Authentication+in+the+Fitbit+API
Best Answer07-08-2014 12:38
07-08-2014 12:38
Thanks for info. When a try to register my mobile application with fitbit, in order to obtain the <consumer key> and < consumer secret>, the form requires mandatory to enter my application web site, which I can not provide, since a mobile app does not have a hosting URL. Please advise what should I do?
07-08-2014 12:48
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.
07-08-2014 12:48
You can specify the url for your application in apple store or play store.
Best Answer07-08-2014 13:09
07-08-2014 13:09
I do not have yet an URL in apple store or play store, since right now is an internal demo application.
Do you have any suggestions? Thanks!
Best Answer07-08-2014 13:10
07-08-2014 13:10
Feel free to put a placeholder URL in the mean time
Best Answer09-23-2014 04:02 - edited 09-23-2014 04:04
09-23-2014 04:02 - edited 09-23-2014 04:04
Thanks for that valuable question, i faced the same issue sofar, by seeing your post i could able to clarify myself, and also it asking "callback" url, im not aware of callback url while registering my app, im trying to regiser a app for ios, so could you please help me !
Thanks
Best Answer09-23-2014 08:32
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.
09-23-2014 08:32
You can specify any callback url you want.
As long as you have [Application Type] set to desktop, callback url won't be used, although it is required all the times indeed.
09-23-2014 23:43