# Questionnaire
IDnGO allows you to create a verification step — a questionnaire (QUESTIONNAIRE) so that your users can answer questions or fill in data fields relevant to you.
# Configuration
Questionnaires are configured using the survey builder in the «Questionnaires» section of the Dashboard.
# Questionnaire structure
Warning:
The id of each item in the questionnaire must be unique. If you plan to modify the structure of the questionnaire, you cannot reuse existing ids.
Fields of the questionnaireDef element
| Name | Type | Required | Description |
|---|---|---|---|
id | String | Yes | Questionnaire identifier. |
title | String | No | Questionnaire title. |
desc | String | No | Questionnaire description. |
sections | Array | Yes | Sections of the questionnaire. |
Fields of the sections element
| Name | Type | Required | Description |
|---|---|---|---|
id | String | Yes | Section identifier. |
title | String | No | Section title. |
desc | String | No | Section description. |
condition | String | No | Condition that determines whether the section is displayed depending on the value of sectionId.itemId={options.value} (see example). |
items | Array | Yes | Questionnaire items (data fields). |
Fields of the items element
| Name | Type | Required | Description | Value |
|---|---|---|---|---|
id | String | Yes | Item identifier. | 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 | Whether the data field is mandatory. | true or false |
format | String | No | Data field format with validation. | min:3, max:9 (sets min/max number of characters), email, etc. |
placeholder | String | No | Placeholder for the data field. | Any string value. |
options | Array | No | Array of selectable values. | [{"value": "someValue", "title": "Yes", "score": 0}] |
condition | String | No | Condition that determines whether the item is displayed. | sectionId.itemId={options.value} (Example: 1-Section.1-2=someValue) |
Available type values for items parameter
| Value | Description |
|---|---|
text | Text field. |
textArea | Expandable text area. |
date | Date field (format mm/dd/yyyy). |
dateTime | Displays calendar to select date and time. |
bool | Single checkbox. |
select | Use the options array to create radio buttons. |
selectDropdown | Use the options array to create a dropdown of selectable values. |
multiSelect | Use the options array to create multiple checkboxes. |
countrySelect | Dropdown of available countries. |
fileAttachment | Allows user to upload a file as an attachment. |
Fields of the options array
| Name | Type | Required | Description | Value |
|---|---|---|---|---|
value | String | Yes | The option selected by the user. | Any unique item identifier. |
title | String | Yes | Option title displayed to the user. | Any string value. |
score | Double | No | Adds value to the total questionnaire score (score). | Double value. |
# Retrieving results
To get the results of the questionnaire, use the applicant data retrieval endpoint.
Items of type fileAttachment contain the imageId value, which you can use to retrieve the uploaded file using this request.
Example
{
"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": "idngo.kz"
},
"1-4": {
"value": "no",
"score" : 0.4
},
"1-5": {
"value": "no",
"score" : 1.0
},
"1-email": {
"value": "api@idngo.kz"
},
"1-country": {
"value": "GBR"
}
}
}
},
"score" : 1.6
}
]
}
# Changing questionnaire language
You can change the questionnaire text for different languages (using the lang parameter when initializing the SDK). To do this, you need to provide a JSON structure of the questionnaire with translations in the questionnaires object. Each object inside .questionnaires corresponds to a questionnaire by its id.
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"
}
}
}
}
}
}
}
# Resetting the questionnaire
To delete all active questionnaire data for an applicant, use the QUESTIONNAIRE parameter in the corresponding request.