Component Object
The object containing the component to fill available message template parameter(s) with text, currency, date-time, document, image, video, or button. Each type has different requirements.
Currency
Example
{
"type": "body",
"parameters":
[ {
"type": "currency",
"currency":
{
"fallback_value": "VALUE",
"code": "USD",
"amount_1000": 1000
}
} ]
}
Properties
type
: "header", "body" — type of component, can be either header or body. Text-based templates only support the type=body and only text components.parameters
: CurrencyObject[] — array of parameter objects with the content of the message. Array can contain a mix of different component parameter types.
Button
The object containing the component to fill a message template parameter(s) with a button.
Example
{
"type": "button",
"sub_type": "quick_reply",
"index": "0",
"parameters": [
{
"type": "payload",
"payload": "PAYLOAD"
}
]
}
Properties
type
: "button" — the type of component, can only be the value button.sub_type
: "quick_reply" or "url" — quick_reply refers to a previously created quick reply button that allows for the customer to return a predefined message. url refers to a previously created button that allows the customer to visit the URL generated by appending the text parameter to the predefined prefix URL in the template.index
: string (optional) — position index of the button. You can have up to 3 buttons using index values of 0 to 2.parameters
: ButtonParameterObject[] — array of button parameter objects. Can be either Quick Reply Button Parameter Object or URL Button Parameter Object that matches sub_type.
Date-time
Example
{
"type": "body",
"parameters":
[ {
"type": "date_time",
"date_time":
{
"fallback_value": "MONTH DAY, YEAR"
}
} ]
}
Properties
type
: "header", "body" — type of component, can be either header or body. Text-based templates only support the type=body and only text components.parameters
: DateTimeObject[] — array of parameter objects with the content of the message. Array can contain a mix of different component parameter types.
Document
Example
{
"type": "body",
"parameters":
[ {
"type": "document",
"image":
{
"link": new URL( "https://www.example.com/DOCUMENT.PDF" ).href
}
} ]
}
Properties
type
: "header", "body" — type of component, can be either header or body. Text-based templates only support the type=body and only text components.parameters
: DocumentMediaObject[] — array of parameter objects with the content of the message. Array can contain a mix of different component parameter types.
Image
Example
{
"type": "body",
"parameters":
[ {
"type": "image",
"image":
{
"link": new URL( "https://www.example.com/IMAGE.PNG" ).href
}
} ]
}
Properties
type
: "header", "body" — type of component, can be either header or body. Text-based templates only support the type=body and only text components.parameters
: ImageMediaObject[] — array of parameter objects with the content of the message. Array can contain a mix of different component parameter types.
Text
Example
{
"type": "body",
"parameters":
[ {
"type": "text",
"text": "TEXT_STRING"
} ]
}
Properties
type
: "header", "body" — type of component, can be either header or body. Text-based templates only support the type=body.parameters
: TextObject[] — array of parameter objects with the content of the message. Array can contain a mix of different component parameter types.
Video
Example
{
"type": "body",
"parameters":
[ {
"type": "video",
"image":
{
"link": new URL( "https://www.example.com/VIDEO.MP4" ).href
}
} ]
}
Properties
type
: "header", "body" — type of component, can be either header or body. Text-based templates only support the type=body and only text components.parameters
: VideoMediaObject[] — array of parameter objects with the content of the message. Array can contain a mix of different component parameter types.