Forms configuration

Form model

Form DTO fields:

  • id - [string] uuid of form

  • orgId - [string] uuid of organization

  • locale - [string] locale which the form was created for

  • availableForAgents - [boolean] determines whether agents can access and send the form

  • name - [string] name of the form

  • config - [object] configuration of the form's inputs (see input types below)

  • expireInterval - (optional)[number] - milliseconds after which the form can no longer be submitted

  • sendInterval - (optional)[number] - milliseconds after which the form can be sent again

  • blockIfPreviousUnsubmitted - [boolean] - determines whether the form can be sent if previous has not been submitted yet

  • routeOnSubmit - [boolean] - determines whether submitting the form should result in opening and assignment of the conversation

  • tagGroupIds - list[string] - list of tag group's uuids. Form will be available only in rooms with one of the given tagGroupIds. Form with empty tagGroupIds is available in any room

Inputs form

circle-info

Use this form to collect information

Config (inputs) fields:

  • radioButtonsInputs - array of objects representing radio buttons input

  • multipleButtonsInputs - array of objects representing multiple buttons input

  • radioListInputs - array of objects representing radio list input

  • checkboxListInputs - array of objects representing checkbox list input

  • textInputs - array of objects representing text input

Buttons (multiple choice)

multipleButtonsInputs

Mulitple buttons input
chevron-rightClick here to see the codehashtag

The input above is represented by the following object:

Buttons (single choice)

radioButtonsInputs

Radio buttons input
chevron-rightClick here to see the codehashtag

The input above is represented by the following object:

Radio input with list of options (single choice)

radioListInputs

Radio list input
chevron-rightClick here to see the codehashtag

The input above is represented by the following object:

Input with list of options (multiple choice)

checkboxListInputs

Checkbox list input
chevron-rightClick here to see the codehashtag

The input above is represented by the following object:

Text input

textInputs

Text input
chevron-rightClick here to see the codehashtag

The input above is represented by the following object:

Full example

Inputs order in the form is determined by `index` property of representing object

chevron-rightClick here to see form with inputs represented abovehashtag

Auto assign form

circle-info

Use this form to route clients' conversations based on their choice

Auto assign form
chevron-rightClick here to see form configurationhashtag

The form above is represented by the following object:

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

Predefined meesage
chevron-rightClick here to see form configurationhashtag

The form above is represented by the following object:

API

Create

POST - /api/message-widgets

  • Creates new form

  • Requires apiKey header of an adviser with settings_action_forms permission

  • Requires body with following fields:

    • required: locale, name, availableForAgents, config (described above), blockIfPreviousUnsubmitted, routeOnSubmit

    • optional: expireInterval, sendInterval

chevron-rightClick here to see an examplehashtag

Update

PUT - /api/message-widgets/{messageWidgetId}

  • Updates existing form

  • Requires apiKey header of an adviser with settings_action_forms permission

  • Requires body with the same schema as POST request, but without locale

chevron-rightClick here to see an examplehashtag

Read

GET - /api/message-widgets?locale={locale}

  • Gets all created forms' DTOs

  • Requires apiKey of organization's adviser

chevron-rightClick here to see an examplehashtag

GET - /api/message-widgets/{messageWidgetId}?orgId={orgId}

  • Gets single form DTO

  • Does not require authentication

chevron-rightClick here to see an examplehashtag

Last updated