The Body Mass Index resource is a body mass index measurement from a specific point in time.
Overview
Property | Type | Description |
---|---|---|
code | String | The id of the body mass index measurement |
user_code | String | The global Id 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/bmis?access_token=demo
{
"bmis": [
{
"code": "b833a9eb-8066-49d5-bf7f-8ddea2350008",
"value": 30.87,
"unit": "kg/m2",
"record_time": "2016-02-06 22:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-02-07 17:00:06+00",
"updated_at": "2016-02-07 22:00:08+00"
},
{
"code": "cbe15dc7-fd81-4be7-9365-b973b25c74f1",
"value": 31.21,
"unit": "kg/m2",
"record_time": "2016-01-30 22:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-01-31 09:00:06+00",
"updated_at": "2016-01-31 22:00:07+00"
} ,
{
"code": "30f6318e-e639-4ade-ba26-aac43c457e6a",
"value": 30.90,
"unit": "kg/m2",
"record_time": "2016-01-28 22:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-01-31 09:00:06+00"
}
],
"total": 3
}
curl -X POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/bmi?access_token=demo
-d '{ "value": 23, "unit": "kg/m2", "source": "fitbit", "record_time": "2014-09-16T15:52:01+0000" }'
GET https://api.zivacare.com/api/v2/human/bmis/daily/2016-01-28?access_token=demo
{
"bmis": [
{
"code": "ecb60ace-89ad-493c-abf2-18f8e362f39f",
"value": 30.96,
"unit": "kg/m2",
"record_time": "2016-01-28 22:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-01-31 09:00:06+00"
}
],
"total": 1
}
GET https://api.zivacare.com/api/v2/human/bmis/period/2016-01-31/2016-04-08?access_token=demo
{
"bmis": [
{
"code": "b833a9eb-8066-49d5-bf7f-8ddea2350008",
"value": 30.87,
"unit": "kg/m2",
"record_time": "2016-02-06 22:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-02-07 17:00:06+00",
"updated_at": "2016-02-07 22:00:08+00"
}
],
"total": 1
}
GET https://api.zivacare.com/api/v2/human/bmis/db448419-ba04-4f14-b070-c9463dd50bd3?access_token=demo
{
"bmi":
{
"code": "db448419-ba04-4f14-b070-c9463dd50bd3",
"value": 31.09,
"unit": "kg/m2",
"record_time": "2016-01-27 22:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-01-28 21:00:06+00",
"updated_at": "2016-01-28 22:00:07+00"
}
}
curl -X PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/bmis/db448419-ba04-4f14-b070-c9463dd50bd3?access_token=demo
-d '{ "value": 23, "unit": "kg/m2", "source": "fitbit", "record_time": "2014-09-16T15:52:01+0000" }'