Skip to main content

Fill Out Requests

A fill_out_request specifies a list of questionnaires that need to be filled out within a certain timespan. At opened/reminder/expired a callback is made to the callback url.

Create a FillOutRequest

Sample request

POST /api/v1/dossiers/:dossier_id/fill_out_request
Status: 200 OK
{
"id": 1234
}

Parameters

NameTypeDescription
dossier_idstringRequired. Unique identifier for the patient to be subscribed.
fill_out_requesthashRequired. attributes (see below).

fill_out_request attributes:

NameTypeDescription
questionnaire_keysarray of stringRequired. List of questionnaires that need to be filled out.
respondent_idintegerId of the respondent that should fill out the questionnaire.
respondent_typestring['patient_version'(default) | 'profess_version'] String identifying the respondent that should fill out the questionnaires. can be used instead of respondent_id.
callback_urlstringURL to call on events (see below).
remindersarray of integerList of offsets in seconds after open_from to make a reminder callback.
open_fromintegerUnix timestamp for when the questionnaires can be filled out. Defaults to Time.now
open_tillintegerUnix timestamp for when the questionnaires expire. Default to never.

Callbacks

For each event the callback url is called with the following params:

nameTypeDescription
dossier_idstringThe dossier the fill out request was created for.
eventstringThe name of the event (opened/reminder/expired)
fill_out_request_idinteger
urlstringurl to fill in all open questionnaires (not just the ones for this fill out request).

The callback url should contain the authentication for the request.