ContentData

interface ContentData

Represents one data type in rich content template. For more details see: https://www.twilio.com/docs/content-api/content-types-overview

Types

Link copied to clipboard
interface Action

The following parameters are used as an array in the CallToAction.actions and DataCard.actions.

Link copied to clipboard
data class CallToAction(    val body: String,     val actions: List<ContentData.Action>,     val rawData: String = "") : ContentData

Buttons let recipients tap to trigger actions such as launching a website or making a phone call. Represents the twilio/call-to-action content type.

Link copied to clipboard
data class ContentDataRaw(val rawData: String) : ContentData

Used for unknown content types, which aren't present in the current version of Conversations SDK.

Link copied to clipboard
data class DataCard(    val title: String,     val subtitle: String? = null,     val media: List<String> = emptyList(),     val actions: List<ContentData.Action> = emptyList(),     val rawData: String = "") : ContentData

Includes a menu of up to 10 options, which offers a simple way for users to make a selection. Represents the twilio/card content type.

Link copied to clipboard
data class ListItem(    val id: String,     val item: String,     val description: String? = null)

Represents one item in the ListPicker.

Link copied to clipboard
data class ListPicker(    val body: String,     val button: String,     val items: List<ContentData.ListItem>,     val rawData: String = "") : ContentData

Includes a menu of up to 10 options, which offers a simple way for users to make a selection. Represents the twilio/list-picker content type.

Link copied to clipboard
data class Location(    val longitude: Double,     val latitude: Double,     val label: String? = null,     val rawData: String = "") : ContentData

Contains a location pin and an optional label, which can be used to enhance delivery notifications or connect recipients to physical experiences you offer. Represents the twilio/location content type.

Link copied to clipboard
data class Media(    val body: String? = null,     val media: List<String>,     val rawData: String = "") : ContentData

Used to send file attachments, or to send long text via MMS in the US and Canada. Represents the twilio/media content type.

Link copied to clipboard
data class QuickReply(    val body: String,     val replies: List<ContentData.Reply>,     val rawData: String = "") : ContentData

Let recipients tap, rather than type, to respond to the message. Represents the twilio/quick-reply content type.

Link copied to clipboard
data class Reply(val title: String, val id: String? = null)

Shows a button that sends back a predefined text. Used in QuickReply.replies.

Link copied to clipboard
data class Text(val body: String, val rawData: String = "") : ContentData

Contains only plain text-based content. Represents the twilio/text content type.

Properties

Link copied to clipboard
abstract val rawData: String

Full data as stringified JSON. Can be used for new content types and fields which are not supported in the current version of Conversations SDK.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard