Make your product
work with UP.

Meals

Get the user's meal list

Returns the list of meals of the current user. This list can be paginated by date or timestamp.
URI Method Response Type Returns
/nudge/api/v.1.1/users/@me/meals GET application/json Collection>Meal
Parameter Type Description
date int Date, formatted as YYYYMMDD. If omitted, returns the information for today.
page_token int Timestamp used to paginate the list of meals. The Developer must use the "next" link provided in the "links" section.
start_time int To be used along with end_time. Epoch timestamp that denotes the start of the time range queried for events.
end_time int To be used with start_time. Epoch timestamp that denotes the end of the time range queried for events.
updated_after int Epoch timestamp to list events that are updated later than the timestamp. To be used with start_time to list events that were completed after said start_time.

Example:

GET <a href="https://jawbone.com/nudge/api/v.1.1/users/@me/meals?start_time=1383289200">https://jawbone.com/nudge/api/v.1.1/users/@me/meals?start_time=1383289200</a> HTTP/1.1
Host: jawbone.com
	

Will return:

HTTP 200 Ok
{
   “meta”:
   {
      “user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
      “message”: “OK”,
      “code”: 200
      "time": 1386122022
   },
   “data”:
   {
      "items": 
      [{
         "xid": "40F7_htRRnT8Vo7nRBZO1X",
         "title": "Something Good",
         "note": "Something Good",
         "type": "meal",
         "sub_type": 2,
         "time_created": 1384963500,
         "time_updated": 1385049599,
         "time_completed": 1385099220,
         "date": 20131121,
         "place_lat": "37.451572",
         "place_lon": "-122.184435",
         "place_acc": 10,
         "place_name": "Good Eats",
         "details": 
         {
            "num_drinks": 3,
            "num_water": 1,
            "num_foods": 2,
            "only_waters": false,
            "num_mealitems_green": 1,
            "num_mealitems_yellow": 2,
            "num_mealitems_red": 1,
            "num_mealitems_with_score": 5, 
            "fiber": 0,
            "polyunsaturated_fat": 1.54,
            "potassium": 164.0, 
            "fat": 23.15, 
            "carbohydrate": 64.75, 
            "saturated_fat": 6, 
            "protein": 16.77, 
            "monounsaturated_fat": 5.773, 
            "sodium": 504.0, 
            "vitamin_c": 0, 
            "vitamin_a": 3.0, 
            "calories": 530.0, 
            "unsaturated_fat": 15.313, 
            "sugar": 19.0, 
            "calcium": 140.0, 
            "iron": 14.0, 
            "cholesterol": 50.0, 
            "accuracy": 20.0
            "tz": "America/Los_Angeles",
         }
      },
      {
      ... more items ....
      }],
      "links": 
      {
         "next": "/nudge/api/v.1.1/users/6xl39CsoVp2KirfHwVq_Fx/meals?page_token=1384390680"
      },
      “size”: 10
   }   
}
	
Data Value Type Description
xid string Unique ID for this event. Can be used to retrieve data for this specific event, see below.
title string Title of this meal
note string Note on this meal
type string Type of event, in this case a meal.
sub_type int Meal type. 1=Breakfast, 2=Lunch, 3=Dinner, 4=Pre-Workout, 5=Post-Workout, 6=Snack
time_created int Epoch timestamp when this meal was created.
time_updated int Epoch timestamp when this meal was last updated.
time_completed int Epoch timestamp when this meal was completed.
date int Date when this meal was created, formatted as YYYYMMDD.
place_lat float Latitude of location where meal was logged.
place_lon float Longitude of location where meal was logged.
place_acc int Accuracy of location where meal was logged, in meters.
place_name string Name of location where meal was logged.
num_drinks int Number of drinks in this meal.
num_water int Number of Waters in this meal.
num_foods int Number of foods in this meal.
only_waters bool If the meal contains only Waters as Meal items.
num_mealitems_green int Number of Meal items in the given meal having Food Score in Green zone.
num_mealitems_yellow int Number of Meal items in the given meal having Food Score in Yellow zone.
num_mealitems_red int Number of Meal items in the given meal having Food Score in Red zone.
num_mealitems_with_score int Number of Meal items in the given meal containing Food Score.
fiber float Fiber content (in grams)
polyunsaturated_fat float Polyunsaturated fat content (in grams)
potassium float Potassium content (in milligrams)
fat float Fat content (in grams)
Carbohydrate float Carbohydrate content (in grams)
saturated_fat float Saturated fat content (in grams)
protein float Protein content (in grams)
monounsaturated_fat float Monosaturated fat content (in grams)
sodium float Sodium content (in milligrams)
vitamin_c float Percentage of daily recommended vitamin C (based on a 2000 calorie diet)
vitamin_a float Percentage of daily recommended vitamin A (based on a 2000 calorie diet)
calories int Calories for this meal.
unsaturated_fat float Unsaturated fat content (in grams)
sugar float Sugar content (in grams)
calcium float Calcium content (in milligrams)
iron float Percentage of daily recommended iron (based on a 2000 calorie diet)
cholesterol float Cholesterol content (in milligrams)
caffeine float Caffeine content (in milligrams)
tz string Time zone when this event was generated. Whenever possible, Olson format (e.g., "America/Los Angeles") will be returned, otherwise the GMT offset (e.g., "GMT+0800") will be returned.
size int Number of items in this list.
barcode int UPC identifier for individual known meal items.
next URI Link to next page of data (relative, add https://jawbone.com as prefix).

Get information about a specific meal

Returns detailed information about a specific meal
URI Method Response Type Returns
/nudge/api/v.1.1/meals/{xid} GET application/json Meal

Example:

GET <a href="https://jawbone.com/nudge/api/v.1.1/meals/40F7_htRRnT8Vo7nRBZO1X">https://jawbone.com/nudge/api/v.1.1/meals/40F7_htRRnT8Vo7nRBZO1X</a> HTTP/1.1
Host: jawbone.com
	

Will return:

HTTP 200 Ok
{
   “meta”:
   {
      “user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
      “message”: “OK”,
      “code”: 200
      "time": 1386122022
   },
   “data”:
   {
      "xid": "40F7_htRRnT8Vo7nRBZO1X",
      "title": "Something Good",
      "note": "Something Good",
      "type": "meal",
      "sub_type": 2,
      "time_created": 1384963500,
      "time_updated": 1385049599,
      "time_completed": 1385099220,
      "date": 20131121,
      "place_lat": "37.451572",
      "place_lon": "-122.184435",
      "place_acc": 10,
      "place_name": "Good Eats",
      "details": 
      {
         "num_drinks": 1, 
         "num_foods": 2, 
         "fiber": 0,
         "polyunsaturated_fat": 1.54,
         "potassium": 164.0, 
         "fat": 23.15, 
         "carbohydrate": 64.75, 
         "saturated_fat": 6, 
         "protein": 16.77, 
         "monounsaturated_fat": 5.773, 
         "sodium": 504.0, 
         "vitamin_c": 0, 
         "vitamin_a": 3.0, 
         "calories": 530.0, 
         "unsaturated_fat": 15.313, 
         "sugar": 19.0, 
         "calcium": 140.0, 
         "iron": 14.0, 
         "cholesterol": 50.0, 
         "accuracy": 20.0
         "tz": "America/Los_Angeles",
      },
      "items":
      {
         "items": 
         [[
            "xid": "wl8xlA1QGj4K332_tfM7gw",
            "food_xid": "RR-CZ6PGN0M",
            "serving_xid": "3gjtdd2Q7pg",
            "name": "Goldfish",
            "description": "",
            "image": "/nudge/image/d/514933b4ed47ab657766c82d_image.jpeg",
            "sub_type": 2,
            "health_score": "", 
            "multiplier_max": 5,
            "multiplier_min": 0.1,
            "measurement": "grams",
            "type": "plate",
	    "barcode": 087456000815,
            "carbohydrate": 31.75,
            "trans_fat": 0,
            "saturated_fat": 6,
            "protein": 14.77,
            "sodium": 500,
            "vitamin_c": 0,
            "vitamin_a": 3,
            "unsaturated_fat": 7.313,
            "sugar": 0,
            "fiber": 0,
            "potassium": 164,
            "fat": 15.15,
            "monounsaturated_fat": 5.773,
            "calories": 319,
            "polyunsaturated_fat": 1.54,
            "calcium": 140,
            "iron": 14,
            "cholesterol": 50,
            "amount": 1
         },{
            ... more items ...
         }],
         "size": 3
      }
   }   
}
	

Create a new meal

URI Method Response Type Returns
/nudge/api/v.1.1/users/@me/meals POST application/json Meal
Parameter Type Description
note string Title / description of the meal. Used as both title and note.
sub_type int Meal type. 1=Breakfast, 2=Lunch, 3=Dinner, 4=Pre-Workout, 5=Post-Workout, 6=Snack
image_url URI URI of the meal image
photo binary Binary contents of the meal image
place_lat float Latitude of the location where the meal was created
place_lon float Longitude of the location where the meal was created
place_acc float Accuracy (meters) of the location where the meal was created
place_name string Name of the location where the meal was created
time_created int Epoch timestamp when the meal was created
tz string Time zone when this event was generated. Whenever possible, Olson format (e.g., "America/Los Angeles") will be returned, otherwise the GMT offset (e.g., "GMT+0800") will be returned.
share boolean Set whether to share event on user's public feed. Will not override if user's privacy setting is set to not share.
items JSON-encoded list See list below
Item property Type Description
name string Name of the meal item
description string Description of the meal item
amount float Amount of "measurement" (e.g. 100)
measurement String Unit of measurement (e.g. grams)
type int Quantity size by container. 1=Plate, 2=Cup, 3=Bowl, 4=Scale, 5=Glass
sub_type int Type of food. 1=Drink, 2=Food
food_categories list Used to log water. ["water"] = one glass of water
category string Category name (free text)
food_type int 1=Generic, 2=Restaurant, 3=Brand, 4=Personal
calcium int Calcium (in milligrams)
calories int Calories
carbohydrate float Carbohydrate content (in grams)
cholesterol float Cholesterol content (in milligrams)
fiber float Fiber content (in grams)
protein float Protein content (in grams)
saturated_fat float Saturated fat content (in grams)
sodium float Sodium content (in milligrams)
sugar float Sugar content (in grams)
unsaturated_fat float Unsaturated fat content (in grams)
caffeine float Caffeine content (in milligrams)

Example:

POST <a href="https://jawbone.com/nudge/api/v.1.1/users/@me/meals">https://jawbone.com/nudge/api/v.1.1/users/@me/meals</a> HTTP/1.1
Host: jawbone.com 
Accept: application/json
Content-Type: multipart/form-data; boundary=9431149156168
--9431149156168
Content-Disposition: form-data; name="place_lat"
37.7726
--9431149156168
Content-Disposition: form-data; name="place_lon"
-122.4148
--9431149156168
	

Will return:

HTTP 201 Created
{
   “meta”:
   {
      “user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
      “message”: “OK”,
      “code”: 200
      "time": 1386122022
   },
   “data”:
   {
      "xid": "40F7_htRRnT8Vo7nRBZO1X",
      "title": "Something Good",
      "note": "Something Good",
      "type": "meal",
      "sub_type": 2,
      "time_created": 1384963500,
      "time_updated": 1385049599,
      "time_completed": 1385099220,
      "date": 20131121,
      "place_lat": "37.451572",
      "place_lon": "-122.184435",
      "place_acc": 10,
      "place_name": "Good Eats",
      "details": 
      {
         "num_drinks": 1, 
         "num_foods": 2, 
         "fiber": 0,
         "polyunsaturated_fat": 1.54,
         "potassium": 164.0, 
         "fat": 23.15, 
         "carbohydrate": 64.75, 
         "saturated_fat": 6, 
         "protein": 16.77, 
         "monounsaturated_fat": 5.773, 
         "sodium": 504.0, 
         "vitamin_c": 0, 
         "vitamin_a": 3.0, 
         "calories": 530.0, 
         "unsaturated_fat": 15.313, 
         "sugar": 19.0, 
         "calcium": 140.0, 
         "iron": 14.0, 
         "cholesterol": 50.0, 
         "accuracy": 20.0
         "tz": "America/Los_Angeles",
      }
   }   
}
	

Representation in UP app:

Note cropping on 640x440 image. Cropping on detail view eliminates sides of image so be sure to center important details per below. Each little square is 10x10 in images below.

At feed level:

At detail level:


Update a meal

URI Method Response Type Returns
/nudge/api/v.1.1/meals/{xid}/partialUpdate POST application/json Meal
Parameter Type Description
note string Title / description of the meal. Used as both title and note.
sub_type int Meal type. 1=Breakfast, 2=Lunch, 3=Dinner, 4=Pre-Workout, 5=Post-Workout, 6=Snack
image_url URI URI of the meal image
photo binary Binary contents of the meal image
place_lat float Latitude of the location where the meal was created
place_lon float Longitude of the location where the meal was created
place_acc float Accuracy (meters) of the location where the meal was created
place_name string Name of the location where the meal was created
time_created int Unix timestamp when the meal was created
tz string Time zone when this event was generated. Whenever possible, Olson format (e.g., "America/Los Angeles") will be returned, otherwise the GMT offset (e.g., "GMT+0800") will be returned.
share boolean Set whether to share event on user's public feed. Will not override if user's privacy setting is set to not share.
items JSON-encoded list See Item Property below
Item property Type Description
name string Name of the meal item
description string Description of the meal item
amount float Amount of "measurement" (e.g. 100)
measurement String Unit of measurement (e.g. grams)
type int Quantity size by container. 1=Plate, 2=Cup, 3=Bowl, 4=Scale, 5=Glass
sub_type int Type of food. 1=Drink, 2=Food
category string Category name (free text)
food_type int 1=Generic, 2=Restaurant, 3=Brand, 4=Personal
calcium int Calcium (in milligrams)
calories int Calories
carbohydrate float Carbohydrate content (in grams)
cholesterol float Cholesterol content (in milligrams)
fiber float Fiber content (in grams)
protein float Protein content (in grams)
saturated_fat float Saturated fat content (in grams)
sodium float Sodium content (in milligrams)
sugar float Sugar content (in grams)
unsaturated_fat float Unsaturated fat content (in grams)
caffeine float Caffeine content (in milligrams)

Example:

POST <a href="https://jawbone.com/nudge/api/v.1.1/meals/{xid}/partialUpdate">https://jawbone.com/nudge/api/v.1.1/meals/{xid}/partialUpdate</a> HTTP/1.1
Host: jawbone.com
Accept: application/json
Content-Type: multipart/form-data; boundary=9431149156168
--9431149156168
Content-Disposition: form-data; name="place_lat"
37.7726
--9431149156168
Content-Disposition: form-data; name="place_lon"
-122.4148
--9431149156168
Content-Disposition: form-data; name="photo"; filename="MyFilename.jpg"
Content-Type: image/jpeg
file_content
--9431149156168--
	

Will return:

HTTP 200 OK
{
   “meta”:
   {
      “user_xid”: “6xl39CsoVp2KirfHwVq_Fx”,
      “message”: “OK”,
      “code”: 200
      "time": 1386122022
   },
   “data”:
   {
      "xid": "40F7_htRRnT8Vo7nRBZO1X",
      "title": "Something Good",
      "note": "Something Good",
      "type": "meal",
      "sub_type": 2,
      "time_created": 1384963500,
      "time_updated": 1385049599,
      "time_completed": 1385099220,
      "date": 20131121,
      "place_lat": "37.451572",
      "place_lon": "-122.184435",
      "place_acc": 10,
      "place_name": "Good Eats",
      "details": 
      {
         "num_drinks": 1, 
         "num_foods": 2, 
         "fiber": 0,
         "polyunsaturated_fat": 1.54,
         "potassium": 164.0, 
         "fat": 23.15, 
         "carbohydrate": 64.75, 
         "saturated_fat": 6, 
         "protein": 16.77, 
         "monounsaturated_fat": 5.773, 
         "sodium": 504.0, 
         "vitamin_c": 0, 
         "vitamin_a": 3.0, 
         "calories": 530.0, 
         "unsaturated_fat": 15.313, 
         "sugar": 19.0, 
         "calcium": 140.0, 
         "iron": 14.0, 
         "cholesterol": 50.0, 
         "accuracy": 20.0
         "tz": "America/Los_Angeles",
      }
   }   
}
	

Delete a single meal event.

Deletes an existing meal event. The event must have been created by the partner for this call to succeed.
URI Method Response Type Returns
/nudge/api/v.1.1/meals/{xid} DELETE application/json Status

Example:

DELETE <a href="https://jawbone.com/nudge/api/v.1.1/meals/0ac1wXjUAYQ">https://jawbone.com/nudge/api/v.1.1/meals/0ac1wXjUAYQ</a> HTTP/1.1
Host: jawbone.com
Content-Type: application/x-www-form-urlencoded
	

Will return:

HTTP 200 OK
{
    "meta": {
        "user_xid": "V6p0-s4-qIo",
        "message": "OK",
        "code": 200,
        "time": 1351121565
    },
    "data": {}
}