Questionnaire API

Get the questionnaire results via API.

To get the results of the questionnaire step via API, use this method.

Items with the type of fileAttachment contain the imageId value that you can use to fetch the uploaded files.

The following is a response 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": "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
    }
  ]
}

Definition attributes

The following table describes the questionnaireDef attributes:

NameTypeRequiredDescription
idStringYesA unique questionnaire identification number.
titleStringNoA questionnaire title.
descStringNoAn optional questionnaire description.
sectionsArrayYesAn array of questionnaire sections.

📘

Note

Each questionnaire ID attribute should be unique. If you intend to change the questionnaire structure, IDs should not be reused.

Section fields

The following table describes the sections attributes:

NameTypeRequiredDescription
idStringYesA unique section identification number.
titleStringNoA section title.
descStringNoAn optional section description.
conditionStringNoA condition that makes the section visible, depending on the value of specified sectionId.itemId={options.value}.
itemsArrayYesAn array of questionnaire items (data fields).

Item fields

The following table describes the items attributes:

NameTypeRequiredDescriptionSupported values
idStringYesA unique item identification number.Any unique item identifier.
titleStringNoData field title.Any string value.
descStringNoAn optional data field description.Any string value.
typeStringYesData field type.See Supported types of items.
requiredBooleanNoSets the data field as mandatory to fill.true or false.
formatStringNoThe format of the data field with validation.min:3, max:9 (sets min/max amount of symbols), email.
placeholderStringNoA placeholder for text data field.Any string value.
optionsArrayNoAn array of values to select from.[{"value": "someValue", "title": "Yes", "score": 0}]
conditionStringNoA condition that makes item show up.sectionId.itemId={options.value} ( Example: 1-Section.1-2=someValue )

Supported types of items

The following table describes the supported types of items:

ValueDescription
textA text field.
textAreaAn expandable text area.
dateDate field in format mm/dd/yyyy.
dateTimeShows the calendar with date and time fields.
boolA single checkbox.
selectAn array of options. Creates radio buttons.
selectDropdownAn array of options. Creates a drop-down list with selectable values.
multiSelectAn array of options. Creates multi-select of checkboxes.
countrySelectA drop-down list with available countries.
fileAttachmentAllows uploading a file to the applicant as an attachment.

Option attributes

The following table describes the options attributes:

NameTypeRequiredDescriptionSupported values
valueStringYesThe value that you will get via API as the option selected by the applicant.Any unique item identifier.
titleStringYesAn optional title that will be shown to the applicant.Any string value.
scoreDoubleNoAdds a value to the overall questionnaire scoring (score).Double value.

Questionnaire translations

You can change a questionnaire locale by using SDK translations.

The following is a translation example:

"questionnaires": {
    "questionnaireTranslate": {
      "title": "I18n questionnaire title",
      "desc": "I18n questionnaire description",
      "sections": {
        "section1": {
          "title": "I18n section title",
          "desc": "I18n section description",
          "items": {
            "item1": {
              "title": "I18n item title",
              "desc": "I18n item description",
              "options":{
                "value1": "I18n option title 1",
                "value2": "I18n option title 2"
              }
            }
          }
        }
      }
    }
  }