# Questionnaire
Web SDK allows you to create a QUESTIONNAIRE
verification step for your users to answer your questions or fill out custom data fields that are required.
# Configuration
Questionnaires are set up via questionnaire constructor on the dashboard.
Note that every questionnaire id
attribute should be unique and if you intend to change questionnaire structure, ids
shouldn't be reused.
# questionnaireDef
ATTRIBUTE
Name | Type | Required | Description |
---|---|---|---|
id | String | Yes | ID of questionnaire. |
title | String | No | Questionnaire title. |
desc | String | No | Questionnaire description. |
sections | Array | Yes | Array of questionnaire sections. |
# sections
ELEMENTS FIELDS
Name | Type | Required | Description |
---|---|---|---|
id | String | Yes | ID of the section. |
title | String | No | Section title. |
desc | String | No | Section description. |
condition | String | No | Condition that makes section show up depending on the value of specified sectionId.itemId={options.value} (see example). |
items | Array | Yes | Array of questionnaire items (data fields). |
# items
ELEMENTS FIELDS
Name | Type | Required | Description | Supported values |
---|---|---|---|---|
id | String | Yes | ID of an item | Any unique item identifier. |
title | String | No | Data field title | Any string value. |
desc | String | No | Data field description | Any string value. |
type | String | Yes | Data field type | See below. |
required | Boolean | No | Sets data field as mandatory to fill | true or false . |
format | String | No | Format of the data field with validation | min:3 , max:9 (sets min/max amount of symbols), email . |
placeholder | String | No | Placeholder for text data field | Any string value. |
options | Array | No | Array of values to select from | [{"value": "someValue", "title": "Yes", "score": 0}] |
condition | String | No | Condition that makes item show up | sectionId.itemId={options.value} ( Example: 1-Section.1-2=someValue ) |
# SUPPORTED types
OF items
Value | Description |
---|---|
text | Text field. |
textArea | Expandable text area. |
date | Date field in format mm/dd/yyyy . |
dateTime | Shows calendar with date and time fields. |
bool | A single checkbox. |
select | Using array of options creates radio buttons. |
selectDropdown | Using array of options creates dropdown list of selectable values. |
multiSelect | Using array of options creates multiselect of checkboxes. |
countrySelect | Dropdown list of available countries. |
fileAttachment | Allows to upload a file to the applicant as an attachment. |
# options
ARRAY ATTRIBUTES
Name | Type | Required | Description | Supported values |
---|---|---|---|---|
value | String | Yes | Value that you'll get via API as selected option by user. | Any unique item identifier |
title | String | Yes | Option title that will be shown to user. | Any string value |
score | Double | No | Adds value to overall questionnaire scoring (score ). | Double value |
# Getting results
To get results of QUESTIONNAIRE
step you can use Getting applicant data method.
Items with type of fileAttachment
contain value of the imageId
that you can use to fetch uploaded file using that method.
# Example response
{
"id": "5e9a35d30a975a656d67d473",
"createdAt": "2020-04-17 23:03:47",
"clientId": "yourClientId",
"inspectionId": "5e9a35d30a975a656d67d474",
"externalUserId": "random-userId",
"requiredIdDocs": {
"docSets": [
{
"idDocSetType": "QUESTIONNAIRE",
"questionnaireDefId" : "ExampleQuestionnaire"
}
]
},
"review": {
"elapsedSincePendingMs": 302957,
"elapsedSinceQueuedMs": 25213,
"createDate": "2020-04-17 23:05:46+0000",
"reviewDate": "2020-04-17 23:10:49+0000",
"startDate": "2020-04-17 23:10:24+0000",
"reviewResult": {
"reviewAnswer": "GREEN"
},
"reviewStatus": "completed"
},
"lang": "en",
"type": "individual",
"questionnaires": [
{
"id": "ExampleQuestionnaire",
"sections": {
"bankDetails": {
"score" : 0.0,
"items": {
"2-1": {
"value": null,
"values": null
},
"2-2": {
"value": null,
"values": null
},
"2-3": {
"value": null,
"values": null
},
"2-4": {
"value": null,
"values": null
},
"2-5": {
"value": null,
"values": null
},
"2-6": {
"value": null,
"values": null
},
"2-7": {
"value": null,
"values": null
},
"2-8": {
"value": null,
"values": null
}
}
},
"withInstitution": {
"score" : 0.2,
"items": {
"3-1": {
"value": "e-wallet",
"score" : 0.2
}
}
},
"fileAttachments": {
"score" : 0.0,
"items": {
"firstFile": {
"value": "2046918100", //imageId
"values": null
},
"anotherFile": {
"value": "2046918189", //imageId
"values": null
}
}
},
"accountDetails": {
"score" : 1.4,
"items": {
"1-2one": {
"value": null,
"values": null
},
"1-1": {
"value": "Legal Name LTD"
},
"1-2": {
"value": "two"
},
"1-2two": {
"value": "sumsub.com"
},
"1-4": {
"value": "no",
"score" : 0.4
},
"1-5": {
"value": "no",
"score" : 1.0
},
"1-email": {
"value": "[email protected]"
},
"1-country": {
"value": "GBR"
}
}
}
},
"score" : 1.6
}
]
}
# Questionnaire Translations
You can change questionnaire texts by locale (lang
parameter of SDK initialization) from the dashboard.
Have to provide JSON of questionnaire structure and texts at the questionnaires
object. Every object within .questionnaires
represents a questionnaire from constructor by its id.
# Translations example
"questionnaires": {
"questionnaireTranslate": { //id of a questionnaire to change texts
"title": "I18n questionnaire title",
"desc": "I18n questionnaire description",
"sections": {
"section1": { //id of a section to change texts
"title": "I18n section title",
"desc": "I18n section description",
"items": {
"item1": {
"title": "I18n item title",
"desc": "I18n item description",
"options":{ //In case of multiselect options
"value1": "I18n option title 1",
"value2": "I18n option title 2"
}
}
}
}
}
}
}
# Questionnaire reset
Use QUESTIONNAIRE
argument at this method to delete all active questionnaire data from the specified applicant.