The Location resource is a place identified with a latitude/longitude coordinates and a time period, representing when a user was at a specific place.
Overview
Property | Type | Description |
---|---|---|
code | String | The id of the location measurement |
user_code | String | The global Id of the user |
start_time | Datetime with Timezone | The original start date and time of the location segment |
end_time | Datetime with Timezone | The original end date and time of the location segment |
name | String | The name of the place |
source | String | The source service that recorded the location |
type | String | The type of location |
location | Object | The coordinate point with a lat/lon value |
created_at | Datetime with Timezone | The time the location was created on the ZivaCare API server |
updated_at | Datetime with Timezone | The time the location was updated on the ZivaCare API server |
Example
GET https://api.zivacare.com/api/v2/human/locations?access_token=demo
{
"locations": [
{
"code": "76c271fb-f1a7-4414-bead-52e46cd7b4bc",
"name": "Sibiu",
"source": "fitbit",
"type": "test",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2014-09-10 13:47:59+00"
},
{
"code": "8d437f0b-577f-497f-bd0a-85e1b8b28490",
"name": "Sibiu",
"start_time": "2014-09-15 15:52:01+00",
"end_time": "2014-09-15 15:52:01+00",
"source": "fitbit",
"type": "test",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2014-09-10 13:47:59+00"
}
],
"total": 2
}
curl -X POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/locations?access_token=demo
-d '{ "source": fitbit, "location": "Park", "name": "Sibiu", "start_time": "2014-09-16T15:52:01+0000", "end_time": "2014-09-16T15:55:01+0000" }'
GET https://api.zivacare.com/api/v2/human/locations/76c271fb-f1a7-4414-bead-52e46cd7b4bc?access_token=demo
{
"location":
{
"code": "76c271fb-f1a7-4414-bead-52e46cd7b4bc",
"name": "Sibiu",
"source": "fitbit",
"type": "test",
"user_code": "e231e984-2209-4a10-b634-2257b89c200f",
"created_at": "2014-09-10 13:47:59+00"
}
}
curl -X PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/locations/76c271fb-f1a7-4414-bead-52e46cd7b4bc?access_token=demo
-d '{ "source": fitbit, "location": "Park", "name": "Sibiu", "start_time": "2014-09-16T15:52:01+0000", "end_time": "2014-09-16T15:55:01+0000" }'