Make your product
work with UP.

Generic

Get a generic event for the user

Returns the list of generic events of the current user. This list can be paginated by date or timestamp.
URI Method Response Type Returns
/nudge/api/users/@me/generic_events GET application/json Generic
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 events. 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.
limit int Maximum number of results to return

Example:

GET https://jawbone.com/nudge/api/v.1.0/users/@me/generic_events?page_token=1335074239 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": "Sunset today at November 21st, 2013 at 4:49PM",
         "type": "generic",
         "time_created": 1384963500,
         "time_updated": 1385049599,
         "date": 20131121,
         "place_lat": "37.451572",
         "place_lon": "-122.184435",
         "place_acc": 10,
         "place_name": "Work",
         "image": "/nudge/image/d/770eca483cd211e3910e22000a1fb6b5_image.png",
         "attributes": 
         {
            "description": "My local sunset time"
         }
         "details": 
         {
            "tz": "America/Los_Angeles"
         }
      },
      {
      ... more items ....
      }],
      "links": 
      {
         "next": "/nudge/api/v.1.0/users/6xl39CsoVp2KirfHwVq_Fx/generic_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 generic event
type string Type of event, in this case a generic event.
time_created int Epoch timestamp when this generic event was created.
time_updated int Epoch timestamp when this generic event was updated.
date int Date when this generic event was created, formatted as YYYYMMDD.
place_lat float Latitude of location where generic event was logged.
place_lon float Longitude of location where generic event was logged.
place_acc int Accuracy of location where generic event was logged, in meters.
place_name string Name of location where generic event was logged.
image URI Link to the image of this generic event (relative, add prefix https://jawbone.com)
attributes JSON list JSON list of attributes submitted by 3rd party partner.
tz int Time zone when this body event was logged, Olson format.
size int Number of items in this list.
next URI Link to next page of data (relative, add https://jawbone.com as prefix).

Creates a new generic event.

Generic event is recommended as a means to post app specific user actions to the user's feed.
URI Method Response Type Returns
/nudge/api/users/@me/generic_events POST application/json Generic
Parameter Type Description
title string Name of the event (used in the feed story).
verb string Verb to indicate user action (used in the feed story).
attributes json Set of attributes associated with the event (for partner data only, not exposed in feed).
note string Description of the event
image_url URI URI of the event's image
place_lat float Latitude of the location where the event was created
place_lon float Longitude of the location where the event was created
place_acc float Accuracy (meters) of the location where the event was created
place_name string Name of the location where the event was created
time_created int Unix timestamp when the event was created
tz string Time zone where the event was created

Example:

POST https://jawbone.com/nudge/api/v.1.0/users/@me/generic_events HTTP/1.1
Host: jawbone.com 
Content-Type: application/x-www-form-urlencoded
title=A feed post&image_url=http://site.com/image.png;verb=did;attributes={"description": "ran the Chicago marathon"}
	

Will return:

HTTP 201 Created
{
 "meta": 
    {
    "user_xid": "b9yCLa3f01yf",
    "message": "OK",
    "code": 200
    "time": 1351647790
  },
 "data":
    {
    "xid": "Oqsd3as33r",
    "title": "Earned 10 points",
    "image": "http://example.com/image.png",
    "time_created": 1351647790,
    "date": 20121030,
    "attributes": {
        "description": "ran the Chicago marathon"
     }
  }
}
	

Update a generic event

URI Method Response Type Returns
/nudge/api/generic_events/{xid}/partialUpdate POST application/json Generic
Parameter Type Description
title string Name of the event (used in the feed story).
verb string Verb to indicate user action (used in the feed story).
attributes json Set of attributes associated with the event (for partner data only, not exposed in feed).
note string Description of the event
image_url URI URI of the event's image
place_lat float Latitude of the location where the event was created
place_lon float Longitude of the location where the event was created
place_acc float Accuracy (meters) of the location where the event was created
place_name string Name of the location where the event was created
time_created int Unix timestamp when the event was created
tz string Time zone where the event was created

Example:

POST https://jawbone.com/nudge/api/v.1.0/generic_events/Oqsd3as33r/partialUpdate HTTP/1.1
Host: jawbone.com 
Content-Type: application/x-www-form-urlencoded
image_url=http://site.com/MyNewImage.png;verb=mynewverb;
	

Will return:

HTTP 200 OK
{
 "meta": 
    {
    "user_xid": "b9yCLa3f01yf",
    "message": "OK",
    "code": 200
    "time": 1351647790
  },
 "data":
    {
    "xid": "Oqsd3as33r",
    "title": "Earned 10 points",
    "image": "http://example.com/MyNewImage.png",
    "time_created": 1351647790,
    "date": 20121030,
    "attributes": {
        "description": "ran the Chicago marathon"
     }
  }
}
	

Delete a generic event.

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

Example:

DELETE https://jawbone.com/nudge/api/v.1.0/generic_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": "OK",
        "code": 200,
        "time": 1351121565
    },
    "data": {}
}