API Reference

Activity

116 views 0

Activities are specific types of physical activities that occur during a period of time with a start time and an end time. These activities are often captured automatically using applications that track motion throughout the day, such as Moves, or they are recorded from applications such as Runkeeper or MapMyRun. They can also be manually entered with applications like Fitbit.

Overview

Property Type Description
code String The Code of the resource
user_code String The global Id of the user
start_time Datetime with Timezone The start time of the activity in UTC time
end_time Datetime with Timezone The end time of the activity in UTC time
timezone String The offset from UTC time in +/-hh:mm (e.g. -04:00)
type String The type of activity, such as walking, running, cycling
source String The name of the originating service
duration Number The duration in seconds
distance Number The distance in the specified unit of measure
steps Number The number of steps taken during the activity
calories Number The number of estimated calories burned during the activity
created_at Datetime with Timezone The time the activity was created on the ZivaCare API server
updated_at Datetime with Timezone The time the activity 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/activities?access_token=demo
{
  "activities": [
    {
      "code": "c6f0f6f8-159e-4d6e-890a-d2b2f4a70d61",
      "start_time": "2014-09-16 15:52:01+00",
      "end_time": "2014-09-16 15:55:01+00",
      "unit": "km",
      "type": "jogging",
      "source": "fitbit",
      "duration": 3,
      "distance": 1.1,
      "steps": 30,
      "calories": 100.00,
      "timezone": "Europe/Bucharest",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2015-05-07 11:39:36+00",
      "updated_at": "2016-04-20 11:25:02.790469+00"
    }
  ], 
  "total": 1
}
curl -X POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/activities?access_token=demo -d '{ "start_time": "2014-09-16T15:52:01+0000", "end_time": "2014-09-16T15:55:01+0000", "type": "jogging", "duration":3, "distance": 1.1, "steps":30, "calories":100, "time_zone": "Europe/Bucharest", "source": "fitbit", "unit": "km" }'
GET https://api.zivacare.com/api/v2/human/activities/daily/2014-09-16?access_token=demo
{
  "activity": [
    {
      "code": "be096590-81c2-4b13-b431-7ff9a1cb161c",
      "start_time": "2014-09-16 15:52:01+00",
      "end_time": "2014-09-16 15:55:01+00",
      "unit": "km",
      "type": "jogging",
      "source": "fitbit",
      "duration": 3,
      "distance": 1.1,
      "steps": 30,
      "calories": 100.00,
      "timezone": "Europe/Bucharest",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2016-05-23 08:58:03.737856+00"
    }
  ], 
  "total": 1
}
GET https://api.zivacare.com/api/v2/human/activities/period/2014-09-16/2015-09-16?access_token=demo
{
  "activities": [
    {
      "code": "be096590-81c2-4b13-b431-7ff9a1cb161c",
      "start_time": "2014-09-16 15:52:01+00",
      "end_time": "2014-09-16 15:55:01+00",
      "unit": "km",
      "type": "jogging",
      "source": "fitbit",
      "duration": 3,
      "distance": 1.1,
      "steps": 30,
      "calories": 100.00,
      "timezone": "Europe/Bucharest",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2016-05-23 08:58:03.737856+00"
    } 
  ], 
  "total": 1
}
GET https://api.zivacare.com/api/v2/human/activities/010170a0-5b9d-4b59-942b-fbea9953ef87?access_token=demo
{
  "activity": 
    {
      "code": "010170a0-5b9d-4b59-942b-fbea9953ef87",
      "start_time": "2016-02-13 15:44:08+00",
      "end_time": "2016-02-13 17:39:10+00",
      "unit": "km",
      "type": "Walking",
      "source": "PEGASO-Runkeeper",
      "duration": 6902,
      "distance": 11762,
      "calories": 1100.00,
      "timezone": "Europe/Bucharest",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2016-03-15 17:00:17+00"
    } 
}
curl -X PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/activities/010170a0-5b9d-4b59-942b-fbea9953ef87?access_token=demo -d '{ "start_time": "2014-09-16T15:52:01+0000", "end_time": "2014-09-16T15:55:01+0000", "type": "jogging", "duration":3, "distance": 1.1, "steps":30, "calories":100, "time_zone": "Europe/Bucharest", "source": "fitbit", "unit": "km" }'

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