Giter VIP home page Giter VIP logo

withings-api's Introduction

withings-api is an easy to use Ruby library providing access to the Withings Body Metrics Services API (WBS API) version 2.

For complete details about the WBS API, see www.withings.com/en/api/wbsapiv2

*NOTE, THIS IS A WORK IN PROGRESS, IMPLEMENTATION ISN’T COMPLETE AS OF VERSION 0.0.1*

Overview

For an example use of the withings-api, see {file:examples/create_access_token.rb examples/create_access_token.rb}.

Broadly speaking, there are two phases to using the withings-api.

  1. Retrieve access to user’s data via OAuth authentication + authorization

    • see {file:README.rdoc#OAuth_Authorization OAuth Authorization} section below.

  2. Retrieve user data via authorized OAuth credentials (called “access token” in this documentation).

    • NOTE: This isn’t implemented as of version 0.0.1.

OAuth Authorization

Before you can access user data via the WBS API, you need to go through a process that allows the user to authorize your application’s access to their data. This process is handled by a protocol called OAuth 1.0.

For details on Withings implementation of OAuth, see {www.withings.com/en/api/oauthguide Withings OAuth Guide}. For the complete specification of OAuth 1.0, see {tools.ietf.org/html/rfc5849}.

Broadly, these are the steps to getting access to user data via the API.

  1. (One Time) Register you application with Withings - oauth.withings.com/en/partner/add

    • This will give you a “consumer token” and “consumer secret” which is used to identify and authenticate your application

    • Some more information about this step, see {www.withings.com/en/api/oauthguide#registration Withings OAuth Guide: Registration}

  2. Request a temporary “request token” used to identify your request for OAuth authorization.

    • Facilitated by {Withings::Api::OAuthActions#create_request_token}.

  3. Using the “request token”, redirect the user to Withings to allow them to log in and authorize your access to their data.

    • Use {Withings::Api::RequestTokenResponse#authorization_url} to get the URL to use.

    • Note: this redirect happens outside of withings-api, usually in your webapp.

    • When the user authorizes the request, Withings will redirect the user back to your application:

      • You specify this callback URL in the call to {Withings::Api::OAuthActions#create_request_token}

  4. Request permanent access to the users data with an “access token”.

    • Facilitated by {Withings::Api::OAuthActions#create_access_token}

  5. Now you have permanent credentials to use when making calls that access user data.

Once authorized, you can use data access methods for retreiving user Withings data.

Accessing User Data

**Implementation and Documentation Pending**

Status

withings-api is currently a work in progress. Only support for getting OAuth request and access tokens is supported at this time.

Versions

0.0.1

Initial public offereing. OAuth request token and access token support only. No data access yet.

0.0.3

Basic support for measure_getmeas API call

License

MIT License, see {file:LICENSE}

Thanks

Thanks to the following software and tools that inspired and made withings-api possible:

Alternatives

Don’t like withings-api? Patches, changes, and ideas always welcome.

You can also try {github.com/simplificator/simplificator-withings simplificator-withings}.

withings-api's People

Contributors

webmonarch avatar gerwitz avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.