Getting iHealth Data

iHealth OpenAPI V2 Endpoints

Once you've registered your client it's easy to start requesting data from iHealth.
All endpoints are only accessible via https and are located at api.iHealthLabs.com:8443.

Important Note

The URL examples throughout this documentation include an access_token that represents YOUR account tied to a generic iHealth client. DO NOT use this access_token in production or for anything other than testing as they will change often. For your application, you should have each user go through an authentication and authorization flow in order to receive a valid access_token.

Limits

Be nice. If you're sending too many requests too quickly, we'll send back a 503 error code (server unavailable).
You are limited to 5000 requests per hour per access_token or client_id overall. Practically, this means you should (when possible) authenticate users so that limits are well outside the reach of a given user.

Deleting Objects

We do our best to have all our URLs be RESTful. Every endpoint (URL) may support one of four different http verbs. GET requests fetch information about an object, POST requests create objects, PUT requests update objects, and finally DELETE requests will delete objects. Since many old browsers don't support PUT or DELETE, we've made it easy to fake PUTs and DELETEs. All you have to do is do a POST with _method=PUT or _method=DELETE as a parameter and we will treat it as if you used PUT or DELETE respectively.

Structure

Unit
OpenAPI V2 server also provides unit-converting function for developers. By importing the corresponding parameters, developers can get the data with different unit base. Developers can also procure data with the unit pre-defined by the users according to users’ preferences. (see appendix)
Pagination
Sometimes you just can't get enough. For this reason, we've provided a convenient way to access more data in any request for sequential data. Simply call the url in the NextPageUrl and PrevPageUrl parameter and we'll respond with the next set of data.
On views where pagination is present, we also support the "count" parameter. Simply set this to the number of items you'd like to receive. Note that the default values should be fine for most applications - but if you decide to increase this number there is a maximum value defined on each endpoint.
Response Type
To make it more convenient and compatible, iHealth OpenAPI V2 provides two different formats of response data type, one is JSON, and the other is XML. Third party developers can select the type of format they need and do the advanced setting anytime.

JSONP

If you're writing an AJAX application, and you'd like to wrap our response with a callback, all you have to do is specify a callback parameter with any API call:
http://sandboxapi.ihealthlabs.com/openapiv2/user/05dffbe0dd*****/weight.json/&callback=callbackFunction
Would respond with:

callbackFunction({
...
});