POST/bots/{botId}/richmenus
Botのリッチメニューを登録する。
- 1つのBotに対し、最大1000個のリッチメニューを登録できる。
- 各動作(action)のlabel項目は、PC版アプリで使用される。指定していない場合は、デフォルトの文章が表示される。
登録したリッチメニューを使用するためには、追加で以下の手順が必要。
既定リッチメニューを設定するには「Botの更新」または「Botの部分更新」でdefaultRichMenuIdを設定する。
Authorization URL - https://auth.worksmobile.com/oauth2/v2.0/authorize
Token URL - https://auth.worksmobile.com/oauth2/v2.0/token
Refresh URL - https://auth.worksmobile.com/oauth2/v2.0/token
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 |
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。'http', 'https'スキーマに対応する。 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": 843
28 }
29 }
30 ],
31 "size": {
32 "width": 2500,
33 "height": 843
34 }
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 |
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。'http', 'https'スキーマに対応する。 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": 843
29 }
30 }
31 ],
32 "size": {
33 "width": 2500,
34 "height": 843
35 }
36}