GET Measurements for group
Overview
The group measurement list endpoint returns measurements for all members of a group. A valid group UUID is required.
Parameters
includeSubgroups |
(boolean) Determines whether to include measurements for members that belong to child groups of
the specified group UUID. |
startDate |
(date) A date in ISO 8601 standard format (yyyy-MM-dd). If present, the result is limited to measurements
on or after the specified date. If both startDate and endDate are specified, endDate cannot be before startDate. |
endDate |
(date) A date in ISO 8601 standard format (yyyy-MM-dd). If present, the result is limited to measurements on
or before the specified date. If both startDate and endDate are specified, endDate cannot be before startDate. |
limit |
|
offset |
|
sortBy |
See Paging parameters |
sortDirection |
Curl example
curl -X GET \
'https://API_HOSTNAME/api/v1/groups/GROUP_UUID/measurements?\
includeSubgroups=true&endDate=2022-01-15&sortBy=START&\
sortDirection=DESC&offset=200&limit=200' \
--header 'Authorization: Bearer BEARER_TOKEN'
Response
The response is a list of measurements, with additional fields that contain paging metadata and links to the previous and next pages, if they exist.
Response body
{
"totalCount": 23965,
"limit": 200,
"offset": 200,
"results": [
{
"startTime": "2021-08-24T03:30:00Z",
"endTime": "2021-08-24T09:24:00Z",
"type": "sleepDuration",
"member": {
"href": "/api/v1/groups/GROUP_UUID/members/USER_UUID",
"title": "John Doe"
},
"sourceName": "Pattern iOS App",
"value": 21240.0,
"unit": "s",
"taskUuid": "TASK_UUID"
},
{
"startTime": "2021-05-13T15:12:47.319Z",
"endTime": "2021-05-13T15:12:47.319Z",
"type": "surveyAnswer",
"member": {
"href": "/api/v1/groups/GROUP_UUID/members/USER_UUID",
"title": "John Doe"
},
"sourceName": "Pattern Survey UI",
"json": true,
"surveyQuestionId": "question_id_1",
"survey": {
"href": "/api/v1/groups/GROUP_UUID/surveys/SURVEY_UUID",
"title": "Survey Title"
},
"taskUuid": "TASK_UUID"
},
{
"startTime": "2021-05-13T15:12:45.666Z",
"endTime": "2021-05-13T15:12:45.666Z",
"type": "surveyAnswer",
"member": {
"href": "/api/v1/groups/GROUP_UUID/members/USER_UUID",
"title": "John Doe"
},
"sourceName": "Pattern Survey UI",
"json": 3,
"surveyQuestionId": "question_id_2",
"survey": {
"href": "/api/v1/groups/GROUP_UUID/surveys/SURVEY_UUID",
"title": "Survey Title"
},
"taskUuid": "TASK_UUID"
},
...
],
"nextPage": "https://API_HOSTNAME/api/v1/groups/GROUP_UUID/measurements?includeSubgroups=true&endDate=2022-01-15&sortBy=START&sortDirection=ASC&offset=400&limit=200",
"previousPage": "https://API_HOSTNAME/api/v1/groups/GROUP_UUID/measurements?includeSubgroups=true&endDate=2022-01-15&sortBy=START&sortDirection=ASC&offset=0&limit=200"
}
Result attributes
startTime |
(timestamp) The start time for the measurement. |
endTime |
(timestamp) The end time for the measurement. For some types of measurements, this will be the same as startTime. |
sourceName |
(string) A unique identifier for the measurement. |
type |
(string) The measurement type. Possible values are: |
member |
(link) A reference to the group member. |
value |
(number, optional) For measurements that can be expressed as a number (steps, heart rate, etc.), this is the value of the measurement. |
unit |
(string, optional) For measurements that have a non-null value, this is the unit associated with that value (e.g. meters, ounces). |
text |
(string, optional) For measurements that can be expressed as a text string (e.g. journal entry), this is the value of the measurement. |
contentId |
(number, optional) For media based measurements, this identifies the media content. |
notes |
(string, optional) Notes associated with the measurement. |
json |
(string, optional) For measurements that capture higher complexity concepts (e.g. recipe serving, food nutrient), this is the value of the measurement as a JSON document. |
surveyQuestionId |
(string, optional) For measurements that represent survey answers, this field and survey can identify the related survey question. |
survey |
(string, optional) For measurements that represent survey answers, this field and surveyQuestionId can identify the related survey question. |
taskUuid |
(string, optional) The unique identifier for the task that the measurement is attached to. |