The Weight resource represents a weight measurement from a specific point in time.
Overview
Property | Type | Description |
---|---|---|
code | String | The code of the weight 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 |
value | Number | The value of the measurement in the unit specified |
unit | String | The unit of the measurement value. See Unit System. |
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 |
Example
GET https://api.zivacare.com/api/v2/human/weights?access_token=demo
{
"weights": [
{
"code": "e9199a7f-5ed3-4ac3-84e2-320f3be753ce",
"source": "fitbit",
"value": 98.00,
"unit": "kg",
"record_time": "2016-07-01 15:52:01+00",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-01-07 14:31:08+00"
},
{
"code": "cfaf9252-416e-4d42-842c-ecfe0859eabd",
"source": "PEGASO-Runkeeper",
"value": 95.50,
"unit": "kg",
"record_time": "2016-03-13 00:00:00+00",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-03-15 17:00:18+00"
}
],
"total": 2
}
curl -X POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/weights?access_token=demo
-d '{ "value": 99.00, "unit": "kg", "source": "fitbit", "record_time": "2014-09-16T15:52:01+0000" }'
GET https://api.zivacare.com/api/v2/human/weights/daily/2016-07-01?access_token=demo
{
"weights": [
{
"code": "e9199a7f-5ed3-4ac3-84e2-320f3be753ce",
"source": "fitbit",
"value": 98.00,
"unit": "kg",
"record_time": "2016-07-01 15:52:01+00",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-01-07 14:31:08+00"
}
],
"total": 1
}
GET https://api.zivacare.com/api/v2/human/weights/period/2016-07-01/2016-07-02?access_token=demo
{
"weights": [
{
"code": "e9199a7f-5ed3-4ac3-84e2-320f3be753ce",
"source": "fitbit",
"value": 98.00,
"unit": "kg",
"record_time": "2016-07-01 15:52:01+00",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-01-07 14:31:08+00"
}
],
"total": 1
}
GET https://api.zivacare.com/api/v2/human/weights/e9199a7f-5ed3-4ac3-84e2-320f3be753ce?access_token=demo
{
"weight": [
{
"code": "e9199a7f-5ed3-4ac3-84e2-320f3be753ce",
"source": "fitbit",
"value": 98.00,
"unit": "kg",
"record_time": "2016-07-01 15:52:01+00",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-01-07 14:31:08+00"
}
}
curl -X PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/weights/e9199a7f-5ed3-4ac3-84e2-320f3be753ce?access_token=demo
-d '{ "value": 99.00, "unit": "kg", "source": "fitbit", "record_time": "2014-09-16T15:52:01+0000" }'