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
Section titled “Create a FillOutRequest”Sample request
POST /api/v1/dossiers/:dossier_id/fill_out_request HTTP/1.1Host: api.example.comAuthorization: Bearer YOUR_API_TOKENDOSSIER_ID="your_dossier_id"curl -X POST "https://api.example.com/api/v1/dossiers/$DOSSIER_ID/fill_out_request" \ -u "username:password"$username = "username"$password = "password"$dossierId = "your_dossier_id"$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username, $password)))
$headers = @{ "Authorization" = "Basic $base64AuthInfo"}
Invoke-RestMethod -Uri "https://api.example.com/api/v1/dossiers/$dossierId/fill_out_request" ` -Method POST ` -Headers $headers{ "id": 1234}Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
dossier_id |
string |
Required. Unique identifier for the patient to be subscribed. |
fill_out_request |
hash |
Required. attributes (see below). |
fill_out_request attributes:
Section titled “fill_out_request attributes:”| Name | Type | Description |
|---|---|---|
questionnaire_keys |
array of string |
Required. List of questionnaires that need to be filled out. |
respondent_id |
integer |
Id of the respondent that should fill out the questionnaire. |
respondent_type |
string |
[‘patient_version’(default) | ‘profess_version’] String identifying the respondent that should fill out the questionnaires. can be used instead of respondent_id. |
callback_url |
string |
URL to call on events (see below). |
reminders |
array of integer |
List of offsets in seconds after open_from to make a reminder callback. |
open_from |
integer |
Unix timestamp for when the questionnaires can be filled out. Defaults to Time.now |
open_till |
integer |
Unix timestamp for when the questionnaires expire. Default to never. |
Callbacks
Section titled “Callbacks”For each event the callback url is called with the following params:
| name | Type | Description |
|---|---|---|
dossier_id |
string |
The dossier the fill out request was created for. |
event |
string |
The name of the event (opened/reminder/expired) |
fill_out_request_id |
integer |
|
url |
string |
url 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.
