API Reference

Activity Goals

61 views 0

An Activity Goal can be used to set a personal user goal for an activity.

Overview

Property Type Description
code String The Code of the resource
user_code String The global Id of the user
calories_out Number The target number of calories to burned during the activity
distance Number The target distance in the specified unit of measure
steps Number The target number of steps to be taken during the activity
source String The name of the originating service
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_goals?access_token=demo
{
  "activitiesGoals": [
    {
      "code": "1fccf31b-db03-45cc-9a5b-567d45333294",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "calories_out": 90.00,
      "distance": 1000.00,
      "steps": 800.00,
      "source": "fitbit",
      "created_at": "2016-06-01 12:56:03.67+00",
      "unit": "km"
    },
    {
      "code": "5940f111-8d7a-478a-9252-164931e1f8d9",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "calories_out": 92.00,
      "distance": 1000.00,
      "steps": 1100.00,
      "source": "fitbit",
      "created_at": "2016-06-01 12:39:12+00",
      "unit": "km"
    }
  ], 
  "total": 2
}
curl -i POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/activities_goals?access_token=demo -d '{ 
  "source": "fitbit",
  "calories_out": 90.00,
  "distance": 1000.00,
  "steps": 1100.00,
  "unit": "km"
}' 
GET https://api.zivacare.com/api/v2/human/activities_goals/1fccf31b-db03-45cc-9a5b-567d45333294?access_token=demo
{
  "activitiesGoals": 
    {
      "code": "1fccf31b-db03-45cc-9a5b-567d45333294",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "calories_out": 90,
      "distance": 1000,
      "steps": 1100,
      "source": "fitbit",
      "created_at": "2016-06-01 12:56:03.670049+00",
      "updated_at": "2016-06-02 11:55:53.622369+00",
      "unit": "km"
    } 
}
curl -i PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/activities_goals/1fccf31b-db03-45cc-9a5b-567d45333294?access_token=demo -d '{ 
  "source": "fitbit",
  "calories_out": 90.00,
  "distance": 1000.00,
  "steps": 900.00,
  "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