Aivo para desenvolvedores

Aproveite todas as possibilidades

Um complemento é um elemento HTML que te permitirá mostrar componentes visuais na janela do AgentBot.

Conheça alguns deles:

  • Complemento Botões
  • PDF
  • Complemento FormData
  • Carrossel
  • Transferência OpenChat

Campos

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

CAMPO

Mensagem

Descrição

Deve ser UTF-8 e corresponde à mensagem que será enviada para o cliente.

Tipo

Cordão

DEFAULT

Nulo

REQUERIDO

Não

CAMPO

Tipo

Descrição

Deve ser "botões" e corresponde ao tipo de mensagem que será apresentada.

Tipo

Cordão

DEFAULT

"Mensagem".

REQUERIDO

Sim

CAMPO

Parames

Descrição

Botões Componente Objeto

Tipo

Objeto

DEFAULT

Nulo

REQUERIDO

Sim

Complemento Botões

Este complemento permite adicionar botões na mensagem para disparar ações. Os botões podem enviar uma mensagem do cliente ao agente, abrir uma URL ou transferir uma conversa para a Live.

Exemplo

campos

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 Component 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

Complemento FormData

O complemento FormData permite solicitar dados a um cliente para disparar um evento. O formulário pode transferir a conversa para a Live ou realizar outros eventos que ainda não estão disponíveis.

Exemplo

campos

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 Component 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

Um input com esta property object será mostrada quando o valor do componente pai coincidir com o do filho. O object tem duas propriedades:

  • ref: O nome do campo pai.
  • value: O valor do input pai. Se este coincide com o do filho, então mostrará o filho.

A property requerida em um input com dependency property só se valida quando o input é mostrado.

No exemplo seguinte, se o usuário clica na caixa de verificação, os dois campos (nome e e-mail) serão mostrados.