The Body Fat resource is a body fat measurement from a specific point in time.
Overview
Property | Type | Description |
---|---|---|
code | String | The id of the body fat 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/body_fats?access_token=demo
{
"bodyFats": [
{
"code": "03795338-c77f-42d6-88c9-8ac6946dbcb4",
"record_time": "2016-02-06 22:00:00+00",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-05-09 14:35:36.42673+00"
},
{
"code": "b76c608d-5ab8-49a8-b2fa-18a10324f148",
"value": 3,
"unit": "%",
"record_time": "2016-04-18 00:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-04-18 06:34:21+00"
} ,
{
"code": "ac8430f6-18e1-4abe-8da6-c58eb16dca8f",
"value": 3,
"unit": "%",
"record_time": "2016-04-18 00:00:00+00",
"source": "iPortal",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-04-18 06:34:14+00"
} ,
{
"code": "f484e2f4-1caf-47da-9a35-4373ba3f8a1c",
"value": 21,
"unit": "percent",
"record_time": "2014-09-16 15:52:01+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2015-04-07 14:53:21+00"
}
],
"total": 4
}
curl -X POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/body_fats?access_token=demo
-d '{ "value": 30, "unit": "%", "source": "fitbit", "record_time": "2014-09-16T15:52:01+0000" }'
GET https://api.zivacare.com/api/v2/human/body_fats/daily/2016-04-18?access_token=demo
{
"bodyFats": [
{
"code": "ac8430f6-18e1-4abe-8da6-c58eb16dca8f",
"value": 3,
"unit": "%",
"record_time": "2016-04-18 00:00:00+00",
"source": "iPortal",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-04-18 06:34:14+00"
} ,
{
"code": "b76c608d-5ab8-49a8-b2fa-18a10324f148",
"value": 3,
"unit": "%",
"record_time": "2016-04-18 00:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-04-18 06:34:21+00"
}
],
"total": 2
}
GET https://api.zivacare.com/api/v2/human/body_fats/period/2016-02-06/2016-04-18?access_token=demo
{
"bodyFats": [
{
"code": "ac8430f6-18e1-4abe-8da6-c58eb16dca8f",
"value": 3,
"unit": "%",
"record_time": "2016-04-18 00:00:00+00",
"source": "iPortal",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-04-18 06:34:14+00"
} ,
{
"code": "b76c608d-5ab8-49a8-b2fa-18a10324f148",
"value": 3,
"unit": "%",
"record_time": "2016-04-18 00:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-04-18 06:34:21+00"
}
],
"total": 2
}
GET https://api.zivacare.com/api/v2/human/body_fats/b76c608d-5ab8-49a8-b2fa-18a10324f148?access_token=demo
{
"bodyFat":
{
"code": "b76c608d-5ab8-49a8-b2fa-18a10324f148",
"value": 3,
"unit": "%",
"record_time": "2016-04-18 00:00:00+00",
"source": "fitbit",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2016-04-18 06:34:21+00"
}
}
curl -X PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/body_fats/b76c608d-5ab8-49a8-b2fa-18a10324f148?access_token=demo
-d '{ "value": 30, "unit": "%", "source": "fitbit", "record_time": "2014-09-16T15:52:01+0000" }'