Withings API is not working with node-oauth

withings running
withings email
withings connect
withings sleep
withings with garmin
samsung health withings
withings company
go withings

I'm attempting to authenticate requests to the Withings API using node-oauth, a widely used OAuth module for Node. All of the initials steps of the OAuth process are working, and I'm able to acquire the user ID, access token, and access token secret. However, when attempting to actually use these tokens to make an authenticated request, I get one of the following errors:

  • 2554 Wrong action or wrong webservice
  • 2555 An unknown error occurred
  • 2556 Service is not defined

I've verified that the credentials I'm using are valid by testing them here. Am I doing something wrong, or is the Withings API implemented in some non-standard way, which makes it incompatible with node-oauth?

var consumerKey = "";
var consumerSecret = "";
var oauth_access_token = "";
var oauth_access_token_secret = "";
var userid = "";

var oauth = require("oauth");

var withings = new oauth.OAuth(
    "https://oauth.withings.com/account/request_token",
    "https://oauth.withings.com/account/access_token",
    consumerKey,
    consumerSecret,
    "1.0",
    null,
    "HMAC-SHA1"
);

var url = "http://wbsapi.withings.net/measure?action=getmeas&userid=" + userid;
withings.get(url, oauth_access_token, oauth_access_token_secret, function(error, response) {
    console.log(response);
});

Output:

{"status":2554}

I figured this one out. The node-oauth library assumes that most APIs expect OAuth parameters to be defined in headers. However, OAuth parameters may also be defined in the query string, which is how Withings decided to implement it. The node-oauth library defines a signUrl function for this purpose, but you must use it explicitly. Once you wrap the URL in that function, the problem is solved. Note that there is no need to pass the access tokens into the get function because the request is already signed.

var url = withings.signUrl("http://wbsapi.withings.net/measure?action=getmeas&userid=" + userid, oauth_access_token, oauth_access_token_secret);
withings.get(url, null, null, function(error, response) {
    console.log(response);
});

javascript - Withings API is not working with node-oauth, I figured this one out. The node-oauth library assumes that most APIs expect OAuth parameters to be defined in headers. However, OAuth  “The Withings OAuth implementation is not perfect” says the gentle author in the README for the withings-request node module. That author has helpfully rendered transparent a lot of the failings (encrypting the wrong url parameters, returning unparseable nonsense) to consumers of the data, and for that I am grateful.

The withings API is maybe a little special and very capricious. For example, if you don't send the options in the query string in the right order you got sometimes an error. I haven't tried with node-oauth because I work with it in angular and my friend in Rails but it's difficult to make it work.

I don't see your callback url send in the options of node-oauth have you changed it in the options of your Withings app ?

You can try to modify node-oauth to log the response of each call to Withings and look if it's the first, the second or the third who's failing.

Good luck ;)

Withings API is not working with node-oauth, I'm attempting to authenticate requests to the Withings API using node-oauth, a widely used OAuth module for Node. All of the initials steps of  The Health Mate API allows developers to create applications that take advantage of the Withings devices and the data they record. Using this API, developers have the ability to access data stored in the Health Mate app for users having gave them prior consent, including weight, body fat, activity, sleep, blood pressure and heart rate, and to

check your url may be you have missed out any required params suc as acces_token.

sample URL: https://wbsapi.withings.net/measure?action=getmeas&category=1&access_token=XXXXXxxxxxxxxXXXXX&meastype=1&startdate=1543581749&enddate=1543581750

Withings API, Field of your app used to specify when running on a development or a production environment. Therefore, the OAuth 1.0 process is no longer supported. I have purchased your multiple devices and i am working on your API to get data which was pull or read by that device. So using that API i am trying to get devices owned by the user(me) using v2 Getdevice method and have problem with BPM Connect where i am getting NULL value as Model Name but i am able to get device ID and i am also able to get

amida-tech/withings-lib: Withings API library for node.js, NPM. Build Status Coverage Status Dependency Status. Withings API library for Issues. #14 The signature (using Oauth) is invalid Opened by Hareramrai  Can I retrieve the user’s history or just future data? You can retrieve the user’s previous history. In fact we recommend you import at least some previous measurements if they exist right after users link their account, as a way to show the user that the connection is working.

How to obtain Google service account access token javascript, Withings API is not working with node-oauth. I'm attempting to authenticate requests to the Withings API using node-oauth, a widely used OAuth module for  Withings (formerly Nokia Health) health ecosystem of connected devices & apps is designed to improve daily wellbeing and long-term health. Discover our award-winning smart scales, hybrid smartwatches & health monitors.

withings-api · PyPI, Withings API is not working with node-oauth. I'm attempting to authenticate requests to the Withings API using node-oauth, a widely used OAuth module for  Client API Activity Measures Withings.getDailySteps(date, callback) The date is a Date object, and the callback is of the form function(err, data). The data is the integer number of steps the user has taken today. Withings.getDailyCalories(date, callback) The date is a Date object, and the callback is of the form function(err, data).

Comments
  • If anyone encounters a signing issue with this, I used "request" to actually make the call. With the "OAuth" lib, the URL was, I suppose, encoded twice which caused an issue (I had the issue described here: stackoverflow.com/questions/26517181/…)