API Reference

Meals

67 views 0

The Meals resource contains detailed data about nutrition consumed by the human separated by date and type: breakfast/lunch/dinner/other.

Overview

Property Unit Type Description
code String The id of the meal object
user_code String The global Id of the user
record_time Datetime with Timezone The original date of the meal
source String The source service for the meal data
type String Type of the meal: breakfast/lunch/dinner/other
name String Descriptive name of the meal
calories kcal Number The amount of consumed calories
carbohydrate g Number The amount of consumed carbohydrate
fat g Number The amount of consumed fat
protein g Number The amount of consumed protein
sodium g Number The amount of consumed sodium
sugar g Number The amount of consumed sugar
fiber g Number The amount of consumed fiber (optional)
saturated_fat g Number The amount of consumed saturated fat (optional)
monounsaturated_fat g Number The amount of consumed monounsaturated fat (optional)
polyunsaturated_fat g Number The amount of consumed polyunsaturated fat (optional)
cholesterol mg Number The amount of consumed cholesterol (optional)
vitamin_a mg Number The amount of consumed vitamin A (optional)
vitamin_c mg Number The amount of consumed vitamin C (optional)
calcium mg Number The amount of consumed calcium (optional)
iron mg Number The amount of consumed iron (optional)
potassium mg Number The amount of consumed potassium (optional)
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/meals?access_token=demo
{
  "meals": [
    {
      "code": "58e678b6-648a-476a-9b91-ab7d34668c7a",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2016-05-09 14:35:50.577097+00"
    },
    {
      "code": "8bc4fc61-fc92-4d6c-8532-0274905f3f43",
      "record_time": "2013-09-17 00:00:00+00",
      "type": "breakfast",
      "source": "runkeeper",
      "name": "first meal",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2015-05-08 11:16:14.333027+00"
    },
    {
      "code": "18c876ae-4007-4801-9758-47d8b6aef4c5",
      "record_time": "2013-09-16 15:52:01+00",
      "type": "breakfast",
      "source": "runkeeper",
      "name": "first meal",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2014-09-26 11:11:35+0",
      "updated_at": "2014-09-26 12:47:44+00"
    }
  ], 
  "total": 3
}
curl -X POST -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/meals?access_token=demo -d '{     
  "start_time": "2014-09-16T15:52:01+0000",
  "end_time": "2014-09-16T15:55:01+0000",
  "fat": "35",
  "calories": 100,
  "timezone": "Europe/Bucharest",
  "source": "fitbit"
}'
GET https://api.zivacare.com/api/v2/human/meals/daily/2013-09-16?access_token=demo
{
  "meals": [
    {
      "code": "18c876ae-4007-4801-9758-47d8b6aef4c5",
      "record_time": "2013-09-16 15:52:01+00",
      "type": "breakfast",
      "source": "runkeeper",
      "name": "first meal",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2014-09-26 11:11:35+0",
      "updated_at": "2014-09-26 12:47:44+00"
    }
  ], 
  "total": 1
}
GET https://api.zivacare.com/api/v2/human/meals/period/2013-09-16/2013-10-16?access_token=demo
{
  "meals": [
    {
      "code": "8bc4fc61-fc92-4d6c-8532-0274905f3f43",
      "record_time": "2013-09-17 00:00:00+00",
      "type": "breakfast",
      "source": "runkeeper",
      "name": "first meal",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2015-05-08 11:16:14.333027+00"
    },
    {
      "code": "18c876ae-4007-4801-9758-47d8b6aef4c5",
      "record_time": "2013-09-16 15:52:01+00",
      "type": "breakfast",
      "source": "runkeeper",
      "name": "first meal",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2014-09-26 11:11:35+0",
      "updated_at": "2014-09-26 12:47:44+00"
    }
  ], 
  "total": 2
}
GET https://api.zivacare.com/api/v2/human/meals/18c876ae-4007-4801-9758-47d8b6aef4c5?access_token=demo
{
  "meal": 
    {
      "code": "18c876ae-4007-4801-9758-47d8b6aef4c5",
      "record_time": "2013-09-16 15:52:01+00",
      "type": "breakfast",
      "source": "runkeeper",
      "name": "first meal",
      "user_code": "e231e984-2209-4a10-b634-2257b89c200f",
      "created_at": "2014-09-26 11:11:35+0",
      "updated_at": "2014-09-26 12:47:44+00"
    }
}
curl -X PUT -H 'Content-Type: application/json' https://api.zivacare.com/api/v2/human/meals/18c876ae-4007-4801-9758-47d8b6aef4c5?access_token=demo -d '{     
  "start_time": "2014-09-16T15:52:01+0000",
  "end_time": "2014-09-16T15:55:01+0000",
  "fat": "35",
  "calories": 100,
  "timezone": "Europe/Bucharest",
  "source": "fitbit"
}'

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