Skip to content

Search Surveys

This endpoint is used to get and search for a list of surveys

Request

GET /accounts/{account-uuid}/surveys
  • account-uuid is a 22-character identifier for the account

Authorization

Authorization is required. Since this endpoint will be used from the Dashboard, nothing is needed from dashboard code, since the auth cookie is handled by the API

Headers

N/A

Query Parameters

Parameter Required More Info
continuation-token no Send this parameter if the response of the previous request provided a continuation token in the result
sort no To specify a field to sort on. See more details below
q no To specify one or more query searches
fields no Defines the fields that are to be returned in the results

continuation-token

On first request, if there is more data, a continuation token will be provided in the result. Specify that token in the next request a the continaution-token query parameter and the next page of data will be provided

sort

Sorting can be appied to a single field at any given time. To sort ascending, provide the field name. To sort descending, apply a minus (-) in front of the field name.

sort=patientFirstName   //sorts by first name ascending
sort=-patientFirstName  // sorts by first name descending

These are the fields that can be sorted on:

  • accountBusinessName
  • patientFirstName
  • patientLastName
  • patientDateOfBirth
  • surveyName
  • orderDate
  • status

q

This query parameter allows for searching (query) based on a specific field. You can pass more than one of these query parameters to the endpoint, allowing for searching accross multiple fields

The format is as follows:

q={field-name}:{search-term}

These are the fields that can be filtered on:

  • accountBusinessName
  • patientFirstName
  • patientLastName
  • orderDate
  • status

fields

By default, no field data will be provided. With this query parameter, specify the fields that should be returned, comma separated.

Here are the fields that can be provided:

  • accountBusinessName
  • patientFirstName
  • patientLastName
  • patientDateOfBirth
  • surveyName
  • orderDate
  • status

Response

Response Status Code More Information
Success 200 If the response is successful
Unauthorized 401 If user is not authorized for the requested account
Internal Server Error 500 Unknown error

Headers

N/A

Body

A paged response, with rows and an optional continuation token:

{
    "data": {
        "items": [
            { 
                //item 1
            },
            {
                //item 2
            },
                //...
            {
                //item n
            }
        ],
        "continuationToken": "<continuation-token",
        "totalCount": 0
    }
}