# Data Transfer Objects

## Customer

A **customer** is a detailed description of a customer, including their associated [channels](#channel).

| **Property**   | **Type**                                            | **Description**                                                         |
| -------------- | --------------------------------------------------- | ----------------------------------------------------------------------- |
| `customer_id`  | String                                              | The customer's unique ID.                                               |
| `display_name` | String                                              | The customer's display name.                                            |
| `channels`     | An array of [Channel](#channel) resources, optional | A list of channel addresses, used only on the Customer Details screen.  |
| `links`        | An array of [Link](#link) resources, optional       | A list of a customer's links, used only on the Customer Details screen. |
| `details`      | A [Detail](#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.

```json
{
    "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](/docs/conversations/api/conversation-resource).

| **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 attribute defined by Twilio Frontline. |

## User

The **User** resource represents a Twilio Frontline user, who can log 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](/docs/conversations/api/conversation-participant-resource).

| **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](/docs/whatsapp/tutorial/send-whatsapp-notification-messages-templates#creating-message-templates-and-submitting-them-for-approval). |

## 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](/docs/frontline/data-transfer-objects#template) resources | The list of templates that are members of the Category. |
