The Autopilot Request
When a Task is triggered, Autopilot makes a request to the URL configured on the Task that will always include the parameters listed below. Autopilot also makes the same request if the dialogue is redirected to another Task using the Redirect Action or sent to a human using the Handoff Action.
For each request, Autopilot expects a valid Actions JSON in your response. For example, you might respond with:
// A potential response to the Autopilot request, which would SAY hello before listening for further input.
{
"actions": [
{
"say": "Hi there! I'm Jaimie your new Assistant. How can I help you?"
},
{
"listen": true
}
]
}
Autopilot will send these parameters either as POST parameters, in the format application/x-www-form-urlencoded
, or URL query parameters, depending on which HTTP method you've configured.
Parameter | Description | Example |
AccountSid | Your Twilio account ID. It is 34 characters long, and always starts with the letters AC. | ACXXXXX |
AssistantSid | The Autopilot assistant ID. It is 34 characters long, and always starts with UA. | UAXXXXX |
DialogueSid | The session identifier. It is 34 characters long, and always starts with the letters UK. | UKXXXXX |
UserIdentifier | The unique user identifier coming from the channel. For Voice and SMS it will be the user's phone number. | +18304765664 |
CurrentInput | The last thing the user said. | "I want to change my appointment" |
CurrentTask | The user's current task. | change_appointments |
Field_{field-name}_Value | The key-value pair of the field value recognized. A different key-value pair will be sent for each field value. | Field_CLAIM_NUMBER_Value |
Field_{field-name}_Type | The key-value pair of the field type recognized. A different key-value pair will be sent for each field type. | Twilio.ALPHANUMERIC |
DialoguePayloadUrl | A URL to the Dialogue JSON payload that contains the context and data collected during the Autopilot session. | https://autopilot.twilio.com/v1/Assistants/UAXXXX/Dialogues/UKXXXX |
Memory |
A JSON Payload that contains all the Autopilot memory values. NOTE: Memory is only sent in POST requests to prevent query params from getting truncated. |
|
Channel |
The channel the interaction is taking place. |
SMS |
CurrentTaskConfidence | The confidence score for the task detected. It can take values from 0.00 to 1.00, and fallback will only occur when the confidence is null/not set. | 0.7 |
NextBestTask | The task with the next highest confidence score | cancel_appointment |
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.