JSON 編集モード
- 印刷する
- PDF
JSON 編集モード
- 印刷する
- PDF
記事の要約
この要約は役に立ちましたか?
ご意見ありがとうございます
Classic/VPC環境で利用できます。
CLOVA Chatbotで実装可能なJSON入力様式について説明します。JSON編集モードは、連続返答やあらゆる必須項目を入力しなければならない複雑な返答タイプを他の会話にコピーする際に役立ちます。
[JSON編集モード] ボタンをクリックすると、JSON構造のデータをコピーできます。そのコピーしたデータを他の会話に適用すると、複雑に設定された返答タイプを簡単にコピーできます。
基本返答
JSONストラクチャーの例は以下のとおりです。
[
{
"component": {
"type": "text",
"data": {
"description": "the answer of this query is test",
"url": "http://www.example.com"
}
},
"answerType": "TEXT"
}
]
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
component | object | true | support Text Component in the chatbot custom api specification v2 |
component.type | string | true | text |
component.data.description | string | true | answer |
component.data.url | string | false | the hyperlink jump url (http://www.example.com ) |
answerType | string | true | TEXT, means default answer |
マルチリンク返答
JSONストラクチャーの例は以下のとおりです。
[
{
"component": {
"type": "template",
"data": {
"cover": {
"type": "text",
"data": {
"description": "マルチリンクの返答部分です。"
}
},
"contentTable": [
[
{
"colSpan": 1,
"rowSpan": 1,
"data": {
"type": "button",
"title": "naver",
"data": {
"type": "basic",
"action": {
"type": "link",
"data": {
"url": "https://www.naver.com/"
}
}
}
}
}
],
[
{
"colSpan": 1,
"rowSpan": 1,
"data": {
"type": "button",
"title": "google",
"data": {
"type": "basic",
"action": {
"type": "link",
"data": {
"url": "https://www.google.com/"
}
}
}
}
}
]
]
}
},
"answerType": "MULTILINKS"
}
]
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
answerType | string | true | MULTILINKS, means multilink answer |
component | jsonObject | true | support Template Component in the chatbot custom api specification v2, and template type only support Text + Buttons |
画像返答
JSONストラクチャーの例は以下のとおりです。
[
{
"component": {
"type": "carousel",
"data": {
"cards": [
{
"type": "image",
"title": "1番目のカルーセルの画像のタイトルです。",
"data": {
"imageUrl": "https://www.image.com/image.png",
"description": "1番目のカルーセルの画像の説明です。"
}
},
{
"type": "image",
"title": "2番目のカルーセルの画像のタイトルです。",
"data": {
"imageUrl": "https://www.image.com/image.png",
"description": "2番目のカルーセルの画像の説明です。"
}
}
]
}
},
"answerType": "IMAGECARD"
}
]
Field Introduce
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
answerType | string | true | IMAGECARD, means image answer |
component | jsonObject | true | support Image Component, Template Component, Carousel Component in the chatbot custom api specification v2. It depends on the number of Image Card and Button: 1. one image card, no button: Image Component; 2. one image card, with button: Template Component, and template type only support Image Component + Buttons; 3. multiple image card: Carousel Component, and carouse type support only images and template with image + buttons |
Image Field Introduce
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
type | string | true | image |
title | string | true | short bold text |
data.imageUrl | string | true | image url, must be https url |
data.description | string | false | details info of image |
選択肢型返答
JSONストラクチャーの例は以下のとおりです。
[
{
"component": {
"type": "text",
"data": {
"description": "#{選択肢型フォーム名}"
}
},
"answerType": "SINGLEFORM"
}
]
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
answerType | string | true | SINGLEFORM, means multiple choice answer |
component | object | true | support Text Component in the chatbot custom api specification v2 |
component.type | string | true | Text |
component.data.description | string | true | String1 true form name,wrap with # and {} #{formName} |
連続返答
連続返答は最大5個まで吹き出しを追加できます。
JSONストラクチャーの例は以下のとおりです。
[
{
"component": {
"type": "text",
"data": {
"description": "返答例です。",
"url": "http://www.example.com"
}
},
"answerType": "TEXT"
},
{
"component": {
"type": "text",
"data": {
"description": "#{選択肢型フォーム名}"
}
},
"answerType": "SINGLEFORM"
}
]
Field Introduce
In the array data( array[jsonObject] ),each json object represents a bubble, multiple bubbles correspond to multiple json objects.
Flexメッセージ返答
メッセンジャーをLINEに設定した場合は、Flexメッセージ返答をサポートします。
JSONストラクチャーの例は以下のとおりです。
[
{
"component": {
"type": "flex",
"title": "Flex返答です。",
"data": {
"type": "bubble",
"hero": {
"type": "image",
"url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/01_1_cafe.png",
"size": "full",
"aspectRatio": "20:13",
"aspectMode": "cover"
},
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "Brown Cafe",
"weight": "bold",
"size": "xl"
}
]
},
"footer": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [
{
"type": "button",
"style": "link",
"height": "sm",
"action": {
"type": "uri",
"label": "CALL",
"uri": "https://linecorp.com"
}
},
{
"type": "spacer",
"size": "sm"
}
],
"flex": 0
}
}
},
"answerType": "FLEXMESSAGE"
}
]
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
answerType | string | true | FLEXMESSAGE, means flex message answer |
component | object | true | support LINE Flex in the chatbot custom api specification v2 |
LINEスタンプ返答
メッセンジャーをLINEに設定した場合は、LINEスタンプ返答をサポートします。
JSONストラクチャーの例は以下のとおりです。
[
{
"component": {
"type": "line_sticker",
"data": {
"packageId": "11537",
"stickerId": "52002734"
}
},
"answerType": "STICKER"
}
]
フィールド | タイプ | 必須の有無 | 説明 |
---|---|---|---|
answerType | string | true | STICKER, means LINE sticker answer |
component | object | true | support Line Sticker in the chatbot custom api specification v2 |
この記事は役に立ちましたか?