Skip to content

Get Survey Auth Token

This endpoint is used to verify the user and retrieve an auth token.

Note

The auth token returned by this endpoint can only be used by the survey endpoints.

Request

POST /accounts/{account-uuid}/surveys/{survey-uuid}/auth/tokens
  • account-uuid is a 22-character identifier for the account
  • survey-uuid is a 22-character identifier for the survey

Body

{
    "patientDOB": "<patient-dob>"
}
Attribute Format Example Notes
patientDOB mm/dd/yyyy 01/01/2020

Headers

N/A

Query Parameters

N/A

Response

Response Status Code More Information
Created 201 User is successfully validated, and auth token is provided
Bad Request 400 Invalid survey or patient date of birth
Validation Error 422 Validation error for user input
Internal Server Error 500 Unknown error

Created (201)

A successful response will contain do payload (except for the generic correlationUUID). The auth token will be specified in the Authorization header.

Store this value, and provide it with any endpoints that are related to the survey (get, patch, etc.). For more information about how to correctly work with auth tokens, see Authorization Tokens.

Body will contain additional information about the survey

{
    "title": "<survey-title>",
    "acceptedTerms": <true or false>,
    "status": "<status>",
    "uuid": "<uuid>"
}

Bad Request (400)

When a 400 is returned, additional information will be provided. See Bad Requests for more information. Here are the possible error codes that can be returned:

Error Code Description
1 Invalid survey UUID

Validation Error (422)

When a 422 validation error is returned, additional information will be returned that can be used in the user interface. For more details about validation errors see Validation Errors.