GET Tasks

Overview

The task list endpoint returns tasks generated for group members. A valid group UUID is required. Use the includeSubgroups property to get tasks for an entire branch of the group hierarchy. This is useful for multi-site or cross-program data access.

Base path

/api/v1/groups/GROUP_UUID/tasks

Path parameters

GROUP_UUID

(string) The unique identifier for a group.

Query parameters

includeSubgroups

(boolean) Determines whether to include tasks for members that belong to child groups of the specified group UUID.
Default: false
Required: no

type

(string) Limit the result to tasks of the specified type.
Available values: checkBG, checkBP, checkHR, checkSpO2, checkTacrolimusLevel, checkWeight, completeChecklist, completeMission, doMultipleExercises, exercise, logAfibEpisode, logFeeding, logFood, meditate, recordFluidIntake, recordJournalEntry, recordSleep, register, setUpPayment, signDocument, takeECG, takeMeds, takeMultipleMeds, takeSurvey, takeTemperature, verifyPhoneNumber, viewContent, walkSteps
Default: none
Required: no

progress

(string) Limit the results to tasks within the specified progress range. Progress is specified as a colon-delimited range of numbers from 0.0 to 1.0. Example: progress=0.23:0.9
Default: none
Required: no

status

(string) Limit the results to tasks with the specified status.
Available values: notStarted, inProgress, failed, completed, refused, expired
Default: none
Required: no

taskDateStart

(date) A date in ISO 8601 standard format (yyyy-MM-dd). If present, the result is limited to tasks on or after the specified date. If both taskStartDate and taskEndDate are specified, taskEndDate cannot be before taskStartDate.
Default: none
Required: no

taskDateEnd

(date) A date in ISO 8601 standard format (yyyy-MM-dd). If present, the result is limited to tasks on or before the specified date. If both taskStartDate and taskEndDate are specified, taskEndDate cannot be before taskStartDate.
Default: none
Required: no

limit

See Paging parameters

offset

See Paging parameters

sortBy

See Paging parameters
Available values: START, DUE, STATUS
START - the scheduled start time for the task
DUE - the scheduled end time for the task
STATUS - the current status of the task
Default: STATUS

sortDirection

See Paging parameters

Curl example

curl -X GET \
'https://API_HOSTNAME/api/v1/groups/GROUP_UUID/tasks?\
includeSubgroups=true&startDate=2019-05-20&endDate=2019-05-21&\
sortBy=START&sortDirection=ASC&limit=10&offset=10&progress=0.5:1.0&\
type=takeSurvey' \
--header 'Authorization: Bearer BEARER_TOKEN'

Response

The response is a list of tasks, with additional fields that contain paging metadata and links to the previous and next pages, if they exist.

Response body

{
    "totalCount": 10604,
    "limit": 10,
    "offset": 10,
    "results": [
        {
            "uuid": "TASK_UUID",
            "href": "/api/v1/groups/GROUP_UUID/tasks/TASK_UUID",
            "activityUuid": "ACTIVITY_UUID",
            "group": {
                "href": "/api/v1/groups/GROUP_UUID",
                "title": "My Group"
            },
            "member": {
                "href": "/api/v1/groups/GROUP_UUID/members/USER_UUID",
                "title": "John Doe"
            },
            "startTime": "2019-05-20T11:00:00Z",
            "endTime": "2019-05-21T03:00:00Z",
            "adHoc": false,
            "status": "completed",
            "type": "takeSurvey",
            "progress": 1.0,
            "finishTime": "2019-05-20T15:13:38.515Z",
            "title": "Survey Title",
            "taskDate": "2019-05-20"
        },
        ...
    ],
    "nextPage": "https://API_HOSTNAME/api/v1/groups/GROUP_UUID/tasks?includeSubgroups=true&&startDate=2019-05-20&endDate=2019-05-21&sortBy=START&sortDirection=ASC&offset=20&limit=10&progress=0.5:1.0&type=takeSurvey",
    "previousPage": "https://API_HOSTNAME/api/v1/groups/GROUP_UUID/tasks?includeSubgroups=true&startDate=2019-05-20&endDate=2019-05-21&&sortBy=START&sortDirection=ASC&offset=0&limit=10&progress=0.5:1.0&type=takeSurvey"
}

Result attributes

The task list response elements are the same as GET Task details, except the task list does not contain measurements.