Aivo for developers

Unlock the full potential!

A complement is an HTML element which allows you to display visual components on AgentBot’s window.

Meet some of them!

  • Buttons Complement
  • PDF Complement
  • FormData Complement
  • Carousel Complement
  • OpenChat Derivation Complement

Fields

Field Description Type Default Required
message Must be UTF-8 and corresponds to the message that will be sent to the client. String Null No
Type Corresponds to the message type that will be rendered.
It can be «message», «buttons», «formData» or any supported complement.
String «message» No
Params Complement Data Object Object String No

FIELD

Message

Description

Must be UTF-8 and corresponds to the message that will be sent to the client.

Type

String

DEFAULT

Null

REQUIRED

No

FIELD

Type

Description

Must be «buttons» and corresponds to the message type that will be rendered.

Type

String

DEFAULT

«Message»

REQUIRED

Yes

FIELD

Params

Description

Buttons Component Object

Type

Object

DEFAULT

Null

REQUIRED

Yes

Buttons Complement

The buttons complement allows the user to add buttons to the message to request actions. Buttons can send a message from client to agent, open a URL, or transfer a conversation to Live.

Example

fields

Field Description Type Default Required
message Must be UTF-8 and corresponds to the message that will be sent to the client. String null No
type Must be «buttons» and corresponds to the message type that will be rendered. String «message» Yes
params buttons component object Object null Yes

FIELD

Message

Description

Must be UTF-8 and corresponds to the message that will be sent to the client.

Type

String

DEFAULT

Null

REQUIRED

No

FIELD

Type

Description

Must be «buttons» and corresponds to the message type that will be rendered.

Type

String

DEFAULT

«Message»

REQUIRED

Yes

FIELD

Params

Description

Buttons Component Object

Type

Object

DEFAULT

Null

REQUIRED

Yes

Buttons Complement Object

Field Description Type Default Required
blockInput Block the text field to send message. It can be true or false. Boolean false No
onechoice Allow select a single option. After selecting an option the complement will be blocked. It can be true or false. Boolean false No
quickreplies Show buttons like a quick replies Boolean false No
data Array of Button Objects Array null Yes

FIELD

BlockInput

Description

Block the text field to send message. It can be true or false.

Type

Boolean

DEFAULT

False

REQUIRED

No

FIELD

OneChoice

Description

Allow select a single option. After selecting an option the complement will be blocked. It can be true or false.

Type

Boolean

DEFAULT

False

REQUIRED

No

FIELD

QuickReplies

Description

Show buttons like a quick replies

Type

Boolean

DEFAULT

False

REQUIRED

No

FIELD

Data

Description

Array of Button Objects

Type

Array

DEFAULT

Null

REQUIRED

Yes

Button Object

Field Description Type Default Required
type Type of actions that will be dispatched for buttons.
It can be «message», «link», «transferToLive», «step» or «call».
If quickReplies is true, button type must by «message» or «link».
String «message» No
label Text to show into button. String null Yes
value Value to be sent when dispatch the button event String null Yes
conditions Array of Conditions Array Null No

FIELD

type

Description

Type of actions that will be dispatched for buttons.
It can be «message», «link», «transferToLive», «step» or «call».
If quickReplies is true, button type must by «message» or «link».

Type

String

DEFAULT

«message»

REQUIRED

No

FIELD

label

Description

Text to show into button.

Type

String

DEFAULT

Null

REQUIRED

Yes

FIELD

value

Description

Value to be sent when dispatch the button event.

Type

String

DEFAULT

Null

REQUIRED

Yes

FIELD

conditions

Description

Array of Conditions

Type

Array

DEFAULT

Null

REQUIRED

No

FormData Complement

The form data complement allows the agent to request data to client to dispatch an event. The form may transfer the conversation to Live or perform other events that not yet available.

Example

fields

Field Description Type Default Required
message Must be UTF-8 and corresponds to the message that will be sent to the client. String Null No
Type Must be «formData» and corresponds to the message type that will be rendered. String «message» Yes
Params FormData Component Object Object Null Yes

FIELD

Message

Description

Must be UTF-8 and corresponds to the message that will be sent to the client.

Type

String

DEFAULT

Null

REQUIRED

No

FIELD

Type

Description

Must be «formData» and corresponds to the message type that will be rendered.

Type

String

DEFAULT

«Message»

REQUIRED

Yes

FIELD

Params

Description

FormData Component Object

Type

Object

DEFAULT

Null

REQUIRED

Yes

FormData Complement Object

Field Description Type Default Required
type Type of actions that will be dispatched to submit form. It can be «transfer» or «step». string «transfer» No
blockinput Block the text field to send message. It can be true or false. Boolean False No
groupld Group Id of AgentIQ to send form data integer null No
Data Array of Input Field Objects. Array Default
Input
Fields
Array
No
nextStep For forms of steps string Null No

FIELD

type

Description

Type of actions that will be dispatched to submit form. It can be «transfer» or «step».

Type

String

DEFAULT

«transfer»

REQUIRED

No

FIELD

blockinput

Description

Block the text field to send message. It can be true or false.

Type

Boolean

DEFAULT

False

REQUIRED

No

FIELD

groupld

Description

Group Id of AgentIQ to send form data.

Type

integer

DEFAULT

null

REQUIRED

No

FIELD

Data

Description

Array of Input Field Objects.

Type

Array

DEFAULT

Default
Input
Fields
Array

REQUIRED

No

FIELD

nextStep

Description

For forms of steps

Type

string

DEFAULT

Null

REQUIRED

No

Input Field Object

Field Description Type Default Required
ref Input field reference keyword. Should be on lowerCamelCase and written in English. String null Yes
label Text to show into input field. (like a placeholder). String null Yes
type Type of field. It can be «text», «email», «number», «checkbox», «select» or «search». String «text» No
required Required field. Validate that the field is not empty. Validate that the text entered corresponds with the type of field. It can be true or false. boolean false No
regex Regular expression for validation. Not include the / at the beginning and end of the string. string null No
options Only to inputs with type «select» and «search» Array of Option Objects. array null No
conditions Only to inputs with type «select» and «search» is condition field. boolean null No
error All inputs of any type. This field set the error tooltip message shown when the validation fail.
If isn’t setted, a default message will be shown.
string null No
dependency This object set a relationship between two fields. When the parent match the value, the child field is shown. object null No

FIELD

ref

Description

Input field reference keyword. Should be on lowerCamelCase and written in English.

Type

string

DEFAULT

Null

REQUIRED

Yes

FIELD

label

Description

Text to show into input field. (like a placeholder).

Type

string

DEFAULT

Null

REQUIRED

Yes

FIELD

type

Description

Type of field. It can be «text», «email», «number», «checkbox», «select» or «search».

Type

string

DEFAULT

«text»

REQUIRED

No

FIELD

required

Description

Required field. Validate that the field is not empty. Validate that the text entered corresponds with the type of field. It can be true or false.

Type

boolean

DEFAULT

False

REQUIRED

No

FIELD

regex

Description

Regular expression for validation. Not include the / at the beginning and end of the string.

Type

String

DEFAULT

Null

REQUIRED

No

FIELD

options

Description

Only to inputs with type «select» and «search» Array of Option Objects.

Type

Array

DEFAULT

Null

REQUIRED

No

FIELD

conditions

Description

Only to inputs with type «select» and «search» is condition field.

Type

boolean

DEFAULT

Null

REQUIRED

No

FIELD

error

Description

All inputs of any type. This field set the error tooltip message shown when the validation fail.
If isn’t setted, a default message will be shown.

Type

string

DEFAULT

Null

REQUIRED

No

FIELD

dependency

Description

This object set a relationship between two fields. When the parent match the value, the child field is shown.

Type

object

DEFAULT

Null

REQUIRED

No

Dependency Object

An input with this property object is shown when the parent matches his value with the dependency. The object has two properties:

  • ref: The name of the parent field.
  • value: The parent input value. If the parent input value matches his child dependency value, then the child is shown.

The required property on an input with dependency property is only validated when the input is shown.

In the next example, if the user check the subscription field, the two fields (name and email) will shown: