General Measurements
Introduction
General measurements capture statistics about a user that do not fit into any other category. General measurements are grouped in reverse chronological order into a general measurement feed.
Feed
Because they can grow very large, feeds are divided into pages (by default, each page contains 25 entries). Each page contains links to the previous and next pages as well as the total number of entries across all pages.
Two representations of the feed exist:
- The old version, which lists each measurement individually; and,
- The new version, which groups measurements with similar timestamps into a single entry.
Both versions will be maintained for the foreseeable
future (i.e., changes made by applications using the old
version will be seen by applications using the new
version, and vice-versa). New applications are encouraged
to use the new version; old applications should migrate when
possible. To migrate an existing application, change
the value of the Accept header to reflect
the new content type when requesting a page of the feed
(the URI for the page is the same across versions).
This page describes the new representation. Documentation for the old version can be found here.
| Field | Type | Description |
|---|---|---|
size |
Integer |
The total number of entries across all pages |
items |
Item[] |
The entries in this page for the user, from newest to oldest |
previous |
String |
The URI of the previous page in the user's feed (omitted for the oldest page) |
next |
String |
The URI of the next page in the user's feed (omitted for the newest page) |
Past Entries
Past entries have the following structure:
| Field | Type | Description | Editable |
|---|---|---|---|
uri |
String |
The URI for this measurement set | N |
userID |
Integer |
The unique ID for the user | N |
timestamp |
String |
The timestamp (e.g., Sat, 1
Jan 2011 00:00:00)
|
N |
systolic |
Double |
The value of the measured quantity in mmHg (omitted if not available) | Y |
diastolic |
Double |
The value of the measured quantity in mmHg (omitted if not available) | Y |
total_cholesterol |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
hdl |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
ldl |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
vitamin_d |
Double |
The value of the measured quantity in ng/mL (omitted if not available) | Y |
hscrp |
Double |
The value of the measured quantity in mg/L (omitted if not available) | Y |
crp |
Double |
The value of the measured quantity in mg/L (omitted if not available) | Y |
tsh |
Double |
The value of the measured quantity in mlU/L (omitted if not available) | Y |
uric_acid |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
resting_heartrate |
Double |
The value of the measured quantity in bpm (omitted if not available) | Y |
blood_calcium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
blood_magnesium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
creatine_kinase |
Double |
The value of the measured quantity in U/L (omitted if not available) | Y |
blood_vitamin_b12 |
Double |
The value of the measured quantity in pg/mL (omitted if not available) | Y |
blood_folic_acid |
Double |
The value of the measured quantity in ng/mL (omitted if not available) | Y |
ferritin |
Double |
The value of the measured quantity in ng/mL (omitted if not available) | Y |
il6 |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
testosterone |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
blood_potassium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
blood_sodium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) | Y |
blood_zinc |
Double |
The value of the measured quantity in mug/dL (omitted if not available) | Y |
blood_chromium |
Double |
The value of the measured quantity in mug/dL (omitted if not available) | Y |
white_cell_count |
Double |
The value of the measured quantity in nmol/muL (omitted if not available) | Y |
source |
String |
The name of the application that last modified this measurement set | N |
previous |
String |
The URI of the previous measurement set for the user (omitted for the oldest measurement set) | N |
next |
String |
The URI of the next measurement set for the user (omitted for the most-recent measurement set) | N |
nearest_fitness_activity |
String |
The URI of the fitness activity closest in time to this activity for the user (omitted if no fitness activities have been recorded) | N |
String[] |
The URIs of the fitness activities closest in time to this activity for each friend (empty if no fitness activities have been recorded) | N | |
nearest_strength_training_activity |
String |
The URI of the strength training activity closest in time to this activity for the user (omitted if no strength training activities have been recorded) | N |
nearest_teammate_strength_training_activities |
String[] |
The URIs of the strength training activities closest in time to this activity for each friend (empty if no strength training activities have been recorded) | N |
nearest_teammate_background_activities |
String[] |
The URIs of the background activities closest in time to this activity for each friend (empty if no background activities have been recorded) | N |
nearest_sleep |
String |
The URI of the sleep measurement set closest in time to this activity for the user (omitted if no sleep measurements have been taken) | N |
nearest_teammate_sleep |
String[] |
The URIs of the sleep measurement sets closest in time to this activity for each friend (empty if no sleep measurements have been taken) | N |
nearest_nutrition |
String |
The URI of the nutrition measurement sets closest in time to this activity for the user (omitted if no nutrition measurements have been token) | N |
nearest_teammate_nutrition |
String[] |
The URIs of the nutrition measurement sets closest in time to this activity for each friend (empty if no nutrition measurements have been token) | N |
nearest_weight |
String |
The URI of the weight measurement sets closest in time to this activity for the user (omitted if no weight measurements have been token) | N |
nearest_teammate_weight |
String[] |
The URIs of the weight measurement sets closest in time to this activity for each friend (empty if no weight measurements have been token) | N |
nearest_general_measurement |
String |
The URI of the general measurement set measurement closest in time to this activity for the user (omitted if no general measurements have been token) | N |
nearest_teammate_general_measurements |
String[] |
The URIs of the general measurement sets closest in time to this activity for each friend (empty if no general measurements have been token) | N |
nearest_diabetes |
String |
The URI of the diabetes measurement sets closest in time to this activity for the user (omitted if no diabetes measurements have been token) | N |
nearest_teammate_diabetes |
String[] |
The URIs of the diabetes measurement sets closest in time to this activity for each friend (empty if no diabetes measurements have been token) | N |
New Entries
New entries have the following structure:
| Field | Type | Description |
|---|---|---|
timestamp |
String |
The timestamp (e.g., Sat, 1
Jan 2011 00:00:00)
|
systolic |
Double |
The value of the measured quantity in mmHg (omitted if not available) |
diastolic |
Double |
The value of the measured quantity in mmHg (omitted if not available) |
total_cholesterol |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
hdl |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
ldl |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
vitamin_d |
Double |
The value of the measured quantity in ng/mL (omitted if not available) |
hscrp |
Double |
The value of the measured quantity in mg/L (omitted if not available) |
crp |
Double |
The value of the measured quantity in mg/L (omitted if not available) |
tsh |
Double |
The value of the measured quantity in mlU/L (omitted if not available) |
uric_acid |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
resting_heartrate |
Double |
The value of the measured quantity in bpm (omitted if not available) |
blood_calcium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
blood_magnesium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
creatine_kinase |
Double |
The value of the measured quantity in U/L (omitted if not available) |
blood_vitamin_b12 |
Double |
The value of the measured quantity in pg/mL (omitted if not available) |
blood_folic_acid |
Double |
The value of the measured quantity in ng/mL (omitted if not available) |
ferritin |
Double |
The value of the measured quantity in ng/mL (omitted if not available) |
il6 |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
testosterone |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
blood_potassium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
blood_sodium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
blood_zinc |
Double |
The value of the measured quantity in mug/dL (omitted if not available) |
blood_chromium |
Double |
The value of the measured quantity in mug/dL (omitted if not available) |
white_cell_count |
Double |
The value of the measured quantity in nmol/muL (omitted if not available) |
post_to_twitter |
Boolean |
Whether to post these measurements to Twitter (optional; if omitted, the user's default setting will be used) |
post_to_facebook |
Boolean |
Whether to post these measurements to Facebook (optional; if omitted, the user's default setting will be used) |
Array Structures
items
| Field | Type | Description |
|---|---|---|
uri |
String |
The URI of detailed information for the measurement set |
timestamp |
String |
The timestamp for the measurement set (e.g., Sat,
1 Jan 2011 00:00:00)
|
systolic |
Double |
The value of the measured quantity in mmHg (omitted if not available) |
diastolic |
Double |
The value of the measured quantity in mmHg (omitted if not available) |
total_cholesterol |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
hdl |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
ldl |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
vitamin_d |
Double |
The value of the measured quantity in ng/mL (omitted if not available) |
hscrp |
Double |
The value of the measured quantity in mg/L (omitted if not available) |
crp |
Double |
The value of the measured quantity in mg/L (omitted if not available) |
tsh |
Double |
The value of the measured quantity in mlU/L (omitted if not available) |
uric_acid |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
resting_heartrate |
Double |
The value of the measured quantity in bpm (omitted if not available) |
blood_calcium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
blood_magnesium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
creatine_kinase |
Double |
The value of the measured quantity in U/L (omitted if not available) |
blood_vitamin_b12 |
Double |
The value of the measured quantity in pg/mL (omitted if not available) |
blood_folic_acid |
Double |
The value of the measured quantity in ng/mL (omitted if not available) |
ferritin |
Double |
The value of the measured quantity in ng/mL (omitted if not available) |
il6 |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
testosterone |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
blood_potassium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
blood_sodium |
Double |
The value of the measured quantity in mg/dL (omitted if not available) |
blood_zinc |
Double |
The value of the measured quantity in mug/dL (omitted if not available) |
blood_chromium |
Double |
The value of the measured quantity in mug/dL (omitted if not available) |
white_cell_count |
Double |
The value of the measured quantity in nmol/muL (omitted if not available) |
Supported Operations
The following operations are supported on the URI of any page of a feed:
GET: Retrieves a page of the feedHEAD: Retrieves the HTTP headers for a page of the feedPOST: Posts a new entry
For GET requests, the following optional HTTP headers are supported:
If-Modified-Since: Indicates that the server should return a304 Not Modifiedresponse instead of the feed if it has not been modified since the given time
For GET requests, the following URI query parameters are supported:
noEarlierThan: Specifies the earliest time for which to return a general measurementnoLaterThan: Specifies the latest time for which to return a general measurementmodifiedNoEarlierThan: Specifies the earliest modification time for which to return a general measurementmodifiedNoLaterThan: Specifies the latest modification time for which to return a general measurement
The following operations are supported on the URI of any general measurement:
GET: Retrieves the general measurementHEAD: Retrieves the HTTP headers for the general measurementPUT: Updates the general measurementDELETE: Removes the general measurement
Note that, when updating a general measurement via a PUT request, any
measured quantity omitted from the request is deleted from the general measurement.
For GET requests, the following optional HTTP headers are supported:
If-Modified-Since: Indicates that the server should return a304 Not Modifiedresponse instead of the general measurement if it has not been modified since the given time
