Field
A Field is an attribute that you expect will give specific details about the intent expressed by the end-user, such as a time, date, or number.
Each Task may have a distinct set of Fields associated with it.
Every Field has a Field Type associated with it. For example: for the task orderStatus, a relevant Field for might be orderStatus_orderNumber with a Field Type of orderNumber.
Fields are then used in Samples to train the Assistant model on where to look for the given attributes. For example, I want to know if my order {orderStatus_orderNumber} shipped.
All Autopilot REST API resources use the following base URL.
https://autopilot.twilio.com/v1/
Field properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the Field 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. |
field_type
|
The Field Type of the field. Can be: a Built-in Field Type, the unique_name, or the SID of a custom Field Type. |
task_sid
|
The SID of the Task resource associated with this Field. |
assistant_sid
|
The SID of the Assistant that is the parent of the Task associated with the resource. |
sid
|
The unique string that we created to identify the Field resource. |
unique_name
|
An application-defined string that uniquely identifies the resource. It can be used in place of the resource's |
url
|
The absolute URL of the Field resource. |
Create a Field resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{TaskSid}/Fields
Creates a new Field subresource for the Task. Make sure to use Built-in Field Types when possible.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the Task associated with the new resource. |
task_sid
Path
|
The SID of the Task resource associated with the new Field resource. |
field_type
Required
|
The Field Type of the new field. Can be: a Built-in Field Type, the |
unique_name
Required
|
An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the |
Example 1
Fetch a Field resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{TaskSid}/Fields/{Sid}
Returns the Task Field instance identified by {FieldSid
}.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the Task associated with the resource to fetch. |
task_sid
Path
|
The SID of the Task resource associated with the Field resource to fetch. |
sid
Path
|
The Twilio-provided string that uniquely identifies the Field resource to fetch. |
Example 1
Read multiple Field resources
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{TaskSid}/Fields
Returns a list of Fields for the specified Task. 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 Task associated with the resources to read. |
task_sid
Path
|
The SID of the Task resource associated with the Field resources to read. |
Example 1
Delete a Field resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/Tasks/{TaskSid}/Fields/{Sid}
Deletes a Field.
Fields cannot be associated with any Samples if they are to be successfully deleted.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the Task associated with the resources to delete. |
task_sid
Path
|
The SID of the Task resource associated with the Field resource to delete. |
sid
Path
|
The Twilio-provided string that uniquely identifies the Field 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.