Warning: Due to the sunset of Twilio Autopilot on August 25, 2023, this Endpoint will be removed in the near future. Consequently, the Endpoint will become unavailable.

This page describes the necessary steps for creating and connecting Twilio Autopilot to a Twilio Autopilot Endpoint within Cognigy.AI.

This How-to covers the necessary steps for creating and connecting Twilio Autopilot to a Twilio Autopilot Endpoint within Cognigy.AI. If you want to get more information about assigning a Flow to the Endpoint and setting up the Data Management, see Endpoints.

Two Step Process

1 Create and Configure a Twilio Autopilot Endpoint within Cognigy.AI
2 Create an Autopilot within Twilio

1 Create and Configure a Twilio Autopilot Endpoint

Location: Cognigy.AI

First, let's create a Twilio Autopilot Endpoint in Cognigy.AI. In order to do so, navigate to your Project, click on the button the lower-left corner and create an Endpoint.

TWILIOAUTO.PNGFigure 1.1: Creating a Twilio Autopilot Endpoint

After you have created the Endpoint, go ahead an select a Flow your new Endpoint should connect with. You can optionally also change the NLU Connector this Endpoint will use. Copy the Endpoint URL found in the Endpoint settings for use when setting up the connection in the Twilio console.

TWILIOAUTO2.PNGFigure 1.2: Locating the Twilio Autopilot Endpoint URL


1.1 NLU Connector

Per default, the Twilio Autopilot Endpoint will use our integrate NLU engine, but you can change this. Twilio Autopilot brings its own NLU capabilities and sends certain NLU output to Cognigy.AI. In order to use the full output, you have to select the Twilio Autopilot (Built-in) Connector. Once this Connector was selected, Cognigy.AI will automatically translate their NLU output object to our internal format.

1.2 Parse Slots

Optionally and in addition to the Twilio Autopilot (Built-in) Connector you can enable the Parse Slots functionality which you can find in the Twilio Autopilot Settings panel.


Figure 1.3: Enabling Parse Slots

Once this setting is enabled, we will use Cognigy NLU slot-parsing in addition to the slots being delivered from Twilio Autopilot. This way you can use the full power of Cognigy.AI lexicons in addition to the output from Twilio Autopilot.


Using the COGNIGY NLU Connector

If you choose Cognigy NLU as the NLU Connector, then the Parse Slots setting will be disabled, since you are then always using Cognigy.AI NLU to parse the sentence and find Slots.

2 Create an Autopilot

Location: Twilio Console

✔ Endpoint URL

Login into the Twilio Console, select All Products & Services from the left navigation and click on Autopilot (see Figure 1.1).

Figure 2.1: Creating a Twilio Autopilot

The Getting Started with Autopilot page should open. Select Create a new Bot. You can now either choose to use one of the provided templates, or start from scratch. In this how-to will will start from scratch.

You have to give your bot a unique name and a description or friendly name (see Figure 1.2).

Figure 2.2: Create a new Twilio Autopilot from scratch

You should now be redirect to the tasks section. Twilio Autopilot Tasks behave a bit like Intents within Cognigy.AI. Tasks usually have example sentences and you need to let them train a model which will then be used to understand user utterances. Once a task was found on the Twilio Autopilot side, the programmed action will be triggered

One of these actions can be to notify Cognigy.AI through our Endpoint we have already created. This way, you can combine Twilio Autopilots NLU capabilities which the power of Cognigy.AI and its Flow Editor.

Select one of the Tasks and click on Program. A code editor will open where you can paste in any valid JSON object. Try the following snippet and remember to replace the URL with your Endpoint URL.

  "actions": [
      "redirect": "https://endpoint-demo.Cognigy.AI/xxxxx"

Copy in the snippet and click on Save edits. Now go back and click on Channels in the left navigation. You can now select one of the supported channels. Please consult the Twilio Autopilot documentation for more information.

Let's create a Programmable Voice channel for this how-to. Select Programmable Voice and copy the Voice URL.

Select the All Products & Services option in the left side navigation and click on #Phone Numbers. Select one of your available phone numbers or order a new one and put in the copied Voice URL into the A Call comes in field (see Figure 1.3).

Figure 2.3: Installing the Voice URL as a Webhook for incoming calls



Please sign in to leave a comment.

Was this article helpful?
0 out of 0 found this helpful