POST/bots/{botId}/persistentmenu
Bot に固定メニューを登録する。
ボタン形式で登録され、callback type として message と uri を設定できる。
各ボタンに postback パラメータを追加することで、callback サーバーで受信できる。メッセージ形式は Callback (メッセージの受信) を参照。
固定メニューの構造は次の通り。
参照
- ボタンは最大 4 つまで登録できる。
- テキスト項目に改行文字を入力すると、空白で置き換えられる。
注意
- リッチメニューを登録すると、登録した固定メニューは削除される。
- リッチメニューが登録されている Bot には、固定メニューの登録はできない。
Access Token を指定します。
指定の方法や Access Token の取得方法は 共通仕様 を参照してください。
bot.message
bot
| Parameter | Type | Description |
|---|---|---|
| botId | integer | Bot ID required example : 2000001 format : int64 |
| Header | type | Description |
|---|---|---|
| Authorization | string | Bearer {token} required |
| Content-Type | string | application/json required example : application/json |
| Property | Type | Description |
|---|---|---|
| content | object (content) | 設定する固定メニュー required |
| Property | Type | Description |
|---|---|---|
| actions | array (PersistentMenuActionStruct) | 固定メニューに追加するボタンのリスト required maxItems : 4 |
| Property | Type | Description |
|---|---|---|
| type | string | Actionの種類 required Allowed values : message, uri, copy |
| label | string | 項目に表示されるラベル
|
| postback | string | "message.postback" として返される文字列 maxLength : 1000 |
| text | string | 項目を押すと送信されるテキスト maxLength : 300 |
| uri | string | 項目を押すと開く URI maxLength : 1000 |
| copyText | string | 項目をクリックするとクリップボードにコピーされる文字列 maxLength : 1000 |
| i18nLabels | array (i18nLabels) | 多言語のラベルリスト minItems : 0 |
| i18nTexts | array (i18nTexts) | 多言語のテキストリスト minItems : 0 |
| Property | Type | Description |
|---|---|---|
| language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
| label | string | 項目に表示されるラベル
required |
| Property | Type | Description |
|---|---|---|
| language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
| text | string | 項目を押すと送信されるテキスト required maxLength : 300 |
example
1{2 "content": {3 "actions": [4 {5 "type": "message",6 "label": "Example label",7 "text": "Example text",8 "postback": "Example postback",9 "i18nLabels": [10 {11 "language": "en_US",12 "label": "Example label"13 }14 ],15 "i18nTexts": [16 {17 "language": "en_US",18 "text": "Example text"19 }20 ]21 },22 {23 "type": "uri",24 "label": "Example Homepage",25 "uri": "https://example.com",26 "i18nLabels": [27 {28 "language": "en_US",29 "label": "Example label"30 }31 ]32 }33 ]34 }35}OK
| Property | Type | Description |
|---|---|---|
| content | object (content) | 設定する固定メニュー required |
| Property | Type | Description |
|---|---|---|
| actions | array (PersistentMenuActionStruct) | 固定メニューに追加するボタンのリスト required maxItems : 4 |
| Property | Type | Description |
|---|---|---|
| type | string | Actionの種類 required Allowed values : message, uri, copy |
| label | string | 項目に表示されるラベル
|
| postback | string | "message.postback" として返される文字列 maxLength : 1000 |
| text | string | 項目を押すと送信されるテキスト maxLength : 300 |
| uri | string | 項目を押すと開く URI maxLength : 1000 |
| copyText | string | 項目をクリックするとクリップボードにコピーされる文字列 maxLength : 1000 |
| i18nLabels | array (i18nLabels) | 多言語のラベルリスト minItems : 0 |
| i18nTexts | array (i18nTexts) | 多言語のテキストリスト minItems : 0 |
| Property | Type | Description |
|---|---|---|
| language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
| label | string | 項目に表示されるラベル
required |
| Property | Type | Description |
|---|---|---|
| language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
| text | string | 項目を押すと送信されるテキスト required maxLength : 300 |
example
1{2 "content": {3 "actions": [4 {5 "type": "message",6 "label": "Example label",7 "text": "Example text",8 "postback": "Example postback",9 "i18nLabels": [10 {11 "language": "en_US",12 "label": "Example label"13 }14 ],15 "i18nTexts": [16 {17 "language": "en_US",18 "text": "Example text"19 }20 ]21 },22 {23 "type": "uri",24 "label": "Example Homepage",25 "uri": "https://example.com",26 "i18nLabels": [27 {28 "language": "en_US",29 "label": "Example label"30 }31 ]32 }33 ]34 }35}