API Reference

Water Goals

31 views 0

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"
}'

Was this helpful?

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close