Water Goals
A Water Goal can be used to set a personal user goal for water.
Overview
Property | Type | Description |
---|---|---|
code | String | The id of the water measurement |
user_code | String | The global Id of the user |
start_date | Datetime with Timezone | The original start date and time of the sleep segment in UTC time |
goal | Number | The target amount of water, in the specified unit of measure |
source | String | The source service for the measurement, where it was created |
created_at | Datetime with Timezone | The time the measurement was created on the ZivaCare API server |
updated_at | Datetime with Timezone | The time the measurement was updated on the ZivaCare API server |
unit | String | The unit of the measurement value. See Unit System. |
Example
GET https://api.zivacare.com/api/v2/human/water_goals?access_token=demo
{
"waterGoals": [
{
"code": "9539851b-1aa6-4748-968f-761f0a3ccb77",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"start_date": "2016-02-16 15:52:01+00",
"goal": 4.00,
"source": "fitbit",
"created_at": "2016-06-02 08:24:49+00",
"unit": "ml"
}
],
"total": 1
}
curl -i POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/water_goals?access_token=demo -d '{
"goal": 2.00,
"source": "fitbit",
"start_date": "2016-02-16T15:52:01+0000",
"unit": "ml"
}'
GET https://api.zivacare.com/api/v2/human/water_goals/9539851b-1aa6-4748-968f-761f0a3ccb77?access_token=demo
{
"waterGoal":
{
"code": "9539851b-1aa6-4748-968f-761f0a3ccb77",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"start_date": "2016-02-16 15:52:01+00",
"goal": 4.00,
"source": "fitbit",
"created_at": "2016-06-02 08:24:49+00",
"unit": "ml"
}
}
curl -i PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/water_goals/9539851b-1aa6-4748-968f-761f0a3ccb77?access_token=demo -d '{
"goal": 2.00,
"source": "fitbit",
"start_date": "2016-02-16T15:52:01+0000",
"unit": "ml"
}'