withings-api
v0.1.2
Published
A javascript module to help generate OAuth signed [Withings API](http://oauth.withings.com/api) URL. The code is adapted from the [API reference](http://oauth.withings.com/api) page.
Downloads
4
Readme
Withings API
A javascript module to help generate OAuth signed Withings API URL
Install
npm install withings-api
Usage
var withingsApi = require("withings-api");
withingsApi.generateUrl({
url: "http://wbsapi.withings.net/measure",
parameters: {
action: "getmeas",
userid: "THE USER's ID"
},
consumer_key: "YOU APP'S KEY",
consumer_secret: "YOU APP'S SECRET",
access_token: "YOUR USER-SPECIFIC ACCESS TOKEN",
access_token_secret: "YOUR USER-SPECIFIC ACCESS TOKEN SECRET",
callback: "URL TO YOUR APP"
});
Gotchas
- Don't pass in
callback
when requesting for activity measure (http://wbsapi.withings.net/v2/measure?action=getactivity)- Otherwise you'll get response of
{"status":503,"error":"Invalid Params"}
- Otherwise you'll get response of
Test
npm test