TORM JSON 架构

部分 TORM 元素可用于 Scripts 中。您可以在 SNIPPET 操作中构建它们,以发送给联系人。在使用某个元素之前,请验证您使用的数字渠道是否支持该元素。

您可以使用Outbound API Icon of a square with an arrow point from the center through the top right corner.直接发送这些元素。

NiCE CXone 开发人员门户的 Outbound API 中提供了以下 TORM 富媒体元素的 JSON 架构:

  • 自适应卡
  • 列表选取器
  • 快速回复
  • 富链接
  • Text/HTML
  • 时间选取器

JSON 结构

本页面所述的每个 TORM 元素的 JSON 都必须正确嵌套在以下有效负载结构中。请将 <rich content JSON> 替换为 TORM JSON。

必填属性:type、payload

{
 "prompts": [{ 
   "mediaSpecificObject": {  
	"dfoMessage": {  
	  "messageContent": {	
		"type": "PLUGIN"
		"payload": {
		  [rich message payload]
		 }
		"fallbackText": "Text sent as fallback if external platform can't accept rich messages."
		"postback": "Value sent to system to identify what action the user takes"
		}	 
	   ]	   
	  } 	  
     }	
    }	
   }  
  } 
 ]
}

例如:

{
"prompts": [{ 
  "mediaSpecificObject": {  
    "dfoMessage": {   
      "messageContent": {	
        "type": "PLUGIN",	 
        "payload": {	
          "elements": [{	  
          "id": "bf2521f4-5e85-413f-b6ed-815d1c3905f0",
          "type": "TEXT",	   
          "fallbackText": "Text sent as fallback if external platform can't accept rich messages.",	  
          "text": "This is a successfully created outbound message."
          "mimeType": "text/html"     
        }]
        "postback": "postback-value"  
        "fallbackText": "Text sent as fallback if external platform can't accept rich messages." 
        } 	  
      }	
    }	
   }  
  }]	
}