0.4.0 • Published 7 years ago

withings-toolbox v0.4.0

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

Withings Toolbox

CircleCI Codacy Badge Codacy Badge

NPM

This is a toolbox to request Withings API. I made this to fully comply with the Withings API documentation.

Use it

The toolbox is used to generate the URLs described in the Withings Documentation

Step 1

The first step is used to get a oAuth "request token". Use it like this :

import { generateWithingsRequestURL } from 'withings-toolbox';

generateWithingsRequestURL(callbackURL, {
  oauthConsumerKey: 'Your withings API key',
  oauthConsumerSecret: 'Your withings API secret'
})
.then(url => console.log(url));

Where callbackURL is your application callback URL.

Step 2

The second step is used to get a oAuth authorization URL. Use it like this :

import { generateWithingsAuthorizeURL } from 'withings-toolbox';

generateWithingsAuthorizeURL(token, secret, {
  oauthConsumerKey: 'Your withings API key',
  oauthConsumerSecret: 'Your withings API secret'
})
.then(url => console.log(url));

Where token is the Request token key and secret is Request token secret (as in the Withings Documentation)

Step 3

The third step is used to get a access token URL. Use it like this :

import { generateWithingsTokenURL } from 'withings-toolbox';

generateWithingsTokenURL(token, secret, {
  oauthConsumerKey: 'Your withings API key',
  oauthConsumerSecret: 'Your withings API secret'
})
.then(url => console.log(url));

Where token is the Request token key and secret is Request token secret (as in the Withings Documentation)

Step 4

The fourth step is used to get a measure URL. Use it like this :

  • Activity

    import { generateWithingsMeasureActivityURL } from 'withings-toolbox';

    generateWithingsMeasureBodyURL(token, secret, { oauthConsumerKey: 'Your withings API key', oauthConsumerSecret: 'Your withings API secret' }) .then(url => console.log(url));

Where token is the previously obtained token and secret is the previously obtained secret, from step 2 and 3 (as in the Withings Documentation)

  • Body Measures

    import { generateWithingsMeasureBodyURL } from 'withings-toolbox';

    generateWithingsMeasureBodyURL(token, secret, { oauthConsumerKey: 'Your withings API key', oauthConsumerSecret: 'Your withings API secret' }) .then(url => console.log(url));

Where token is the previously obtained token and secret is the previously obtained secret, from step 2 and 3 (as in the Withings Documentation)

  • Sleep summary

    import { generateWithingsSleepSummaryURL } from 'withings-toolbox';

    generateWithingsSleepSummaryURL(token, secret, { oauthConsumerKey: 'Your withings API key', oauthConsumerSecret: 'Your withings API secret' }) .then(url => console.log(url));

Where token is the previously obtained token and secret is the previously obtained secret, from step 2 and 3 (as in the Withings Documentation)

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago