Menu

Expand
Rate this page:

Data Transfer Objects

A Data Transfer Object (DTO) is an object that carries data from the client to the server or vice versa. If we want to refactor our code base, we reduce the probability that our API will break by creating DTOs.

Customer

A customer is a detailed description of a customer, including their associated channels.

Property

Type

Description

customer_id

String

The customer’s unique ID.

display_name

String

The customer’s display name.

channels

An array of Channel resources, optional

A list of channel addresses, used only on the Customer Details screen.

links

An array of Link resources, optional

A list of a customer’s links, used only on the Customer Details screen.

details

A Detail resource, optional

Additional information about the customer

avatar

String, optional

An absolute URL of the customer’s avatar image.


Channel

A channel is a customer contact address.

Property

Type

Description

type

Enum: sms, whatsapp, chat

The channel type.

value

String

The channel address.

Link

A link is a URL to additional information about a customer.

Property

Type

Description

type

String

The website or app name. Examples: Facebook, Salesforce.

value

String

An actual link, i.e., the site’s URL. Note: For the web version of Frontline, only https:// or mailto: protocols are accepted. All other protocols will be ignored.

display_name

String

The link’s display name.

Detail

A detail is a field that can be used to display additional information about a customer.

Property

Type

Description

title

String

The title of the detail section.

content

String

The additional information that is to be displayed. Can include multiple lines.

Example of a Data transfer Object for Customer:

Note: A whatsapp number is not required.

{
    "display_name": "Joseph Martin",
    "channels": [
        { "type": "sms", "value": "+15558675310" }, 
        { "type": "whatsapp", "value": "whatsapp:+15558675310" }
    ],
    "links": [
        { "type": "Facebook", "value": "https://www.facebook.com/josephmartin/", "display_name": "Facebook" }
    ],
    "details": {
         "title": "Purchase History",
         "content": "Product: Unobtanium\n\nDate: 2021-07-07\nQuantity: 1000 units\n\nSales rep: Jessie Robinson"
    }
}

Conversation

The Conversation resource is what binds Twilio Frontline users and customers together. Learn about the Conversation resource and how you can update one here.

Property

Type

Description

friendlyName

String, optional

The human-readable name of a conversation.

attributes.avatar

String, optional

An absolute URL to the conversation avatar image. A custom attributed defined by Twilio Frontline.

User

The User resource represents a Twilio Frontline user, who can log in into the app.

Property

Type

Description

friendlyName

String, optional

The user’s display name.

identity

String

The app user identity.

attributes.avatar

String, optional

An absolute URL to the user’s avatar image. A custom attribute defined by Twilio Frontline.

Participant

The Participant resource represents a customer in Twilio Frontline who is a non-chat conversation participant, i.e., via WhatsApp or SMS. Learn more about the Participant resource and how to update it here.

Property

Type

Description

attributes.customer_id

String

An ID used to tie together a conversation participant and a customer in your system. A custom attribute defined by Twilio Frontline.

attributes.avatar

String, optional

An absolute URL to the participant’s avatar image. A custom attribute defined by Twilio Frontline

attributes.display_name

String, optional

The participant’s display name. A custom attribute defined by Twilio Frontline.

Template

A Template is a predefined message with placeholders for custom variables.

Property

Type

Description

content

String

The message string.

whatsAppApproved

Boolean, optional

A flag which shows whether a template has been approved by Facebook.

Template Category

A Category is an object that groups together similar templates.

Property

Type

Description

display_name

String

The Category’s title.

templates

An array of Template resources

The list of templates that are members of the Category.

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.

        
        
        

        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!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more