ContentsBasic rulesApi follow RESTfull principles. All data is transferred as a
application/json.
All calls should use https. Every call to Azumio API need to have at least two headers in the header request: Client ID and OAuth token. Client ID is given at the time of registration (this is something we do and send the client ID to you).
AuthenticationAuthentication uses OAuth 2.0 model. Every call to the API need to include the Authorization header with a token. Browser authentication flow
Using tokensPass them in Authentication header for every call either in the HTTP header or as _header parameter. http://api.azumio.com/api2/checkins?_headers={“Authentication”:”OAuth ASFA.....SDFS"}
Accessing dataCheckinsAzumio API supports 6 different types of checkins:
Through API you can access checkin data in few different ways:
Checkin fragmentsSome of the checkins also have fragments (details specific to checkin type such as: steps data, walking paths, location, ...).
If checkin has fragments they can be recognised in JSON property name.
Example:
{ " hasMore ": true , " checkins ": [ { " remoteid ": " 56446F7D-6593-... " , " #steps_profile ": 123456 , " activeDuration ": 2000 , " privacy_groups ": [ " private " ] , " type ": " steps " , ...Fragments can be accessed by specifying checkin id/fragment id and the name of the fragment (excluding # character in the name):
StepsResponse:
"activeDuration": 3141, Error response:
Paging dataData cannot be paged by offset or similar methods normally used. This is due to database design.
How to handle data sync if you use a local databaseImportant MUST follow rules:
This is currently the only way to ensure robustness. If you don’t follow this two rules 100% you’ll have problems. Sync steps
User profileUser profile is an expandable JSON structure. Getting profile: http://api.azumio.com/api2/users/me
WebhooksWebhooks allow you to collect information about checkin events as they happen in near real-time. In order to receive those events (new checkins and updates of existing checkins) you need to register each individual user for which you wish to receive those events. You also need to provide your callback URL so we know where to deliver them to you. Azumio Webhook will POST to that callback URL with an empty body. Note: Webhook POST to your url has no body. You need to retrieve specific information from Azumio API when notified about the change. Subscribe userIn order to subscribe user, the user need to be logged in and user also must allow your service to access his data.
Example: POST https://api.azumio.com/api2/subscriptions?url=http://www.example.com/callback/user/1?type=steps,sleeptime
Calling /api2/subscriptions for a specific user multiple times, updates the callback url and type information for that user.
Get user subscriptionsExample: GET https://api.azumio.com/api2/subscriptions
Response:
{
"data": [ { "id": "org.organization.example_34546321", "created": 1402921264895, "userId": "123456", "types": [ "sleeptime", "steps" ], "clientId": "org.organization.example", "url": "http://www.example.com/callback/user/1" } ] } Remove user subscriptionExample: DELETE https://api.azumio.com/api2/subscriptions/subscription_id
|