TORM JSONスキーマ

このページは以下のTORMリッチメディア要素のJSONスキーマを提供します。

  • テキスト/HTML
  • リストピッカー
  • クイック返信
  • タイムピッカー
  • リッチリンク
  • アダプティブカード

これらのTORM要素をスクリプトで使用できます。 コンタクトに送信するSNIPPETアクションに、これらを組み込むことができます。 要素を使用する前に、デジタルチャネルがその要素をサポートしていることを確認してください。

アウトバウンドAPIを使用して、これらの要素を直接送信できます。 このページのTORMの例は、アウトバウンドAPIのmessageContentパラメーターで使用するスキーマを示しています。

JSON 構造

このページで説明されている各 TORM 要素の JSON は、次のペイロード構造に適切にネストされている必要があります。 "を <rich content JSON> を TORM JSON に置き換えます。"

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

以下に例を示します。

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

テキスト/HTML

プレーンテキストまたは HTML コードでマークアップされたテキストを送信できます。

{
"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>"
 }
"postback": "postback-value"
}

リストピッカー

リストピッカーは、コンタクトが選択できるオプションのリストです。 オプションは通常、アイコンやタイトル、サブタイトルなど、豊富なフォーマット機能を備えたオーバーレイとして表示されます。 一般にリストピッカーでは、クイック返信よりも多くのオプションを使用できます。 TORMリストピッカーには、いくつかのチャネルベースの制限があります。 選択は会話の中で永続的です。

コンタクトはApple Messages for Businessチャネルで複数のオプションを選択できます。

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

クイック返信

クイック返信は、ボタン付きのテキストメッセージです。 コンタクトはいずれかのボタンをクリックできます。 クリックすると、その内容がアウトバウンドとして送信されます。 通常、返信が送られると、他のボタンをクリックすることはできなくなります。 TORMクイック返信には、いくつかのチャネルベースの制限があります

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

タイムピッカー

タイムピッカーを使用すると、コンタクトに予約のスケジュール設定などの時間の選択肢を提供できます。 TORMタイムピッカーには、いくつかのチャネルベースの制限があります。

{
"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
   }
 }
}

リッチリンク

リッチリンクは、画像プレビューとタイトルを含むURLで、クリックするとURLが開きます。 TORMリッチリンクには、いくつかのチャネルベースの制限があります。

{
 "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は、Microsoftが開発したプラットフォームに依存しないリッチメディアの送信方法です。 Adaptive Cardsは、デジタルクローズ済 Digital Experienceに関連するあらゆるチャネル、コンタクト、またはスキル。チャットチャネルクローズ済 コンタクトセンターにおける顧客とのインタラクションを促進するさまざまな音声およびデジタルのコミュニケーション媒体。でのみサポートされています。

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