Make your product
work with UP.

Goals

Get the user goals

Returns the goals the user has set for UP. Currently takes no parameters and is read only.

Goal data returned is controlled by the scopes meal_read, sleep_read, weight_read, and move_read. The returned result will be filtered based on the scope that user token has for your application. For example if your token only has the scope sleep_read then only the sleep goal data will be returned. If the token has all scopes then the complete goal data set will be returned.

Note: Currently our API contains legacy values for nutrients (eat_sodium, eat_fiber, etc). As these are not in active use by our users these will be removed from our API soon and should not be used.

URI Method Response Type Returns
/nudge/api/v.1.1/users/@me/goals GET application/json Goals

Example:

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

Will return:

HTTP 200 OK
{
   "meta": 
   {
      "user_xid": "6xl39CsoVp2KirfHwVq_Fx",
      "message": "OK",
      "code": 200
      "time": 1382377526
   },
   "data":
   {
      "move_steps": 10000,
      "sleep_total": 25200,
      "body_weight": 81.64,
      "body_weight_intent": 0,
      "remaining_for_day": {
         "intake_calories_remaining": 2282.92267249,
         "move_steps_remaining": 7927,
         "sleep_seconds_remaining": -3419
      }
   }
}
	
Data Value Type Description
move_steps int Number of steps per day goal.
sleep_total int Sleep goal, in seconds.
body_weight float Body weight goal.
body_weight_intent int User's intent for weight management. 0=lose, 1=maintain, 2=gain
intake_calories_remaining float Number of calories available for the user to consume for today, in order to achieve their weight goal. If negative, the user has already went over the limit by that amount.
move_steps_remaining int Number of steps remaining for today for user to achieve their step goal. If negative, the user has already surpassed their goal for today by that number of steps.
sleep_seconds_remaining int Number of seconds the user must sleep for today in order to achieve their sleep gaol. If negative, the user has already surpassed their goal for today by that number of seconds.

Create/Update a user goal.

Updates the user goal. Note your app must have the correct scope to update the respective goal (steps=move_write, sleep=sleep_write, and weight=body_write). 200 will be returned on success (no data).

URI Method Response Type Returns
/nudge/api/v.1.1/users/@me/goals POST application/json Goal
Parameter Type Description
move_steps int Move gaol per day in number of steps. Need scope move_write.
sleep_total int Sleep goal per day in seconds. Need scope sleep_write.
body_weight float Body weight goal. MUST be in metric (kg). Need scope body_write.
body_weight_intent int User's desired weight management intent. 0=lose, 1=maintain, 2=gain. Can also use equivalent string instead of int. Need scope body_write.

Example:

POST https://jawbone.com/nudge/api/v.1.1/users/@me/goals HTTP/1.1
Host: jawbone.com 
Content-Type: application/x-www-form-urlencoded
body_weight=85&body_weight_intent=0
	

Will return:

HTTP 200 Created
{
   "meta": 
   {
      "user_xid": "6xl39CsoVp2KirfHwVq_Fx",
      "message": "OK",
      "code": 200
      "time": 1382377526
   },
  “data”:
   {
   }
}