TORM JSON Schemas

This page provides the JSON schemas for the following TORM rich media elements:

  • Text/HTML
  • List pickers
  • Quick replies
  • Time pickers
  • Rich links
  • Adaptive cards

These are the TORM elements that are available to be used in scripts. You can build them in a SNIPPET action to send to contacts . Before using an element, verify that the digital channel you're working with support that element.

You can send these elements directly using the Outbound API. The TORM examples on this page are show the schema to follow for the Outbound API's messageContent parameter.

JSON Structure

The JSON for each TORM element described on this page must be properly nested in the following payload structure: 

{
 "prompts": [{ 
   "mediaSpecificObject": {  
	"dfoMessage": {  
	  "messageContent": {	
		[rich content JSON]	   
		}	 
	   ]	   
	  } 	  
     }	
    }	
   }  
  } 
 ]
}

For example: 

{
 "prompts": [{ 
   "mediaSpecificObject": {  
	"dfoMessage": {  
	  "messageContent": {	
		"type": "PLUGIN",	 
		"payload": {	
			"elements": [{	  
				"id": "bf2521f4-5e85-413f-b6ed-815d1c3905f0",
	   			"type": "FILE",	   
				"filename": "photo.jpg",	  
				"url": "https://www.nice.com/-/media/niceincontact/layout/nice-logo-web-header/nice-web-logo.ashx",	   
				"mimeType": "image/jpeg"	   
				}	 
			   ]	   
			 } 	  
			}	
		  }	
		}  
	 } 
	]
}

Text/HTML

You can send plain text or text marked up with HTML code.

{
"type": "TEXT",
"fallbackText": "Text sent as fallback if external platform can't accept rich messages.",
"payload": {
  "text": "<p><b>This</b> is a successfully created outbound message.</p>"
 }
}

List Picker

A list picker is a list of options the contact can choose from. The options are typically shown in an overlay with richer formatting capabilities, such as icons, titles, and subtitles. List pickers generally allow for more options than quick replies. TORM list pickers have some channel-based limitations. Selections are persistent in the conversation.

Contacts can select more than one option on Apple Messages for Business channels.

{
"type": "LIST_PICKER",
"fallbackText": "Text sent as fallback if external platform can't accept rich messages.",
"payload": {
	"title": {
	 "content": "Choose a color!"	
 	  },
	"text": {
	 "content": "What is your favorite color?"
	  },
	"options": {
	  "multiselect": false
	  }
	"actions": [
	  {
	   "type": "REPLY_BUTTON",
	   "icon": {
		 "fileName": "place-kitten.jpg",
		 "url": "https://placekitten.com/200/300",
		 "mimeType": "image/jpeg"
		 },
	   "text": "red",
	   "description": "Like a tomato",
	   "postback": "/red"
	   },
      {
      "type": "REPLY_BUTTON",
      "icon": {
      "fileName": "place-kitten.jpg",
      "url": "https://placekitten.com/200/300",
      "mimeType": "image/jpeg"
       },
    "text": "Green",
    "description": "Like an apple",
    "postback": "/green"
     }
   ]
}

Quick Replies

A quick reply is a text message with buttons. The contact can click one of the buttons. After a click, its content is sent as outbound. Usually, when a reply is sent, it is not possible to click other buttons. TORM quick replies have some channel-based limitations.

{
 "type": "QUICK_REPLIES",
 "fallbackText": "Text sent as fallback if external platform can't accept rich messages.",
 "payload": {
    "text": {
	"content": "Hello, we will deliver the package between 12:00 and 16:00. Please specify which day."
  },
 "actions": [
    {
	  "type": "REPLY_BUTTON",
	  "text": "Today",
	  "postback": "{\"id\":\"1\"}"
	},
	{
	  "type": "REPLY_BUTTON",
	  "text": "Tomorrow",
	  "postback": "{\"id\":\"2\"}"
	}
  ]
}
}

Time Picker

Time pickers allow you to offer the contact a choice of times, such as for scheduling appointments. TORM time pickers have some channel-based limitations.

{
"type": "TIME_PICKER",
"fallbackText": "Text sent as fallback if external platform can't accept rich messages.",
"payload": {
  "title": {
  "content": "Check our new gadget!"
  },
"timeSlots": [
  {
    "id": "unique-id",
	"duration": 3600,
	"startTime": "2017-05-26T08:27:55+00:00"
  }
],
"location": {
  "title": {
    "content": "Check our new gadget!"
   },
  "latitude": 44.44,
  "longitude": 55.55,
  "radius": 33.3
   }
 }
}

A rich link is a URL with an image preview and title that can be clicked to open the URL. TORM rich links have some channel-based limitations.

{
 "type": "RICH_LINK",
 "fallbackText": "Text sent as fallback if external platform can't accept rich messages.",
 "payload": {
 	"media": {
	  "fileName": "place-kitten.jpg",
	  "url": "https://placekitten.com/200/300",
	  "mimeType": "image/jpeg"
    	},
  "title": {
    "content": "Check our new gadget!"
   },
  "url": "https://www.google.com"
 }
}

Adaptive Cards

Adaptive Cards are a platform-independent method of sending rich media developed by Microsoft. Adaptive Cards are only supported on digitalClosed Any channel, contact, or skill associated with Digital Experience. chat channelsClosed Various voice and digital communication mediums that facilitate customer interactions in a contact center..

{
"type": "ADAPTIVE_CARD",
"fallbackText": "Url sent: https://placekitten.com",
"payload": {
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.5",
  "body": [{
    "type": "Image",
    "url": "https://placekitten.com/200/300",
	"spacing": "none",
	"size": "stretch"
  }],
  "actions": [{
    "type": "Action.OpenUrl",
	"title": "Show me the cats!",
	"url": "https://placekitten.com"
  }]   
 }
}