There are a few simple conventions to follow when working with ZivaCare API, this section covers them in detail.
Making a basic query
ZivaCare API lets query user’s health data with and access_token
query parameter. For details on how to authorize users and retrive those tokens please see this section
Example of an API call with a query parameter (replace demo with the appropriate token):
curl https://api.zivacare.com/api/v2/human/weights?access_token=demo
Media types
ZivaCare API uses JSON (Javascript Object Notation) for all payloads. To query data you should set your Accespt Header to application/json
and when sending data you should set the Content-Type to application/json
API versions
The different versions of ZivaCare API can be used by specifiyng the version number in the url, i.e. /v1
https://api.zivacare.com/api/[version]/human/weights
https://api.zivacare.com/api/v2/human/weights
The most current version of ZivaCare API is v1.
Query options conventions
The standard query options for the ZivaCare API are as described in the table below. These parameters make it easier for you to implement smart synchronization for your application. These are the availabke query options in ZivaCare API:
PARAMETER | DESCRIPTION |
---|---|
limit | The max number of records to return in one query. Default is 10 |
offset | The index of the first record to return. Default is 0 |
start | Returns records that are created after the specified date. The format is YYYY-MM-DD |
end | Returns records that are udpated before the specified date. The format is YYYY-MM-DD |
Discrete measurements conventions
A discrete measurement is a unit of data that is captured at a point in time and has a timestamp
, a value
, and a type
. A measurement can also have an optional location or other meta data. To retrieve the discrete measurements you can follow the following pattern:
To retrieve the latest recordings:
https://api.zivacare.com/api/v2/human/[type]
To retrieve a reading by ID:
https://api.zivacare.com/api/v2/human/[type]/{code}
To retrieve a list of recordings for a specific date:
https://api.zivacare.com/api/v2/human/[type]/daily/{date}
Periodic data conventions
Periodic data, unlike discrete data, always has a start and end date. This type of data can be retrieved as a list of objects for a specific date or time period.
To retrieve a list of recordings for a period:
https://api.zivacare.com/api/v2/human/[type]/period/{YYYY-MM-DD}/{YYYY-MM-DD}