API Reference

Water

59 views 0

Water resources are units of water from a specific point in time.

Overview

Property Type Description
code String The code of the water measurement
user_code String The global code of the user
record_time Datetime with Timezone The original date and time of the measurement
source String The source service for the measurement, where it was created
amount Number The amount of water, in the specified unit of measure
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/waters?access_token=demo
{
  "waters": [
    {
      "code": "8405355e-e2ed-4efb-ae21-c3f6118654a3",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "source": "fitbit",
      "created_at": "2016-05-30 13:01:47.024848+00",
      "unit": "ml"
    },
    {
      "code": "895de069-78c7-4f77-89c6-4cf4f6a133ec",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "amount": "2.00",
      "record_time": "2016-03-04 15:52:01+00",
      "source": "fitbit",
      "created_at": "2016-03-15 17:00:18+00",
      "unit": "ml"
    }
  ], 
  "total": 2
}
curl -X POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/waters?access_token=demo -d '{ 
  "amount": "2",
  "source": "fitbit",
  "record_time": "2016-02-16T15:52:01+0000",
  "unit": "ml"
}'
GET https://api.zivacare.com/api/v2/human/waters/daily/2016-03-04?access_token=demo
{
  "waters": [
    {
      "code": "895de069-78c7-4f77-89c6-4cf4f6a133ec",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "amount": "2.00",
      "record_time": "2016-03-04 15:52:01+00",
      "source": "fitbit",
      "created_at": "2016-03-15 17:00:18+00",
      "unit": "ml"
    }
  ], 
  "total": 1
}
GET https://api.zivacare.com/api/v2/human/waters/period/2016-03-04/2016-04-04?access_token=demo
{
  "waters": [
    {
      "code": "895de069-78c7-4f77-89c6-4cf4f6a133ec",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "amount": "2.00",
      "record_time": "2016-03-04 15:52:01+00",
      "source": "fitbit",
      "created_at": "2016-03-15 17:00:18+00",
      "unit": "ml"
    }
  ], 
  "total": 1
}
GET https://api.zivacare.com/api/v2/human/waters/895de069-78c7-4f77-89c6-4cf4f6a133ec?access_token=demo
{
  "water": 
    {
      "code": "895de069-78c7-4f77-89c6-4cf4f6a133ec",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "amount": "2.00",
      "record_time": "2016-03-04 15:52:01+00",
      "source": "fitbit",
      "created_at": "2016-03-15 17:00:18+00",
      "unit": "ml"
    }
}
curl -X PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/waters/895de069-78c7-4f77-89c6-4cf4f6a133ec?access_token=demo -d '{ 
  "amount": "2",
  "source": "fitbit",
  "record_time": "2014-09-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