Aivo for developers

Create your own integrations

Endpoint Parameters

All the structures that make up the call to an endpoint must be in JSON format.

Form Configuration

Steps create the endpoints that make up the integration. There are different types of steps for each specific action of the bot.

Data Form Integration

Add a data form integration to your answers and provide your customers with customized information, like their order status or credit card balance. These forms request data taken from the web service you use and show that information to the customer. To create a form you can use the following JSON format:

Parameters:

  • type: The type of form input.
  • label: The label of form input that the user will see in the field to indicate which value will be entered.
  • ref: The reference that will be used in the integration to obtain the value that the user enters in the required field. It must be written in lowerCamelCase.
  • required: Indicates whether the field is mandatory or not.

JSON: STEP FORM

How is the data received?

The data is sent via POST method and in a row. It can be received by each input reference:

PHP Code:

Response to be sent to the bot:

Once the form data is received and the client processes it, you must return a response in JSON format to the bot as follows:

  • answer: It is the response that will be shown in the bot. It must be string type or JSON encoded.
  • answer_clean: It is the response that will be shown on channels that don’t support certain complements (like Facebook). It must be string type or JSON encoded.
  • complements: It will be JSON type. If you want to add complements to the answer, such as buttons, you can find the JSONs in the complement documentation.

Response without complements

Response with complements

Email Form Integration

Email form integrations gives you the possibility to collect customers’ data and send it to an email account configured in the JSON code. By adding them to your bot’s answers, you’ll be able to generate leads or get support case details easily.

Parameters:

  • emailTo: The recipient email (overridden by body params).
  • emailSubject: The subject of the email (overridden by body params).
  • senderMessage: The message that the user sees once the email is sent.
  • required: Indicates whether the field is mandatory or not.

JSON: EMAIL FORM