BobAPI - a personal API

 

"All Bob's Data Are Belong To You." [1]

Hi, I'm Bob. BobAPI is a personal data warehouse of my self-tracking data, which I am making available via a personal API.

You can learn more about my motivation for building BobAPI here.

Personal API Documentation

This is still very much a work in progress, so this information is subject to change. Your mileage may vary :)

 

Authorization


Request Client Credentials

BobAPI uses OAuth, which requires obtaining a valid access token. This is then used to authorize API requests. At this time, you'll need to contact me for access and I will set you up with client OAuth credentials.

 

Obtain OAuth Token

POST https://api.bobapi.com/v1/oauth/token

 

For simplicity, use a "client credentials" grant type. The response will contain an access token and refresh token.

Example Request:

curl -i -H "Content-Type: application/json" \
  -X POST https://api.bobapi.com/v1/oauth/token \
  -u CLIENT_ID:CLIENT_SECRET \
  -d '{"grant_type": "client_credentials"}'

Response:

{
 "access_token": "TsT5OjbzRn431zqMLgV3Ib",
 "refresh_token": "38doloxA4umeDZm4kVBDRr",
 "expires_in": 157766400,
 "token_type": "Bearer"
}

 

Refreshing Access Tokens

In the event an access token has expired, use the refresh token previously received to request a new access token:

Example Request:

curl -i -H "Content-Type: application/json" \
  -X POST https://api.bobapi.com/v1/oauth/token \
  -u CLIENT_ID:CLIENT_SECRET \
  -d '{"grant_type": "refresh_token", "refresh_token": REFRESH_TOKEN}'

 

Personal API Endpoints


Once you have a valid access token, you can use it to make requests to API endpoints using bearer tokens, i.e.:

curl -i https://api.bobapi.com/v1/users/bob/glucose \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib' 

Additionally, all measurement endpoints accept the following optional parameters:

Name     Value
limitSpecifies the number of records to retrieve. Example: "limit=10"
offsetSpecifies the starting record for results to return. Example: specifying "offset=0" will start offset from 0 record, "offset=4" will start offset from 4th record, etc
start_dateSpecifies starting date for results in YYYY-MM-DD format. Example: "start_date=2015-06-15"
end_dateSpecifies end date for results in YYYY-MM-DD format. Example: "end_date=2015-07-31"
start_timeSpecifies a start timestamp in UTC (YYYY-MM-DDTHH:MM:SS.00Z) format
end_timeSpecifies an end timestamp in UTC (YYYY-MM-DDTHH:MM:SS.00Z) format
sourceReturns results only for specific source. Example: "source=withings"

 

Profile API


Summary Info

GET https://api.bobapi.com/v1/users/bob

 

Returns profile and latest summary measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/ \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "username": "bob",
 "name": "Bob T",
 "tz": "America/New_York",
 "gender": "m",
 "age": 44,
 "height": "71.5",
 "heightUnits": "in",
 "weight": "169.8",
 "weightUnits": "lb",
 "bodyfat": "19.8",
 "bodyfatUnits": "%"
}

Back to top

 

Blood Oxygen (SPO2) API


Blood Oxygen List

GET https://api.bobapi.com/v1/users/bob/bloodoxygens

 

Returns all blood oxygen (SPO2) measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/bloodoxygens/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57b7688472e175b9e5f7f3d1",
   "ts": "2016-03-24T02:00:00.000Z",
   "tz": "America/New_York",
   "value": 99,
   "units": "%",
   "sourceId": "FaceLake Pulse Oximeter",
   "notes": "Reading taken after workout",
   "createdAt": "2016-08-19T20:13:56.756Z",
   "updatedAt": "2016-08-19T20:13:56.756Z"
 },
 ...
]

Back to top

 

Blood Oxygen (SPO2) Detail

GET https://api.bobapi.com/v1/users/bob/bloodoxygens/:id

GET https://api.bobapi.com/v1/users/bob/bloodoxygens/latest

 

Returns a specific (or latest) blood oxygen (SPO2) measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/bloodoxygens/53b7604272e175b4e5f7ef09 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "53b7604272e175b4e5f7ef09",
 "ts": "2016-03-24T02:00:00.000Z",
 "tz": "America/New_York",
 "value": 99,
 "units": "%",
 "sourceId": "FaceLake Pulse Oximeter",
 "notes": "Reading taken after workout",
 "createdAt": "2016-08-19T20:13:56.756Z",
 "updatedAt": "2016-08-19T20:13:56.756Z"
}        

Back to top

 

Blood Pressures API


Blood Pressures List

GET https://api.bobapi.com/v1/users/bob/bloodpressure

 

Returns all blood pressure measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/bloodpressures/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57b7688472e175b9e5f7f2ba",
   "ts": "2012-12-30T14:26:00.000Z",
   "tz": "America/New_York",
   "systolic": 128,
   "systolicUnits": "mmHg",
   "diastolic": 71,
   "diastolicUnits": "mmHg",
   "sourceId": "withings",
   "notes": "Reading taken at home, before lunch",
   "createdAt": "2016-08-19T20:13:56.157Z",
   "updatedAt": "2016-08-19T20:13:56.157Z"
 },
 ...
]

Back to top

 

Blood Pressure Detail

GET https://api.bobapi.com/v1/users/bob/bloodpressures/:id

GET https://api.bobapi.com/v1/users/bob/bloodpressures/latest

 

Returns a specific (or latest) blood pressure measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/bloodpressures/53b7604272e175b4e5f7ef09 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "53b7604272e175b4e5f7ef09",
 "ts": "2012-12-30T14:26:00.000Z",
 "tz": "America/New_York",
 "systolic": 128,
 "systolicUnits": "mmHg",
 "diastolic": 71,
 "diastolicUnits": "mmHg",
 "sourceId": "withings",
 "notes": "Reading taken at home, before lunch",
 "createdAt": "2016-08-19T20:13:56.157Z",
 "updatedAt": "2016-08-19T20:13:56.157Z"
}

Back to top

 

Galvanic Skin Response (GSR) API


Galvanic Skin Response (GSR) List

GET https://api.bobapi.com/v1/users/bob/gsrs

 

Returns all galvanic skin response (GSR) measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/gsrs/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57ee9ee2dd97fbe82c8017e3",
   "ts": "2016-08-05T09:54:00.000Z",
   "tz": "America/New_York",
   "value": 0.0000538,
   "units": "uS/cm",
   "type": "avg",
   "sourceId": "basis",
   "updatedAt": "2016-08-30T17:20:09.377Z",
   "createdAt": "2016-08-30T17:20:09.377Z"
 },
 ...
]

Back to top

 

Galvanic Skin Response (GSR) Detail

GET https://api.bobapi.com/v1/users/bob/gsrs/:id

GET https://api.bobapi.com/v1/users/bob/gsrs/latest

 

Returns a specific (or latest) galvanic skin response (GSR) measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/gsrs/53b7604272e175b4e5f7ef09 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
   "id": "57ee9ee2dd97fbe82c8017e3",
   "ts": "2016-08-05T09:54:00.000Z",
   "tz": "America/New_York",
   "value": 0.0000538,
   "units": "uS/cm",
   "type": "avg",
   "sourceId": "basis",
   "updatedAt": "2016-08-30T17:20:09.377Z",
   "createdAt": "2016-08-30T17:20:09.377Z"
}

Back to top

 

Glucose API


Glucose List

GET https://api.bobapi.com/v0/users/bob/glucose

 

Returns all glucose measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/glucose/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57c7688372e185b9e5f7f15d",
   "ts": "2013-09-09T12:11:00.000Z",
   "tz": "America/New_York",
   "value": 95,
   "units": "mg/dL",
   "type": "fasting",
   "notes": "Begin taking oxaloacetate",
   "sourceId": "Freestyle Lite",
   "createdAt": "2016-08-19T20:13:55.543Z",
   "updatedAt": "2016-08-19T20:13:55.543Z"
 },
 ...
]

Back to top

 

Glucose Detail

GET https://api.bobapi.com/v1/users/bob/glucose/:id

GET https://api.bobapi.com/v1/users/bob/glucose/latest

 

Returns a specific (or latest) glucose measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/glucose/57c7688372e185b9e5f7f15d \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57c7688372e185b9e5f7f15d",
 "ts": "2013-09-09T12:11:00.000Z",
 "tz": "America/New_York",
 "value": 95,
 "units": "mg/dL",
 "type": "fasting",
 "notes": "Begin taking oxaloacetate",
 "sourceId": "Freestyle Lite",
 "createdAt": "2016-08-19T20:13:55.543Z",
 "updatedAt": "2016-08-19T20:13:55.543Z"
}

Back to top

 

Heart Rate API


Heart Rate List

GET https://api.bobapi.com/v1/users/bob/heartrates

 

Returns all heart rate measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/heartrates/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57b7688472e175b9e5f7f2c0",
   "ts": "2014-12-15T12:45:00.000Z",
   "tz": "America/New_York",
   "value": 46,
   "units": "bpm",
   "type": "avg",
   "hrv": [
     {
       "lf": 1512,
       "rr": 1.255,
       "lfhf": 1.61,
       "score": 67,
       "duration": 180,
       "hf": 939,
       "method": "lying",
       "rmssd": 44
     }        
   ],
   "notes": "Reading taken upon waking",
   "sourceId": "sweetbeathrv",
   "updatedAt": "2016-08-19T20:13:56.161Z",
   "createdAt": "2016-08-19T20:13:56.161Z",
 },
 {
   "id": "57acebd372e175b9e5f7703e",
   "ts": "2014-12-16T11:21:00.000Z",
   "tz": "America/New_York",
   "value": 48.54,
   "units": "bpm",
   "type": "avg",
   "hrv": [
     {
       "lf" : 0.024,
       "hf" : 0.0298,
       "sdnn" : 73.32,
       "rmssd" : 38.08
       "pnn50" : 16.28,
       "lfhf" : 0.8,
       "avnn" : 1226.14,
       "score" : 7.37,
       "duration" : 1
     }
   ],
   "notes": "fast day 4",
   "sourceId": "hrv4training",
   "createdAt": "2016-08-19T20:13:56.161Z",
   "updatedAt": "2016-08-19T20:13:56.161Z"
 },
 ...
]

Back to top

 

Heart Rate Detail

GET https://api.bobapi.com/v1/users/bob/heartrates/:id

GET https://api.bobapi.com/v1/users/bob/heartrates/latest

 

Returns a specific (or latest) heart rate measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/heartrates/53b7604272e175b4e5f7ef09 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57acebd372e175b9e5f7703e",
 "ts": "2014-12-16T11:21:00.000Z",
 "tz": "America/New_York",
 "value": 48.54,
 "units": "bpm",
 "type": "avg",
 "hrv": [
   {
     "lf" : 0.024,
     "hf" : 0.0298,
     "sdnn" : 73.32,
     "rmssd" : 38.08
     "pnn50" : 16.28,
     "lfhf" : 0.8,
     "avnn" : 1226.14,
     "score" : 7.37,
     "duration" : 1
   }
 ],
 "notes": "fast day 4",
 "sourceId": "hrv4training",
 "createdAt": "2016-08-19T20:13:56.161Z",
 "updatedAt": "2016-08-19T20:13:56.161Z"
}

Back to top

 

Ketones API


Ketones List

GET https://api.bobapi.com/v0/users/bob/ketones

 

Returns all ketone measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/ketones/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57b7688472e175b9e5f7f3ca",
   "ts": "2013-09-09T12:11:00.000Z",
   "tz": "America/New_York",
   "value": 3.7,
   "units": "mmol/L",
   "sourceId": "Precision Xtra",
   "notes": "Fasting Mimicking Diet experiment day 3",
   "createdAt": "2016-08-19T20:13:56.752Z",
   "updatedAt": "2016-08-19T20:13:56.752Z"
 },
 ...
]

Back to top

 

Ketone Detail

GET https://api.bobapi.com/v1/users/bob/ketones/:id

GET https://api.bobapi.com/v1/users/bob/ketones/latest

 

Returns a specific (or latest) ketone measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/ketones/57c7688372e185b9e5f7f15d \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57b7688472e175b9e5f7f3ca",
 "ts": "2013-09-09T12:11:00.000Z",
 "tz": "America/New_York",
 "value": 3.7,
 "units": "mmol/L",
 "sourceId": "Precision Xtra",
 "notes": "Fasting Mimicking Diet experiment day 3",
 "createdAt": "2016-08-19T20:13:56.752Z",
 "updatedAt": "2016-08-19T20:13:56.752Z"
}

Back to top

 

pH API


pH List

GET https://api.bobapi.com/v0/users/bob/ph

 

Returns all pH measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/ph/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57b7688472e175b9e5f7f292",
   "ts": "2016-01-12T12:30:00.000Z",
   "tz": "America/New_York",
   "value": 6.25,
   "type": "urine",
   "sourceId": "test strip",
   "createdAt": "2016-08-19T20:13:56.063Z",
   "updatedAt": "2016-08-19T20:13:56.063Z"
 },
 ...
]

Back to top

 

pH Detail

GET https://api.bobapi.com/v1/users/bob/ph/:id

GET https://api.bobapi.com/v1/users/bob/ph/latest

 

Returns a specific (or latest) pH measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/ph/57c7688372e185b9e5f7f15d \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57b7688472e175b9e5f7f292",
 "ts": "2016-01-12T12:30:00.000Z",
 "tz": "America/New_York",
 "value": 6.25,
 "type": "urine",
 "sourceId": "test strip",
 "createdAt": "2016-08-19T20:13:56.063Z",
 "updatedAt": "2016-08-19T20:13:56.063Z"
}

Back to top

 

Temperatures API


Temperatures List

GET https://api.bobapi.com/v0/users/bob/temperatures

 

Returns all temperature measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/temperatures/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57b7688472e175b9e5f7f444",
   "ts": "2015-02-27T13:14:00.000Z",
   "tz": "America/New_York",
   "value": 98.2,
   "units": "F",
   "type": "oral",
   "sourceId": "kinsa",
   "notes": "Basal reading",
   "createdAt": "2016-08-19T20:13:56.961Z",
   "updatedAt": "2016-08-19T20:13:56.961Z"
 },
 ...
]

Back to top

 

Temperature Detail

GET https://api.bobapi.com/v1/users/bob/temperatures/:id

GET https://api.bobapi.com/v1/users/bob/temperatures/latest

 

Returns a specific (or latest) temperature measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/temperatures/57c7688372e185b9e5f7f15d \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57b7688472e175b9e5f7f444",
 "ts": "2015-02-27T13:14:00.000Z",
 "tz": "America/New_York",
 "value": 98.2,
 "units": "F",
 "type": "oral",
 "sourceId": "kinsa",
 "notes": "Basal reading",
 "createdAt": "2016-08-19T20:13:56.961Z",
 "updatedAt": "2016-08-19T20:13:56.961Z"
}

Back to top

 

Weights API


Weights List

GET https://api.bobapi.com/v1/users/bob/weights

 

Returns all weight measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/weights/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "53b7604272e175b4e5f7ef09"
   "ts": "2016-06-05T12:41:00.000Z",
   "tz": "America/New_York",
   "weight": 170.8,
   "weightUnits": "lb",
   "bodyfat": 20.9,
   "bodyfatUnits": "%",
   "leanMass": 79.1,
   "leanMassUnits": "%",
   "skeletalMuscleMass": 37.0,
   "skeletalMuscleMassUnits": "%",
   "bmi": 22.9,
   "bmiUnits": "kg/m2",
   "sourceId": "omron",
   "notes": "fasting mimicking diet",
   "createdAt": "2016-08-19T20:13:54.305Z",
   "updatedAt": "2016-08-19T20:13:54.305Z",
 },
 ...
]

Back to top

 

Weight Detail

GET https://api.bobapi.com/v1/users/bob/weights/:id

GET https://api.bobapi.com/v1/users/bob/weights/latest

 

Returns a specific weight measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/weight/53b7604272e175b4e5f7ef09 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "58b7688272e145b9e4f7ef17"
 "ts": "2013-02-07T12:41:00.000Z",
 "tz": "America/New_York",
 "weight": 175.6,
 "weightUnits": "lb",
 "bodyfat": 22.6,
 "bodyfatUnits": "%",
 "leanMass": 77.4,
 "leanMassUnits": "%",
 "skeletalMuscleMass": 36.1,
 "skeletalMuscleMassUnits": "%",
 "bmi": 24.4,
 "bmiUnits": "kg/m2",
 "notes": "Ate a late dinner!",
 "sourceId": "withings",
 "createdAt": "2016-08-19T20:13:54.305Z",
 "updatedAt": "2016-08-19T20:13:54.305Z",
}

Back to top

 

Activities API


Activities List

GET https://api.bobapi.com/v0/users/bob/activities

 

Returns all activity measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/activities/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57acbfc9899008df0083ce8b",
   "startTs": "2013-10-19T03:00:00.000Z",
   "startTz": "America/New_York",
   "endTs": "2013-10-19T03:14:28.000Z",
   "endTz": "America/New_York",
   "duration": 868,
   "distance": 771,
   "steps": 1215,
   "calories": 45,
   "type": "wlk",
   "trackPoints": [
     {
       "id": "57acbfc9899008df0083cec4",
       "lat": "40.7258626434",
       "lon": "-73.9690668521",
       "ts": "2013-10-19T03:00:00.000Z"
     },
     ...
   ],
   "sourceId": "moves",
   "notes": "Walking dog",
   "createdAt": "2016-08-11T18:11:21.201Z",
   "updatedAt": "2016-08-11T18:11:21.201Z"
 },
 ...
]

Back to top

 

Activity Detail

GET https://api.bobapi.com/v1/users/bob/activities/:id

 

Returns a specific activity measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/activities/57c7688372e185b9e5f7f15d \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57acbfc9899008df0083ce8b",
 "startTs": "2013-10-19T03:00:00.000Z",
 "startTz": "America/New_York",
 "endTs": "2013-10-19T03:14:28.000Z",
 "endTz": "America/New_York",
 "duration": 868,
 "distance": 771,
 "steps": 1215,
 "calories": 45,
 "type": "wlk",
 "trackPoints": [
   {
     "id": "57acbfc9899008df0083cec4",
     "lat": "40.7258626434",
     "lon": "-73.9690668521",
     "ts": "2013-10-19T03:00:00.000Z"
   },
   ...
 ],
 "sourceId": "moves",
 "notes": "Walking dog",
 "createdAt": "2016-08-11T18:11:21.201Z",
 "updatedAt": "2016-08-11T18:11:21.201Z"
}

Back to top

 

Locations API


Locations List

GET https://api.bobapi.com/v0/users/bob/locations

 

Returns all location measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/locations/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57acbfc8899008df0083ce74",
   "startTs": "2013-10-17T00:44:52.000Z",
   "startTz": "America/New_York",
   "endTs": "2013-10-17T02:14:29.000Z",
   "endTz": "America/New_York",
   "name": "Mccarren Park Soccer Pitch/Football Field & Running Track",
   "location": [
     {
       "lat": 40.7198758007751,
       "lon": -73.95146369934082
     }
   ],
   "type": "foursquare",
   "sourceId": "moves",
   "createdAt": "2016-08-11T18:11:20.073Z",
   "updatedAt": "2016-08-11T18:11:20.073Z"
 },
 ...
]

Back to top

 

Location Detail

GET https://api.bobapi.com/v1/users/bob/locations/:id

 

Returns a specific location measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/locations/57c7688372e185b9e5f7f15d \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57acbfc8899008df0083ce74",
 "startTs": "2013-10-17T00:44:52.000Z",
 "startTz": "America/New_York",
 "endTs": "2013-10-17T02:14:29.000Z",
 "endTz": "America/New_York",
 "name": "Mccarren Park Soccer Pitch/Football Field & Running Track",
 "location": [
   {
     "lat": 40.7198758007751,
     "lon": -73.95146369934082
   }
 ],
 "type": "foursquare",
 "sourceId": "moves",
 "createdAt": "2016-08-11T18:11:20.073Z",
 "updatedAt": "2016-08-11T18:11:20.073Z"
}

Back to top

 

Sleeps API


Sleeps List

GET https://api.bobapi.com/v0/users/bob/sleeps

 

Returns all sleep measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/sleeps/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57eec146dd97fbe82c9f5780",
   "startTs": "2015-03-22T09:06:00.000Z",
   "startTz": "America/New_York",
   "endTs": "2015-03-22T12:01:00.000Z",
   "endTz": "America/New_York",
   "deepMins": 42,
   "lightMins": 89,
   "remMins": 44,
   "unknownMins": 0,
   "interruptMins": 0,
   "totalMins": 175,
   "interruptions": 0,
   "tossTurns": 14,
   "quality": 94,
   "sourceId": "basis",
   "date": "2015-03-22",
   "events": [
     {
       "startTs": "2015-03-22T09:14:00.000Z",
       "startTz": "America/New_York",
       "endTs": "2015-03-22T09:14:00.000Z",
       "endTz": "America/New_York",
       "type": "toss_and_turn"
     },
     {
       "startTs": "2015-03-22T09:35:00.000Z",
       "startTz": "America/New_York",
       "endTs": "2015-03-22T09:35:00.000Z",
       "endTz": "America/New_York",
       "type": "toss_and_turn"
     },
     ...
   ],
   "stages": [
     {
       "totalMins": 37,
       "startTs": "2015-03-22T09:06:00.000Z",
       "startTz": "America/New_York",
       "endTs": "2015-03-22T09:43:00.000Z",
       "type": "light"
     },
     {
       "totalMins": 10,
       "startTs": "2015-03-22T09:43:00.000Z",
       "startTz": "America/New_York",
       "endTs": "2015-03-22T09:53:00.000Z",
       "type": "deep"
     },
     {
       "totalMins": 4,
       "startTs": "2015-03-22T09:53:00.000Z",
       "startTz": "America/New_York",
       "endTs": "2015-03-22T09:57:00.000Z",
       "type": "rem"
     },
     ...
   ],
   "createdAt": "2016-08-30T19:47:34.535Z",
   "updatedAt": "2016-08-30T19:47:34.535Z"
 },
 ...
]

Back to top

 

Sleep Detail

GET https://api.bobapi.com/v1/users/bob/sleeps/:id

GET https://api.bobapi.com/v1/users/bob/sleeps/latest

 

Returns a specific (or latest) sleep measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/sleeps/57c7688372e185b9e5f7f15d \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57eec146dd97fbe82c9f5780",
 "startTs": "2015-03-22T09:06:00.000Z",
 "startTz": "America/New_York",
 "endTs": "2015-03-22T12:01:00.000Z",
 "endTz": "America/New_York",
 "deepMins": 42,
 "lightMins": 89,
 "remMins": 44,
 "unknownMins": 0,
 "interruptMins": 0,
 "totalMins": 175,
 "interruptions": 0,
 "tossTurns": 14,
 "quality": 94,
 "sourceId": "basis",
 "date": "2015-03-22",
 "events": [
   {
     "startTs": "2015-03-22T09:14:00.000Z",
     "startTz": "America/New_York",
     "endTs": "2015-03-22T09:14:00.000Z",
     "endTz": "America/New_York",
     "type": "toss_and_turn"
   },
   {
     "startTs": "2015-03-22T09:35:00.000Z",
     "startTz": "America/New_York",
     "endTs": "2015-03-22T09:35:00.000Z",
     "endTz": "America/New_York",
     "type": "toss_and_turn"
   },
   ...
 ],
 "stages": [
   {
     "totalMins": 37,
     "startTs": "2015-03-22T09:06:00.000Z",
     "startTz": "America/New_York",
     "endTs": "2015-03-22T09:43:00.000Z",
     "type": "light"
   },
   {
     "totalMins": 10,
     "startTs": "2015-03-22T09:43:00.000Z",
     "startTz": "America/New_York",
     "endTs": "2015-03-22T09:53:00.000Z",
     "type": "deep"
   },
   {
     "totalMins": 4,
     "startTs": "2015-03-22T09:53:00.000Z",
     "startTz": "America/New_York",
     "endTs": "2015-03-22T09:57:00.000Z",
     "type": "rem"
   },
   ...
 ],
 "createdAt": "2016-08-30T19:47:34.535Z",
 "updatedAt": "2016-08-30T19:47:34.535Z"
}

Back to top

 

Steps API


Steps List

GET https://api.bobapi.com/v0/users/bob/steps

 

Returns all steps measurements.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/steps/?limit=50 \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

[
 {
   "id": "57ee8ec7dd97fbe82c821699",
   "ts": "2015-04-05T04:18:00.000Z",
   "tz": "America/New_York",
   "value": 132,
   "sourceId": "basis",
   "createdAt": "2015-04-30T15:24:07.227Z",
   "updatedAt": "2016-04-30T15:24:07.227Z"
 },
 ...
]

Back to top

 

Steps Detail

GET https://api.bobapi.com/v1/users/bob/steps/:id

GET https://api.bobapi.com/v1/users/bob/steps/:latest

 

Returns a specific (or latest) steps measurement.

Example Request:

curl -i https://api.bobapi.com/v1/users/bob/steps/57c7688372e185b9e5f7f15d \
  -H 'Authorization: Bearer TsT5OjbzRn431zqMLgV3Ib'

Response:

{
 "id": "57ee8ec7dd97fbe82c821699",
 "ts": "2015-04-05T04:18:00.000Z",
 "tz": "America/New_York",
 "value": 132,
 "sourceId": "basis",
 "createdAt": "2015-04-30T15:24:07.227Z",
 "updatedAt": "2016-04-30T15:24:07.227Z"
}

Back to top