Forms configuration
Form model
Form DTO fields:
id
- [string] uuid of formorgId
- [string] uuid of organizationlocale
- [string] locale which the form was created foravailableForAgents
- [boolean] determines whether agents can access and send the formname
- [string] name of the formconfig
- [object] configuration of the form's inputs (see input types below)expireInterval
- (optional)[number] - milliseconds after which the form can no longer be submittedsendInterval
- (optional)[number] - milliseconds after which the form can be sent againblockIfPreviousUnsubmitted
- (optional)[boolean] - determines whether the form can be sent if previous has not been submitted yetrouteOnSubmit
- (optional)[boolean] - determines whether submitting the form should result in opening and assignment of the conversationtagGroupId
- (optional)[string] uuid of tag group. Form will be available only in rooms with giventagGroupId
. Form with emptytagGroupId
available in any room
Inputs form
Use this form to collect information
Config (inputs) fields:
radioButtonsInputs
- array of objects representing radio buttons inputmultipleButtonsInputs
- array of objects representing multiple buttons inputradioListInputs
- array of objects representing radio list inputcheckboxListInputs
- array of objects representing checkbox list inputtextInputs
- array of objects representing text input
Buttons (multiple choice)
multipleButtonsInputs
Buttons (single choice)
radioButtonsInputs
Radio input with list of options (single choice)
radioListInputs
Input with list of options (multiple choice)
checkboxListInputs
Text input
textInputs
Full example
Inputs order in the form is determined by `index` property of representing object
Auto assign form
Use this form to route clients' conversations based on their choice
Predefined message form
Predefined message is a form to send simple text without any inputs as a adviser message. Form configuration accepts the only property message`
. Such form could be used to send links and messages with additional conversation data:
{{roomId}} - conversation room id
API
Create
POST - /api/message-widgets/{locale}
Creates new form
Requires apiKey header of an adviser with
settings_action_forms
permissionRequires body with following fields:
required:
name
,availableForAgents
,config
(described above)optional:
expireInterval
,sendInterval
,blockIfPreviousUnsubmitted
Update
PUT - /api/message-widgets/{uuid}
Updates existing form
Requires apiKey header of an adviser with
settings_action_forms
permissionRequires body with same schema as POST request
Read
GET - /api/message-widgets/{locale}
Gets all created forms' DTOs
Requires apiKey of organization's adviser
GET - /api/message-widgets/{orgId}/{messageWidgetId}
Gets single form DTO
Does not require authentication
Last updated