Sends templates in various formats. type value is 13; each template has its own tmmtype:
A media message with one photo, title, description, and optional buttons. If buttons are sent, users can click to perform actions (open a URL or send a message to the service). Two modes:
postbackid to track the message and payload to track the selected button.postbackid/payload omitted.{
"txnid": "200",
"receiver": {
"type": 2,
"address": "90XXXXXXXXX"
},
"composition": {
"list": [{
"type": 13,
"tmmtype": 0,
"singletmm": {
"title": "Single Template Message",
"postbackid": "134",
"image": {
"url":"https://timsac.turkcell.com.tr/scontent/p2p/14112016/11/P1e646f5c03a7b4b44f6da1329ac218e322da72356e79e5116dff86e3fc255a228.png",
"ratio": 1.0,
"button": {
"name": "First button",
"url": "https://timsac.turkcell.com.tr/scontent/p2p/14112016/11/P1e646f5c03a7b4b44f6da1329ac218e322da72356e79e5116dff86e3fc255a228.png"
}
},
"buttonlist": [
{
"type": 1,
"name": "First button",
"payload": "Istanbul"
},
{
"type": 1,
"name": "Second button",
"payload": "Ankara"
}
]
}
}]
}
}
| Field | Value | Description |
|---|---|---|
| *txnid | string | Request id value |
| *receiver | object | |
| *type | int | Recipient address type: 0 hashed, 1 all followers, 2 MSISDN |
| *address | string | Address per type (hashed/omitted/MSISDN 905XXXXXXXXX) |
| *composition | object | |
| *list | list | Messages to send; min 1 |
| *type | int | Message type. 0 Text, 2 Photo, 3 Audio, 4 Video, 5 Sticker, 6 Caps, 7 Location, 9 Finish Line, 10 Contact, 13 Template Media Message, 14 Document. |
| *tmmtype | int | Template type: 0 Single, 1 Multi, 2 Poll, 3 Quick Reply, 4 Sequential |
| *singletmm | object | |
| *title | string | Template title |
| *description | string | Template description (required if no title) |
| *postbackid | string | Required if waiting for user feedback |
| *image | object | Top image |
| *url | string | Redirect URL |
| *ratio | string | Height/width ratio |
| *button | object | Button on the image |
| *name | string | Button label |
| *url | string | Redirect URL |
| *buttonlist | list | Buttons under the message |
| *type | int | 0: no feedback (url required), 1: expects feedback (payload required) |
| *name | string | Button label |
| *url | string | Redirect URL (required if type 0) |
| *payload | string | Returned to service for type 1 |
{
"txnid": "200",
"receiver": {
"type": 2,
"address": "90XXXXXXXXXX"
},
"composition": {
"list": [{
"type": 13,
"tmmtype": 0,
"singletmm": {
"title": "Single Template Message",
"description": "Sample without feedback",
"image": {
"url": "https://timsac.turkcell.com.tr/scontent/p2p/14112016/11/P1e646f5c03a7b4b44f6da1329ac218e322da72356e79e5116dff86e3fc255a228.png",
"ratio": 1.0,
"button": {
"name": "First button",
"url": "https://timsac.turkcell.com.tr/scontent/p2p/14112016/11/P1e646f5c03a7b4b44f6da1329ac218e322da72356e79e5116dff86e3fc255a228.png"
}
},
"buttonlist": [{
"type": 0,
"name": "First button",
"url": "https://timsac.turkcell.com.tr/scontent/p2p/14112016/11/P1e646f5c03a7b4b44f6da1329ac218e322da72356e79e5116dff86e3fc255a228.png"
}, {
"type": 0,
"name": "Second button",
"url": "https://timsac.turkcell.com.tr/scontent/p2p/14112016/11/P1e646f5c03a7b4b44f6da1329ac218e322da72356e79e5116dff86e3fc255a228.png"
}]
}
}]
}
}
Same as above.
tmmtype cannot be null/empty. [1054]singletmm cannot be null/empty. [1055]title max 200 chars. [1056]description max 400 chars. [1057]title and description cannot both be empty. [1058]image
url max 512 chars, mime type image/*. [1059]ratio cannot be null/empty; must be 0.1–3. [1059]button
name cannot be null/empty; max 20 chars. [1060]url cannot be null/empty; max 512 chars. [1060]buttonlist
type cannot be null/empty. [1061]name cannot be null/empty; max 20 chars. [1061]url max 512 chars. [1061]type is 0, payload must not be sent; if type is 1, url must not be sent. [1061]| resultcode | Description |
|---|---|
| 1054 | invalid tmm type |
| 1055 | invalid tmm |
| 1056 | invalid tmm title |
| 1057 | invalid tmm description |
| 1058 | missing tmm parameters |
| 1059 | invalid tmm image |
| 1060 | invalid tmm image button |
| 1061 | invalid tmm button list |
| 1062 | invalid tmm sublist |
| 1063 | tmm sublist optionals dont match |
| 1064 | invalid tmm poll id |
| 1065 | invalid tmm poll end date |
| 1066 | invalid tmm poll expire time |
| 1067 | invalid tmm poll option |
| 1068 | invalid tmm poll buttonname |
| 1069 | invalid tmm postbackid |
| *** End Patch |