Menu

Expand
Rate this page:

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
sid<AC> Not PII

The SID of the Account that created the Field resource.

date_created
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in RFC 2822 format.

date_updated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in RFC 2822 format.

field_type
string Not PII

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
sid<UD> Not PII

The SID of the Task resource associated with this Field.

assistant_sid
sid<UA> Not PII

The SID of the Assistant that is the parent of the Task associated with the resource.

sid
sid<UE> Not PII

The unique string that we created to identify the Field resource.

unique_name
string Not PII

An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.

url
url Not PII

The absolute URL of the Field resource.

Create a Field resource

post
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
post sid_like<UA> Not PII

The SID of the Assistant that is the parent of the Task associated with the new resource.

task_sid
Path
post sid_like<UD> Not PII

The SID of the Task resource associated with the new Field resource.

field_type
Required
post string Not PII

The Field Type of the new field. Can be: a Built-in Field Type, the unique_name, or the sid of a custom Field Type.

unique_name
Required
post string Not PII

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 sid in the URL path to address the resource.

Example 1
Loading Code Sample...
        
        

        Create a Field for a given Task

        Fetch a Field resource

        get
        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
        get sid_like<UA> Not PII

        The SID of the Assistant that is the parent of the Task associated with the resource to fetch.

        task_sid
        Path
        get sid_like<UD> Not PII

        The SID of the Task resource associated with the Field resource to fetch.

        sid
        Path
        get sid_like<UE> Not PII

        The Twilio-provided string that uniquely identifies the Field resource to fetch.

        Example 1
        Loading Code Sample...
              
              

              Fetch a Field

              Read multiple Field resources

              get
              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
              get sid_like<UA> Not PII

              The SID of the Assistant that is the parent of the Task associated with the resources to read.

              task_sid
              Path
              get sid_like<UD> Not PII

              The SID of the Task resource associated with the Field resources to read.

              Example 1
              Loading Code Sample...
                    
                    

                    Read: List all Fields for a given Task

                    Delete a Field resource

                    delete
                    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
                    delete sid_like<UA> Not PII

                    The SID of the Assistant that is the parent of the Task associated with the resources to delete.

                    task_sid
                    Path
                    delete sid_like<UD> Not PII

                    The SID of the Task resource associated with the Field resource to delete.

                    sid
                    Path
                    delete sid_like<UE> Not PII

                    The Twilio-provided string that uniquely identifies the Field resource to delete.

                    Example 1
                    Loading Code Sample...
                          
                          

                          Delete a Field

                          Rate this page:

                          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.

                          Loading Code Sample...
                                
                                
                                

                                Thank you for your feedback!

                                Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                Sending your feedback...
                                🎉 Thank you for your feedback!
                                Something went wrong. Please try again.

                                Thanks for your feedback!

                                thanks-feedback-gif