General Questionnaires API
Endpoints for managing questionnaires and surveys.
List Questionnaires
Get a list of available questionnaires.
Endpoint: GET /v1/questionnaires
Authentication: Required
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number for pagination |
page_size | integer | No | Number of items per page |
category | string | No | Filter by questionnaire category |
active | boolean | No | Filter by active status |
age_group | string | No | Filter by target age group |
Example Request
GET /v1/questionnaires?category=screening&active=true HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_hereGet Questionnaire Details
Endpoint: GET /v1/questionnaires/{id}
Authentication: Required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Questionnaire ID |
Example Request
GET /v1/questionnaires/123 HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_hereMarketing Questionnaires
List Marketing Questionnaires
Get questionnaires used for marketing and outreach.
Endpoint: GET /v1/marketing_questionnaires
Authentication: Not required
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number for pagination |
page_size | integer | No | Number of items per page |
target_audience | string | No | Filter by target audience |
Create Marketing Questionnaire Response
Endpoint: POST /v1/marketing_questionnaires
Authentication: Not required
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
marketing_questionnaire | object | Yes | Response data object |
marketing_questionnaire.questionnaire_id | integer | Yes | Questionnaire ID |
marketing_questionnaire.email | string | Yes | Respondent’s email |
marketing_questionnaire.responses | array | Yes | Array of responses |
Example Request
POST /v1/marketing_questionnaires HTTP/1.1
Content-Type: application/json
{
"marketing_questionnaire": {
"questionnaire_id": 456,
"email": "[email protected]",
"responses": [
{
"question_id": 1,
"answer": "Yes"
},
{
"question_id": 2,
"answer": "Sometimes"
}
]
}
}Questionnaire Responses
Create Questionnaire Response
Endpoint: POST /v1/questionnaire_responses
Authentication: Required
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
questionnaire_response | object | Yes | Response data object |
questionnaire_response.questionnaire_id | integer | Yes | Questionnaire ID |
questionnaire_response.patient_id | integer | Yes | Patient ID |
questionnaire_response.responses | array | Yes | Array of responses |
Example Request
POST /v1/questionnaire_responses HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_here
{
"questionnaire_response": {
"questionnaire_id": 123,
"patient_id": 1049,
"responses": [
{
"question_id": 1,
"answer": "Often"
},
{
"question_id": 2,
"answer": "3"
}
]
}
}Update Questionnaire Response
Endpoint: PUT /v1/questionnaire_responses/{id}
Authentication: Required
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Response ID |
Questionnaire Invites
Create Questionnaire Invite
Send an invitation to complete a questionnaire.
Endpoint: POST /v1/questionnaire_invites
Authentication: Required
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
questionnaire_invite | object | Yes | Invite data object |
questionnaire_invite.questionnaire_id | integer | Yes | Questionnaire ID |
questionnaire_invite.patient_id | integer | Yes | Patient ID |
questionnaire_invite.email | string | Yes | Email to send invite to |
questionnaire_invite.due_date | string | No | Due date (YYYY-MM-DD) |
questionnaire_invite.message | string | No | Custom message |
Example Request
POST /v1/questionnaire_invites HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_here
{
"questionnaire_invite": {
"questionnaire_id": 123,
"patient_id": 1049,
"email": "[email protected]",
"due_date": "2023-11-01",
"message": "Please complete this questionnaire before your next appointment."
}
}Response Format
Questionnaire Response
{
"id": 123,
"title": "Child Behavior Checklist",
"description": "Assessment of child behavioral and emotional problems",
"category": "screening",
"age_group": "child",
"estimated_duration": 15,
"active": true,
"questions": [
{
"id": 1,
"text": "How often does your child have difficulty concentrating?",
"type": "multiple_choice",
"options": ["Never", "Sometimes", "Often", "Always"],
"required": true
}
],
"created_at": "2023-10-20T10:00:00.000Z",
"updated_at": "2023-10-20T10:00:00.000Z"
}Questionnaire Response Submission
{
"id": 456,
"questionnaire_id": 123,
"patient_id": 1049,
"status": "completed",
"score": 25,
"responses": [
{
"question_id": 1,
"question_text": "How often does your child have difficulty concentrating?",
"answer": "Often",
"score": 3
}
],
"completed_at": "2023-10-27T14:30:00.000Z",
"created_at": "2023-10-27T14:00:00.000Z"
}Questionnaire Categories
Common categories include:
screening- Initial screening questionnairesdiagnostic- Diagnostic assessment toolsoutcome- Outcome measurement toolsprogress- Progress tracking questionnairessatisfaction- Satisfaction surveysintake- Intake and registration forms
Question Types
multiple_choice- Multiple choice questionsscale- Rating scale questions (1-5, 1-10, etc.)text- Free text responsesyes_no- Yes/No questionscheckbox- Multiple selection checkboxesdate- Date input questions
Response Status Values
started- Response has been startedin_progress- Response is being completedcompleted- Response has been completedsubmitted- Response has been submitted for reviewreviewed- Response has been reviewed by clinician
Error Responses
422 Unprocessable Entity
{
"errors": {
"questionnaire_id": ["can't be blank"],
"patient_id": ["can't be blank"],
"responses": ["can't be blank"]
}
}404 Not Found
{
"errors": "Questionnaire not found"
}Notes
- Marketing questionnaires can be completed without authentication
- Questionnaire invites are sent via email with secure links
- Responses are automatically scored based on questionnaire configuration
- Some questionnaires may have age or demographic restrictions
- Completed questionnaires can be reviewed by authorized clinicians
- Progress tracking questionnaires help monitor treatment outcomes