DFOチャットチャネルJSONスキーマ

DFOライブチャット閉じた エージェントと連絡先はリアルタイムで対話しますまたはチャットメッセージング閉じた 連絡先がいつでもチャットメッセージを送信し、返信を待つ非同期チャットチャネルでメッセージを送信する場合は、次のスキーマを使用します。これらのスキーマの要素に使用されるすべてのIDは一意でなければなりません。ただし、ポストバックのように、以前に定義した要素を参照して、その要素にイベントが発生することを確認する場合は例外です。

以下のスキーマはヘルプサイトで利用できます:

  • カルーセル
  • イメージ
  • マークダウン
  • 1つのレスポンスに複数のメッセージ
  • プロンプト
  • クイックリプライ
  • テキスト
  • URL

スキーマは以下の通りです。また、各スキーマのJSONテキストファイルを含むZIPファイルをダウンロードすることもできます。

DFOミラーツールを使用して、ライブチャットチャネルで使用する予定のJSONを検証します。

カルーセル

{
"prompts": [{
"mediaSpecificObject": {
"dfoMessage": {
"messageContent": {
"type": "PLUGIN",
"payload": {
	"elements": [
	{
	"id": "Ek4tPy1h4",
	"type": "MENU",
	"elements": [
	{
	"id": "Uk4tPy1h2",
	"type": "FILE",
	"url": "https://picsum.photos/300/150",
	"filename": "photo.jpg",
	"mimeType": "image/jpeg"
	},
	{
	"id": "Ck4tPy1h3",
	"type": "TITLE",
	"text": "Hello!"
	},
	{
	"id": "Ek4tPy1h1",
	"type": "TEXT",
	"text": "Lorem Impsum..."
	},
	{
	"id": "Nkm0hRAiE",
	"type": "BUTTON",
	"text": "Click me!",
	"postback": "click-on-button-1"
	},
	{
	"id": "EyCyTRCi4",
	"type": "BUTTON",
	"text": "Aww don`t click on me",
	"postback": "click-on-button-2"
	}
	]
	},
	{
	"id": "Ek4tPy1h52",
	"type": "MENU",
	"elements": [
		{
		"id": "Uk4tPy1h22",
		"type": "FILE",
		"url": "https://picsum.photos/300/150",
		"filename": "photo.jpg",
		"mimeType": "image/jpeg"
		},
		{
		"id": "Ck4tPy1h32",
		"type": "TITLE",
		"text": "Hello!"
		},
		{
		"id": "Ek4tPy1h12",
		"type": "TEXT",
		"text": "Lorem Impsum..."
		},
		{
		"id": "Nkm0hRAiE2",
		"type": "BUTTON",
		"text": "Click me!",
		"postback": "click-on-button-1"
		},
		{
		"id": "NkGJ6CAiN2",
		"type": "BUTTON",
		"text": "Aww don`t click on me",
		"postback": "click-on-button-2"
		 }
		]
	   }
	  ]
	 }
	}
   }
  }
 }
]
}
		

イメージ

{
"prompts": [{
  "mediaSpecificObject": {
    "dfoMessage": {
    "messageContent": {
      "type": "PLUGIN",
      "payload": {
	    "elements": [{
		  "id": "bf2521f4-5e85-413f-b6ed-815d1c3905f0",
		  "type": "FILE",
		  "filename": "photo.jpg",
		  "url": "https://picsum.photos/300/150",
		  "mimeType": "image/jpeg"
		}
	   ]
	  }
	 }
	}
   }
  }
 ]
}

マークダウン

{
"prompts": [{
  "mediaSpecificObject": {
    "dfoMessage": {
	  "messageContent": {
		"type": "PLUGIN",
		"payload": {
		  "elements": [
			{
			"id": "Ukm0hRAiA",
			"type": "TEXT",
			"mimeType": "text/markdown",
			"text": "**bold text**, *italicized text*, [URL](https://www.NICE.com), ~~Strikethrough~~
				1. Ordered List 1
				2. Ordered List 2
				3. Ordered List 3
				- Bullet list 1
				- Bullet list 2"
			}
		   ]
		  }
		 }
	    }
	  }
	}
  ]
}

1つのレスポンスに複数のメッセージ

{
"prompts": [
 {
	"transcript": "This is message one.",
	"base64EncodedG711ulawWithWavHeader": "",
	"audioFilePath": null,
	"textToSpeech": null,
	"mediaSpecificObject": null
 },
 {
	"transcript": "This is message two.",
	"base64EncodedG711ulawWithWavHeader": "",
	"audioFilePath": null,
	"textToSpeech": null,
	"mediaSpecificObject": null
 },
 {
	"transcript": "This is message three.",
	"base64EncodedG711ulawWithWavHeader": "",
	"audioFilePath": null,
	"textToSpeech": null,
	"mediaSpecificObject": null
 }
 ]
}

プロンプト

{
"prompts":[{
 "transcript":"Welcome! Choose Sales or Support and an agent will be with you shortly."
  },
  {
   "mediaSpecificObject":{
    "dfoMessage":{
     "messageContent":{
      "type":"PLUGIN",
      "payload":{
      "postback":"",
      "elements":[{
        "id":"Ek4tPy1h4",
        "type":"TEXT_AND_BUTTONS",
        "elements":[{
          "id":"TID1",
          "type":"TEXT",
          "text":"Please select an option"
         },
        {
        "id":"BID1",
        "type":"BUTTON",
        "text":"Sales",
        "postback":"payment-button-1"
        },
        {
        "id":"BID2",
        "type":"BUTTON",
        "text":"Support",
        "postback":"payment-button-2"
        }
       ]
      }
     ]
    }
    }
   }
  }
  }
 ]
}

クイック返信

{
"prompts": [{
 "mediaSpecificObject": {
  "dfoMessage": {
   "messageContent": {
   "type": "QUICK_REPLIES",
   "fallbackText": "Text sent if rich message is not available on external platform",
   "payload": {
    "text": {
      "content": "Prompt text"
    },
	"actions": [
	{
	 "type": "REPLY_BUTTON",
	 "text": "Button1Text",
	 "postback": "/Button1"
	},
	{
	  "type": "REPLY_BUTTON",
	  "text": "Button2Text",
	  "postback": "/Button1"
	}
	]
	}
	}
   }
  }
  }
 ]
}

テキスト

{
"prompts": [{
 "mediaSpecificObject": {
   "dfoMessage": {
    "messageContent": {
      "type": "TEXT",
      "payload": {
      "text": "Test Outbound Message"
      }
     }
    }
   }
  }
 ]
}

URL

{
"prompts": [{
 "mediaSpecificObject": {
  "dfoMessage": {
   "messageContent": {
    "type": "PLUGIN",
     "payload": {
      "elements": [
      {
      "id": "richLink_7329c009-4a36-493c-8435-80874a15175e",
      "type": "MENU",
      "elements": [
      //{
      //    "id": "bf2521f4-5e85-413f-b6ed-815d1c3905f0",
      //    "type": "FILE",
      //    "filename": "photo.jpg",
      //    "url": "https://picsum.photos/300/150",
      //    "mimeType": "image/jpeg"
      //},
     {
      "id": "7329c009-4a36-493c-8435-80874a1517524",
      "type": "BUTTON",
      "text": "RichLink Title",
      "url": "https://www.nice.com/"
      }
     ]
    }
    ]
   }
   }
   }
  }
 }
]
}