Make your product
work with UP.

Body

Get body composition metrics record events for a user.

Returns the user's body measurements. Primarily weight but can also include body fat, bmi, and lean mass. A body event will be generated whenever a user logs weight via the UP app or a partner app.

NOTE 7/11/14: Weight will now be a required value when writing body events and images have been removed. The UP weight graph will be used at the detail level instead (see picture below).

URI Method Response Type Returns
/nudge/api/v.1.1/users/@me/body_events GET application/json Collection>Body
Parameter Type Description
date string Date, formatted as YYYYMMDD.
page_token int Timestamp used to paginate the list of sleeps. 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 have been updated later than the timestamp.
limit int Maximum number of results to return

Example:

GET https://jawbone.com/nudge/api/v.1.1/users/@me/body_events HTTP/1.1
Host: jawbone.com
	

Will return:

HTTP 200 OK
{
   "meta": 
   {
      "user_xid": "6xl39CsoVp2KirfHwVq_Fx",
      "message": "OK",
      "code": 200
      "time": 1382377526
   },
  “data”:
   {
      "items": 
      [{
         "xid": "40F7_htRRnT8Vo7nRBZO1X",
         "title": "Measurement from Nov 21st",
         "type": "body",
         "time_created": 1384963500,
         "time_updated": 1385049599,
         "date": 20131121,
         "place_lat": "37.451572",
         "place_lon": "-122.184435",
         "place_acc": 10,
         "place_name": "Gym",
         "note": "My Weight",
         "lean_mass": 35,
         "weight": 75,
         "body_fat": 13,
         "bmi": 18,
         "details": 
         {
            "tz": "America/Los_Angeles"
         }
      },
      {
      ... more items ....
      }],
      "links": 
      {
         "next": "/nudge/api/v.1.1/users/6xl39CsoVp2KirfHwVq_Fx/body_events?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 body event
type string Type of event, in this case a body event.
time_created int Epoch timestamp when this body event was created.
time_updated int Epoch timestamp when this body event was updated.
date int Date when this body event was created, formatted as YYYYMMDD.
place_lat float Latitude of location where body event was logged.
place_lon float Longitude of location where body event was logged.
place_acc int Accuracy of location where body event was logged, in meters.
place_name string Name of location where body event was logged.
Note string Note on this body event
lean_mass float Lean mass percentage
Weight float Body weight in kilograms.
body_fat float Body fat percentage.
bmi float Body mass index.
tz int 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.
next URI Link to next page of data (relative, add https://jawbone.com as prefix).

Get a single body composition metric event.

URI Method Response Type Returns
/nudge/api/v.1.1/body_events/{event_xid} GET application/json Body

Example:

GET https://jawbone.com/nudge/api/v.1.1/body_events/0ac1wXjUAYQ HTTP/1.1
Host: jawbone.com
	

Will return:

HTTP 200 OK
{
   "meta": 
   {
      "user_xid": "6xl39CsoVp2KirfHwVq_Fx",
      "message": "OK",
      "code": 200
      "time": 1382377526
   },
  “data”:
   {
      "xid": "40F7_htRRnT8Vo7nRBZO1X",
      "title": "Measurement from Nov 21st",
      "type": "body",
      "time_created": 1384963500,
      "time_updated": 1385049599,
      "date": 20131121,
      "place_lat": "37.451572",
      "place_lon": "-122.184435",
      "place_acc": 10,
      "place_name": "Gym",
      "note": "My Weight",
      "lean_mass": 35,
      "weight": 75,
      "body_fat": 13,
      "bmi": 18,
      "details": 
      {
         "tz": "America/Los_Angeles"
      }
   }
}
	

Creates a new user event to record body composition metrics.

Submitting user weight is required when writing a body event (can no longer submit only bmi/lean mass/body fat without weight). If you need to write one of the other values and don't have an update for the user's current weight, you should read the last event and write that weight when posting a new body event.

URI Method Response Type Returns
/nudge/api/v.1.1/users/@me/body_events POST application/json Body
Parameter Type Description
title string Title of the event.
weight float Body weight in kilograms. REQUIRED.
body_fat float Body fat percentage.
lean_mass float Lean mass percentage. Not exposed to user on UP.
bmi float Body Mass Index. Not exposed to user on UP.
note string Notes associated with the event.
time_created int Unix timestamp when the event was recorded.
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.

Example:

POST https://jawbone.com/nudge/api/v.1.1/users/@me/body_events HTTP/1.1
Host: jawbone.com 
Content-Type: application/x-www-form-urlencoded
title=Measurements on Oct 24&image_url=http://site.com/image.png& weight=75&lean_mass=35&bmi=18&body_fat=13
	

Will return:

HTTP 201 Created
{
   "meta": 
   {
      "user_xid": "6xl39CsoVp2KirfHwVq_Fx",
      "message": "OK",
      "code": 200
      "time": 1382377526
   },
  “data”:
   {
      "xid": "40F7_htRRnT8Vo7nRBZO1X",
      "title": "Measurements on Oct 24",
      "type": "body",
      "time_created": 1384963500,
      "time_updated": 1385049599,
      "date": 20131024,
      "place_lat": null,
      "place_lon": null,
      "place_acc": 0,
      "place_name": "",
      "note": null,
      "lean_mass": 35,
      "weight": 75,
      "body_fat": 13,
      "bmi": 18,
      "details": 
      {
         "tz": null
      }
   }
}
	

Representation in UP app:

At feed level:

At detail level:


Delete a single Body metric event.

Deletes an existing 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/body_events/{event_xid} DELETE application/json Status

Example:

DELETE https://jawbone.com/nudge/api/v.1.1/body_events/0ac1wXjUAYQ 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": "Body composition event data with xid 0ac1wXjUAYQ was removed",
      "code": 200,
      "time": 1351121565
   },
   "data": {}
}