POST/bots/{botId}/richmenus
Bot のリッチメニューを登録する。
- 1 つの Bot に対し、最大 1,000 個のリッチメニューを登録できる。
- 各動作 (action) の label 項目は、PC 版アプリで使用される。指定していない場合は、デフォルトの文章が表示される。
登録したリッチメニューを使用するためには、追加で以下の手順が必要。
デフォルトリッチメニューは、Bot の更新 または Bot の部分更新 の defaultRichMenuId でも指定できます。
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 |
|---|---|---|
| richmenuName | string | リッチメニュー名 required maxLength : 300 |
| areas | array (RichmenuArea) | リッチメニューの各動作 (action) のエリア (座標/サイズ) required minItems : 1 maxItems : 20 |
| size | object (size) | リッチメニューの幅と高さ required |
| Property | Type | Description |
|---|---|---|
| action | object (action) | エリアを押した時の動作 required |
| bounds | object (bounds) | リッチメニューボタンの範囲モデル required |
| Property | Type | Description |
|---|---|---|
| type | string | Action の種類 required Allowed values : postback, message, uri, copy |
| label | string | 項目に表示されるラベル
|
| data | string | "postback.data" プロパティとして返す文字列 maxLength : 300 |
| displayText | string | トーク画面に表示されるテキスト maxLength : 300 |
| postback | string | "message.postback" として返される文字列 maxLength : 1000 |
| text | string | 項目を押すと送信されるテキスト maxLength : 300 |
| uri | string | 項目を押すと開く URI maxLength : 1000 |
| copyText | string | 項目をクリックするとクリップボードにコピーされる文字列 maxLength : 1000 |
| i18nDisplayTexts | array (i18nDisplayTexts) | 多言語の表示テキストリスト minItems : 0 |
| 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 |
| displayText | string | ユーザーが送信したメッセージで、トーク画面に表示されるテキスト required maxLength : 300 |
| 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 |
| Property | Type | Description |
|---|---|---|
| x | integer | 領域の左側からの水平位置 required minimum : 0 maximum : 2500 format : int64 |
| y | integer | 領域の上部からの垂直位置 required minimum : 0 maximum : 1686 format : int64 |
| width | integer | 領域の幅 required minimum : 0 maximum : 2500 format : int64 |
| height | integer | 領域の高さ required minimum : 0 maximum : 1686 format : int64 |
| Property | Type | Description |
|---|---|---|
| width | integer | リッチメニューの幅 required Allowed values : 2500 format : int64 |
| height | integer | リッチメニューの高さ required Allowed values : 843, 1686 format : int64 |
example
1{2 "richmenuName": "Example Richmenu",3 "areas": [4 {5 "action": {6 "type": "postback",7 "label": "Example label",8 "data": "Example data",9 "displayText": "Example displayText",10 "i18nDisplayTexts": [11 {12 "language": "en_US",13 "displayText": "Example display text"14 }15 ],16 "i18nLabels": [17 {18 "language": "en_US",19 "label": "Example label"20 }21 ]22 },23 "bounds": {24 "x": 0,25 "y": 0,26 "width": 2500,27 "height": 84328 }29 }30 ],31 "size": {32 "width": 2500,33 "height": 84334 }35}OK
| Property | Type | Description |
|---|---|---|
| richmenuId | string | リッチメニュー ID readOnly : true |
| richmenuName | string | リッチメニュー名 required maxLength : 300 |
| areas | array (RichmenuArea) | リッチメニューの各動作 (action) のエリア (座標/サイズ) required minItems : 1 maxItems : 20 |
| size | object (size) | リッチメニューの幅と高さ required |
| Property | Type | Description |
|---|---|---|
| action | object (action) | エリアを押した時の動作 required |
| bounds | object (bounds) | リッチメニューボタンの範囲モデル required |
| Property | Type | Description |
|---|---|---|
| type | string | Action の種類 required Allowed values : postback, message, uri, copy |
| label | string | 項目に表示されるラベル
|
| data | string | "postback.data" プロパティとして返す文字列 maxLength : 300 |
| displayText | string | トーク画面に表示されるテキスト maxLength : 300 |
| postback | string | "message.postback" として返される文字列 maxLength : 1000 |
| text | string | 項目を押すと送信されるテキスト maxLength : 300 |
| uri | string | 項目を押すと開く URI maxLength : 1000 |
| copyText | string | 項目をクリックするとクリップボードにコピーされる文字列 maxLength : 1000 |
| i18nDisplayTexts | array (i18nDisplayTexts) | 多言語の表示テキストリスト minItems : 0 |
| 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 |
| displayText | string | ユーザーが送信したメッセージで、トーク画面に表示されるテキスト required maxLength : 300 |
| 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 |
| Property | Type | Description |
|---|---|---|
| x | integer | 領域の左側からの水平位置 required minimum : 0 maximum : 2500 format : int64 |
| y | integer | 領域の上部からの垂直位置 required minimum : 0 maximum : 1686 format : int64 |
| width | integer | 領域の幅 required minimum : 0 maximum : 2500 format : int64 |
| height | integer | 領域の高さ required minimum : 0 maximum : 1686 format : int64 |
| Property | Type | Description |
|---|---|---|
| width | integer | リッチメニューの幅 required Allowed values : 2500 format : int64 |
| height | integer | リッチメニューの高さ required Allowed values : 843, 1686 format : int64 |
example
1{2 "richmenuId": "40001",3 "richmenuName": "Example Richmenu",4 "areas": [5 {6 "action": {7 "type": "postback",8 "label": "Example label",9 "data": "Example data",10 "displayText": "Example displayText",11 "i18nDisplayTexts": [12 {13 "language": "en_US",14 "displayText": "Example display text"15 }16 ],17 "i18nLabels": [18 {19 "language": "en_US",20 "label": "Example label"21 }22 ]23 },24 "bounds": {25 "x": 0,26 "y": 0,27 "width": 2500,28 "height": 84329 }30 }31 ],32 "size": {33 "width": 2500,34 "height": 84335 }36}