Outbound integrations

SupportAI provides an option to integrate the robot with third-party services and applications. This simplifies the solution of many day-to-day tasks.
  1. Introduction
  2. Getting started
  3. Creating integrations
  4. Testing integrations

Introduction

Integrations are implemented using APIs.

An API is a technical solution that allows two systems to communicate without human intervention.

You can use APIs to:

  • Automatically create and confirm orders.
  • Show up-to-date information on your site.
  • Update customers on their order status and more.

Getting started

Before setting up an integration, read the service's API documentation. Prepare the necessary information:

  1. System host to be accessed.
  2. Type or types of requests.
  3. Authorization method and parameters.

Creating integrations

To create a new integration, go to Integrations, then click .

Enter the integration Title and Description.

Move on to the request setup. Specify the Request method. The method defines the action to be performed. The following methods are allowed in SupportAI:

  • GET: This method is used to get (read) data (for example, a list of users).
  • POST: Used to add new data.
  • PUT/PATCH: Used to update data.
  • DELETE: Used to delete data.

Set up Authorization. Acceptable authorization methods:

  • No authorization.
  • By login. Specify your login and password according to the documentation for the connected API.
  • By token. Specify the header and token.
  • With TVM. Specify the service.

In the URL field, specify the host of the service for which you are setting up the integration. The robot will use the specified URL to receive or send data.

You can add variables to the request URL. The format can be different, for example:

  • https://example.com?query=${varname}
  • https://${varname}/endpoint
  • ${varname}: If the variable stores a full URL of the request

Where varname means the name of the variable (feature). The variable is added in curly brackets.

The Headers section usually includes metadata, authorization parameters, host details, and so on.

You can also use variables or features in headers. Specify them without curly brackets.

For all requests except GET, you can specify the request body and body format.

In your requests, you can send media files, for example, screenshots provided by your customer. For this, specify the following parameters:

  1. Request format: Form-data.
  2. From: Select From last user message (if you want to send data from the last user message) or Enter manually (if you want to test your request). In this case, specify a link to access the file (the file will need to be uploaded to the hosting first).

In the request body, you can specify data in JSON format, as well as add variables. When adding variables to a JSON object, consider the type of data in the variable. For example, if a variable contains a number, use it without quotes. If a variable contains string data, enclose it in quotation marks.

In this section, you can specify which data you want to get from the request response.

  • Feature: From the drop-down list, select the feature for which you want to obtain the data.
  • Jsonpath: Specify the value of the feature. Responses to your API requests usually arrive in JSON format. To get the data, access the fields of this object. For example, to save the temp value from the data field to a new variable, use $.data[0].temp as jsonpath.

If the request is executed successfully, the robot will write the values from the resulting response to the selected features.

Testing integrations

  1. To test your integration settings, toggle on Integration enabled, then click Test. The Integration testing panel opens.
    Attention. Before saving the integration, test it and make sure it contains no errors.
  2. Enter the value of the feature. If you are transmitting a media file with the last user message option, enter a link to upload the file (this is needed to test the integration).
  3. To view the request text, click Preview request. If everything is right, click Send request.
  4. You'll see the response under Features and received values. You can view the request variable, response features, and status code. Status code 200 means that the request was executed successfully. For the values of other status codes, see the API documentation.
  5. If the test is successful, click Back to integration, then click Save.