Make your product
work with UP.

Pub Sub

A partner app can register a webhook url in order to receive callbacks for user events.

NOTE: The Jawbone platform, and the pub sub implementation, is a best effort solution. This means that our API is provided "as is" and "as available.” We strive to maintain excellent service at all times and we're always working to improve infrastructure. We'll always keep http://status.jawbone.com/ updated with any notices/changes as soon as we are aware of them. For more information, please review our Terms of Service: https://jawbone.com/up/developer/terms.

Callbacks are made only in the context of users who have authorized the partner app for data access. Events will be be returned if they fall under the data scope that has been requested by the partner application during OAuth. When on of these events is created/updated/deleted, a notification is queued to be posted to the registered webhook.

Webhook URL is set on the application configuration page. Setting a webhook url will enable the callback notification process for your application. Notifications will be POSTed to your webhook with the notification JSON (see below) in the body under the "file" parameter.

The webhook must return a 200 response code on receiving a callback successfully. If the callback to webhook does not result in a successful response, two additional retries will be attempted. A notification is dropped after three tries.

A list of events that have been effected will be sent. Note that these events will not be time ordered.

We are including a secret hash with each notification so you can confirm it came from Jawbone. The secret hash is a SHA-256 of the concatenated string of your client ID followed by the app secret.

Sample JSON payload expected with callback. Currently only one notification is sent per payload but that could change in the future.

{
    "notification_timestamp": "1372787949",
    "events": [
        {
            "user_xid": "RGaCBFg9CsB83FsEcMY44A",
            "event_xid": "EJpCkyAtwoO0XTdkYyuTNw",
            "type": "move",
            "action": "creation" , 
            "timestamp": "1372787849"
        },
        {
            "user_xid": "RGaCBFg9CsB83FsEcMY44A",
            "event_xid": "blaHyAtwoO0XTdkYyuTNw",
            "type": "sleep",
            "action": "updation" , 
            "timestamp": "1372787859"
        }
    ],
    "secret_hash": "e570b3071a0964f9e2e69d13nd9ba19535392aaa",
}

Note: notification_timestamp is when the notification was triggered. The event timestamp is when the event was created or last updated.

For our UP24 and UP Move trackers, button presses will be sent. These notifications just indicate the button/mode has been activiated. The actual event will also be sent as a separate notification. For example, if the user logs a sleep with the UP24 band, you would receive 3 notifications: 1 for the enter sleep mode button press, 1 for the exit sleep mode button press, and 1 for the creation of the actual sleep event on the system.

See UP24 section below for more use cases.

Sample band event notification payload. Note there is no type.

{   
    "notification_timestamp":1379364954,
    "events":[
          {
             "action":"enter_sleep_mode",
             "timestamp":1379364951,
             "user_xid":"RGaCBFg9CsB83FsEcMY44A"
          }
    ],
    "secret_hash":"e570b3071a0964f9e2e69d13nd9ba19535392aaa"
}

Callbacks are also made when a user disconnects the partner application.

Sample user disconnection notification payload:

{   
    "notification_timestamp":1379364954,
    "events":[
          {
             "action":"deletion",
             "timestamp":1379364951,
             "user_xid":"RGaCBFg9CsB83FsEcMY44A",
             "type":"user_app_connection"
          }
    ],
    "secret_hash":"e570b3071a0964f9e2e69d13nd9ba19535392aaa"
}

Callbacks are also made when a user requests their data to be deleted. Per our Terms of Service, all user data directly received from Jawbone must be deleted when you receive this notification.

Sample user data deletion notification payload:

{   
    "notification_timestamp":1379364954,
    "events":[
          {
             "action":"require_action",
             "timestamp":1379364951,
             "user_xid":"RGaCBFg9CsB83FsEcMY44A",
             "type":"user_data_deletion"
          }
    ],
    "secret_hash":"e570b3071a0964f9e2e69d13nd9ba19535392aaa"
}

All notification events

Notification Type Actions Description
move creation, updation, deletion Move event from user. Only one per day but updates frequently so you will receive a single creation per day but many updations.
sleep creation, updation, deletion Sleep event from user.
body creation, updation, deletion Body event from user.
workout creation, updation, deletion Workout logged by user.
generic creation, updation, deletion Custom event created for user.
meal creation, updation, deletion Meal created by user.
mood creation, updation, deletion Mood logged by user.
user_app_connection deletion When a user has manually disconnected your application via UP. When this event is received you should invalidate the user token/connection on your side.
user_data_deletion require_action User has requested their data be deleted from UP. According to our Terms of Service, all user data directly received from Jawbone must be deleted when you receive this notification.
Band Button Press (no type) enter_stopwatch_mode When user double presses the UP band button to log a workout. These events will only be sent if the user has a valid connection to phone at the time of the button press. UP24 and UP Move only.
Band Button Press (no type) exit_stopwatch_mode When user single presses the UP band button to come out of workout mode. These events will only be sent if the user has a valid connection to phone at the time of the button press. UP24 and UP Move only.
Band Button Press (no type) enter_sleep_mode When user long presses the UP band button to log a sleep. These events will only be sent if the user has a valid connection to phone at the time of the button press. UP24 and UP Move only.
Band Button Press (no type) exit_sleep_mode When user long presses the UP band button to come out of sleep mode. These events will only be sent if the user has a valid connection to phone at the time of the button press. UP24 and UP Move only.

Programmable Webhooks

The API allows a partner to programmatically register a webhook for a specific user. Once a user specific webook is registered all further notifications related to said user will be routed to the user webhook and will override the app level webhook (if present). User specific and app level webhook can coexist (in other words, all notifications for users not registered with a specific webhook will be sent to the app level webhook as set on your portal application configuration page).

This will also automatically enable Pub Sub the first time a programmable webhook is set.

To create a user specific webhook:

POST https://jawbone.com/nudge/api/v.1.1/users/@me/pubsub?webhook={webhook url for user} HTTP/1.1

To delete a user specific webhook:

DELETE https://jawbone.com/nudge/api/v.1.1/users/@me/pubsub HTTP/1.1

UP24 and UP Move Notifications

When using UP24 or UP Move, notifications are sent on a frequent basis, and specific events trigger notifications, as follows:

  1. A move event will be created each day when user first wears the band or ends sleep mode, and updates will be sent frequently while connected.
  2. A pub/sub notification is fired when user begins and ends sleep mode with a button push. There is no sleep event formally created until the sleep is complete (see below). This event will only be captured if the band is connected via bluetooth, otherwise it will not be sent.
  3. Sleep event will be created when user ends sleep mode by button push or when the band detects the user has tracked steps.
  4. A pub/sub notification is fired when user begins and ends a workout with a button push. There is no workout event formally created until the workout is completed (see below). This event will only be captured if the band is connected via bluetooth, otherwise it will not be sent.
  5. Workout event logged by band stopwatch (button press) will only be sent when completed by user via the second button press.
  6. Workout event manually logged by user on UP app or by 3rd party app.
  7. Meal event manually logged by user on UP app or by 3rd party app.
  8. Weight change by 3rd party app.
  9. Custom (generic) events sent by 3rd party app