Diabetes Measurements
Introduction
Diabetes measurements capture statistics about a user’s blood glucose and hormone levels. Diabetes measurements are grouped in reverse chronological order into a diabetes measurement feed.
Feed
Because a user’s diabetes measurement feed can grow very large, feeds are divided into pages of 25 diabetes measurements. Each page of a user’s diabetes measurement feed has the following structure:
| Field | Type | Description |
|---|---|---|
size |
Integer |
The total number of diabetes measurements across all pages |
items |
Item[] |
The user’s diabetes measurements, in reverse chronological order |
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 Measurements
Past measurements have the following structure:
| Field | Type | Description | Editable |
|---|---|---|---|
uri |
String |
The URI for this measurement | N |
userID |
Integer |
The unique ID for the user | N |
timestamp |
String |
The time at which the measurement was taken (e.g., Sat,
1 Jan 2011 00:00:00)
|
N |
| One of any measurement quantities | Double |
The value of the measured quantity | Y |
previous |
String |
The URI of the previous diabetes measurement in chronological order for the user (omitted for the first diabetes measurement) | N |
next |
String |
The URI of the next diabetes measurement in chronological order for the user (omitted for the most recent diabetes measurement) | 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 |
nearest_teammate_fitness_activities |
String[] |
The URIs of the fitness activities closest in time to this activity for each street teammate (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 street teammate (empty if no strength training activities have been recorded) | N |
nearest_background_activity |
String |
The URI of the background activity closest in time to this activity for the user (omitted if no background activities have been recorded) | N |
nearest_teammate_background_activities |
String[] |
The URIs of the background activities closest in time to this activity for each street teammate (empty if no background activities have been recorded) | N |
nearest_background |
String |
The URIs of the background activities closest in time to this activity for each street teammate (empty if no background activities have been recorded) | N |
nearest_sleep |
String |
The URI of the sleep measurements 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 measurements closest in time to this activity for each street teammate (empty if no sleep measurements have been taken) | N |
nearest_nutrition |
String |
The URI of the nutrition measurement 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 closest in time to this activity for each street teammate (empty if no nutrition measurements have been token) | N |
nearest_weight |
String |
The URI of the weight measurement 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 measurements closest in time to this activity for each street teammate (empty if no weight measurements have been token) | N |
nearest_general_measurement |
String |
The URI of the general measurement 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 measurements closest in time to this activity for each street teammate (empty if no general measurements have been token) | N |
nearest_diabetes |
String |
The URI of the diabetes measurement 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 measurements closest in time to this activity for each street teammate (empty if no diabetes measurements have been token) | N |
New Measurements
New measurements have the following structure:
| Field | Type | Description |
|---|---|---|
timestamp |
String |
The time at which the measurement was taken (e.g., Sat,
1 Jan 2011 00:00:00)
|
| One of any measurement quantities | Double |
The value of the measured quantity |
post_to_twitter |
Boolean |
Whether to post this measurement to Twitter (optional; if omitted, the user's default setting will be used) |
post_to_facebook |
Boolean |
Whether to post this measurement to Facebook (optional; if omitted, the user's default setting will be used) |
Array Structures
items
| Field | Type | Description |
|---|---|---|
timestamp |
String |
The time at which the measurement was taken (e.g., Sat,
1 Jan 2011 00:00:00)
|
| One of any measurement quantities | Double |
The value of the measured quantity |
uri |
String |
The URI of detailed information for the diabetes measurement |
Measurement Quantities
| Field | Unit |
|---|---|
c_peptide |
ng/mL |
fasting_plasma_glucose_test |
mg/dL |
hemoglobin_a1c |
g/dL |
insulin |
U |
oral_glucose_tolerance_test |
mg/dL |
random_plasma_glucose_test |
mg/dL |
triglyceride |
mg/dL |
Supported Operations
Retrieving Measurement Information
To retrieve a user’s diabetes measurement feed or a diabetes
measurement,
GET
its URI.
Retrieving Headers for a Past Measurement
Header information for a past measurement can be retrieved by
making a
HEAD
request to its URI. Be sure to set
the
Accept
header to tho.
Editing a Past Measurement
To edit a past measurement,
PUT
any new values for editable fields to its URI.
Recording a New Measurement
To record a new measurement,
POST
its fields to any page in the user’s activity history.