Task
The Task resource represents the primary meaning of a user's text or speech when they interact with an Assistant.
Tasks should be modeled based on the intentions and tasks expected from end users. For instance, Tasks can be as simple as confirm or cancel actions or complex task-oriented actions like talk_to_sales or book_a_flight.
Once a Task is created, you should create Samples that define how people might express the task speaking naturally. A Task with Samples constitutes the core training data that creates your Assistant's Natural Language Understanding model.
All Autopilot REST API resources use the following base URL:
https://autopilot.twilio.com/v1
Task properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the Task resource. |
date_created
|
The date and time in GMT when the resource was created specified in RFC 2822 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in RFC 2822 format. |
friendly_name
|
The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. |
links
|
A list of the URLs of related resources. |
assistant_sid
|
The SID of the Assistant that is the parent of the resource. |
sid
|
The unique string that we created to identify the Task resource. |
unique_name
|
An application-defined string that uniquely identifies the resource. It can be used in place of the resource's |
actions_url
|
The URL from which the Assistant can fetch actions. |
url
|
The absolute URL of the Task resource. |
Create a Task resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks
Creates a new Task resource for the Assistant specified with {AssistantSid
} or {AssistantUniqueName
}.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the new resource. |
unique_name
Required
|
An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the |
friendly_name
Optional
|
A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. |
actions
Optional
|
The JSON string that specifies the actions that instruct the Assistant on how to perform the task. It is optional and not unique. |
actions_url
Optional
|
The URL from which the Assistant can fetch actions. |
Example 1
Example 2
Fetch a Task resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{Sid}
Returns the Task instance identified by the {TaskSid
}.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the resource to fetch. |
sid
Path
|
The Twilio-provided string that uniquely identifies the Task resource to fetch. |
Example 1
Read multiple Task resources
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks
Returns a list of Tasks for this Assistant. The list includes paging information.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the resources to read. |
Example 1
Update a Task resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{Sid}
Updates the Task instance identified by {TaskSid
} or {TaskUniqueName
}.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the resource to update. |
sid
Path
|
The Twilio-provided string that uniquely identifies the Task resource to update. |
friendly_name
Optional
|
A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. |
unique_name
Optional
|
An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the |
actions
Optional
|
The JSON string that specifies the actions that instruct the Assistant on how to perform the task. |
actions_url
Optional
|
The URL from which the Assistant can fetch actions. |
Example 1
Example 2
Delete a Task resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{Sid}
Deletes a Task.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the resources to delete. |
sid
Path
|
The Twilio-provided string that uniquely identifies the Task resource to delete. |
Example 1
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.