Template Media Messages

Sends templates in various formats. type value is 13; each template has its own tmmtype:

Single Media Message

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:

Example: Waits for user feedback

Request
{        
    "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"                    
                	}
		 ]                
            }            
        }]        
    }    
}    
Fields
FieldValueDescription
*txnidstringRequest id value
*receiverobject
*typeintRecipient address type: 0 hashed, 1 all followers, 2 MSISDN
*addressstringAddress per type (hashed/omitted/MSISDN 905XXXXXXXXX)
*compositionobject
*listlistMessages to send; min 1
*typeintMessage 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.
*tmmtypeintTemplate type: 0 Single, 1 Multi, 2 Poll, 3 Quick Reply, 4 Sequential
*singletmmobject
*titlestringTemplate title
*descriptionstringTemplate description (required if no title)
*postbackidstringRequired if waiting for user feedback
*imageobjectTop image
*urlstringRedirect URL
*ratiostringHeight/width ratio
*buttonobjectButton on the image
*namestringButton label
*urlstringRedirect URL
*buttonlistlistButtons under the message
*typeint0: no feedback (url required), 1: expects feedback (payload required)
*namestringButton label
*urlstringRedirect URL (required if type 0)
*payloadstringReturned to service for type 1

Example: Does not wait for user feedback

Request
{        
    "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"                    
                }]                
            }            
        }]        
    }    
}   
Fields

Same as above.

Validations

image

button

buttonlist

Error Codes

resultcodeDescription
1054invalid tmm type
1055invalid tmm
1056invalid tmm title
1057invalid tmm description
1058missing tmm parameters
1059invalid tmm image
1060invalid tmm image button
1061invalid tmm button list
1062invalid tmm sublist
1063tmm sublist optionals dont match
1064invalid tmm poll id
1065invalid tmm poll end date
1066invalid tmm poll expire time
1067invalid tmm poll option
1068invalid tmm poll buttonname
1069invalid tmm postbackid
*** End Patch