Giter VIP home page Giter VIP logo

jawbone-up-api's Introduction

Ruby wrapper for the Jawbone UP API.

Install with

gem install jawbone

Once you've set up your app and have a token for your user:

client = Jawbone::Client.new "your_token"

Then you can do things like:

> client.user
=> {
    "meta" => {
        "user_xid" => "bacseY7NGC0",
         "message" => "OK",
            "code" => 200,
            "time" => 1379626539
    },
    "data" => {
          "xid" => "jd7m17NGC0",
        "image" => "",
         "last" => "Brett",
        "first" => "Andy"
    }
}

There are three instance methods on client directly related to the user and nothing else: user, friends, and trends.

In addition, Jawbone makes the following object types available:

"move", "body_event", "workout", "sleep", "meal", "cardiac_event", "generic_event", "mood"

This gem takes each of those types and provides methods for:

  • getting all of the objects, e.g client.workouts
  • getting a single object, e.g. client.workout("xid") where the xid is the xid returned by client.workouts.
  • getting a graph for that object, e.g. client.workout_graph("xid")
  • getting a detailed report on that object, e.g. client.workout_intensity("xid")
  • creating a new object, e.g. client.create_workout(params)

Jawbone does not necessarily support all of these methods on all objects. For example, there's no endpoint to create a new "move" object. Calling these methods will return an error message.

Refreshing user tokens post heartbleed

  • get refreshed users token client.refresh_token("CLIENT_SECRET"), returns refreshed user token

See https://jawbone.com/up/developer/endpoints for the full documentation.

By default, an application only gets basic_read permission from Jawbone. You have to specify additional scopes when you send the user to Jawbone to grant your app permissions to read their account.

I've also got an omniauth strategy for Jawbone right here, special price for special friends of Rick.

jawbone-up-api's People

Contributors

andrewpbrett avatar fukayatsu avatar jmaddi avatar vgdub avatar wstrinz avatar

Watchers

 avatar  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.