API Reference

Weight Goals

60 views 0

Weight Goals

A Weight Goal can be used to set a personal user goal for weight.

Overview

Property Type Description
code String The id of the weight measurement
user_code String The global Id of the user
start_date Datetime with Timezone The original start date and time of the weight segment in UTC time
start_weight Number The original weight
weight Number The target weight
source String The source service for the measurement, where it was created
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
unit String The unit of the measurement value. See Unit System.

Example

GET https://api.zivacare.com/api/v2/human/weight_goals?access_token=demo
{
  "weightGoals": [
    { 
      "code": "7f78f661-bc8c-49b6-97a1-b10d0b467020",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "start_date": "2014-09-16 15:52:01+00",
      "source": "fitbit",
      "created_at": "2016-04-13 12:20:31+00",
      "unit": "kg"
    },  
    { 
      "code": "7251999b-b974-4d88-998b-ddf219307a56",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "weight": 80.00,
      "source": "iPortal-3",
      "created_at": "2016-04-04 11:10:53+00",
      "unit": "kg"
    },  
    { 
      "code": "fb3fe6e6-7e83-4680-b491-962fc127bd30",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "start_date": "2016-02-16 15:52:01+00",
      "weight": 80.00,
      "source": "iPortal",
      "created_at": "2016-04-04 11:08:41+00",
      "updated_at": "2016-04-14 13:03:19+00",
      "unit": "kg"
    }  
  ], 
  "total": 3
}
curl -i POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/weight_goals?access_token=demo -d '{ 
  "source": "fitbit",
  "start_date": "2014-09-16T15:52:01+0000",
  "start_weight": 65,
  "weight": 70,
  "unit": "kg"
}'
GET https://api.zivacare.com/api/v2/human/weight_goals/7f78f661-bc8c-49b6-97a1-b10d0b467020?access_token=demo
{
  "weightGoal": 
    { 
      "code": "7f78f661-bc8c-49b6-97a1-b10d0b467020",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "start_date": "2014-09-16 15:52:01+00",
      "source": "fitbit",
      "created_at": "2016-04-13 12:20:31+00",
      "unit": "kg"
    } 
}
curl -i PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/weight_goals/fb3fe6e6-7e83-4680-b491-962fc127bd30?access_token=demo -d '{ 
  "source": "fitbit",
  "start_date": "2014-09-16T15:52:01+0000",
  "start_weight": 65,
  "weight": 70,
  "unit": "kg"
}'  

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