POST/bots
Botを登録する。
登録されたBotはテナントに登録されるため、各ドメインで使用するにはBotをドメインに登録する必要がある。
Botのテナント登録APIとBotのドメイン登録APIを利用して、テナントとドメインの両方に登録する必要がある。
allowDomainsパラメータでBotの利用範囲をドメイン単位で指定できる。
Bot名、画像、説明文を多言語で登録することができ、Bot利用時はユーザーの言語設定に合わせて表示される。
トークルームへの参加形式を指定できる。
enableGroupJoinパラメータを設定することで複数人のトークルームに招待できる。
メッセージcallback受信サーバーを指定できる。
メッセージ受信サーバーは、HTTPSのみ指定できる。空の文字列を設定するとメッセージ受信サーバー情報が削除されcallbackを送信しない。
ユーザーが送信可能なメッセージタイプをcallbackEventListで指定できる。
指定したメッセージタイプ以外の項目はグレーアウトし、ユーザーからは送信できない。
参照
- Botは最大300個まで登録できる。
- Bot名に改行文字を入れると空白として処理されされる。
- callbackUrlにはセキュリティ上の理由から自己署名された証明書は許可されない。
- 許可された認証機関のリストについてはCAリストを参照。
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
Header | type | Description |
---|---|---|
Authorization | string | Bearer {token} required |
Content-Type | string | application/json required example : application/json |
Property | Type | Description |
---|---|---|
botName | string | Bot名 required maxLength : 100 |
photoUrl | string | Botプロフィール画像のURL(PNG形式, 640×640サイズを推奨, HTTPSのみ可能) required maxLength : 1000 |
description | string | Botの説明 required maxLength : 100 |
administrators | array (string) | Bot担当者のユーザーIDリスト required minItems : 1 maxItems : 3 uniqueItems : true |
subadministrators | array (string) | Bot副担当者のユーザーIDリスト minItems : 0 maxItems : 3 uniqueItems : true |
allowDomains | array (integer) | Botが使用可能なドメインリスト minItems : 0 uniqueItems : true |
enableCallback | boolean | Callback URLの利用フラグ default : false |
callbackEvents | array (string) | ユーザーが送信可能なメッセージタイプ
minItems : 0 uniqueItems : true |
callbackUrl | string | メッセージ受信サーバーのURL(HTTPSのみ) maxLength : 1000 |
enableGroupJoin | boolean | トークルームへの招待形式
default : false |
defaultRichmenuId | string | 既定リッチメニューID |
i18nBotNames | array (I18nBotNames) | Botの多国語名リスト minItems : 0 |
i18nDescriptions | array (I18nDescriptions) | Botの多国語説明リスト minItems : 0 |
i18nPhotoUrls | array (I18nPhotoUrls) | Botの多国語画像リスト minItems : 0 |
Property | Type | Description |
---|---|---|
language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
botName | string | Bot名 required maxLength : 100 |
Property | Type | Description |
---|---|---|
language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
description | string | Botの説明 required maxLength : 100 |
Property | Type | Description |
---|---|---|
language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
photoUrl | string | Botのプロフィール画像が保存されたURL required maxLength : 1000 |
example
1{
2 "botName": "Example bot",
3 "photoUrl": "https://example.com/favicon.png",
4 "description": "WorksMobile's A.I. conversation enabled bot",
5 "administrators": [
6 "d191e339-3299-44e6-7a44-04d9cb01a5e0"
7 ],
8 "subadministrators": [
9 "e417a131-a56d-44a4-5304-033e16fca8d1"
10 ],
11 "allowDomains": [
12 10000001
13 ],
14 "enableCallback": true,
15 "callbackEvents": [
16 "text",
17 "location",
18 "sticker",
19 "image",
20 "file"
21 ],
22 "callbackUrl": "https://example.com/callback",
23 "enableGroupJoin": true,
24 "defaultRichmenuId": "40001",
25 "i18nBotNames": [
26 {
27 "language": "en_US",
28 "botName": "Example bot"
29 }
30 ],
31 "i18nDescriptions": [
32 {
33 "language": "en_US",
34 "description": "Example description"
35 }
36 ],
37 "i18nPhotoUrls": [
38 {
39 "language": "en_US",
40 "photoUrl": "https://example.com/favicon.png"
41 }
42 ]
43}
OK
Property | Type | Description |
---|---|---|
botId | integer | Bot ID format : int64 readOnly : true |
botName | string | Bot名 required maxLength : 100 |
photoUrl | string | Botプロフィール画像のURL(PNG形式, 640×640サイズを推奨, HTTPSのみ可能) required maxLength : 1000 |
description | string | Botの説明 required maxLength : 100 |
administrators | array (string) | Bot担当者のユーザーIDリスト required minItems : 1 maxItems : 3 uniqueItems : true |
subadministrators | array (string) | Bot副担当者のユーザーIDリスト minItems : 0 maxItems : 3 uniqueItems : true |
allowDomains | array (integer) | Botが使用可能なドメインリスト minItems : 0 uniqueItems : true |
enableCallback | boolean | Callback URLの利用フラグ default : false |
callbackEvents | array (string) | ユーザーが送信可能なメッセージタイプ
minItems : 0 uniqueItems : true |
callbackUrl | string | メッセージ受信サーバーのURL(HTTPSのみ) maxLength : 1000 |
enableGroupJoin | boolean | トークルームへの招待形式
default : false |
defaultRichmenuId | string | 既定リッチメニューID |
i18nBotNames | array (I18nBotNames) | Botの多国語名リスト minItems : 0 |
i18nDescriptions | array (I18nDescriptions) | Botの多国語説明リスト minItems : 0 |
i18nPhotoUrls | array (I18nPhotoUrls) | Botの多国語画像リスト minItems : 0 |
createdTime | string | Botの作成日時 (YYYY-MM-DDThh:mm:ssTZD) format : date-time readOnly : true |
modifiedTime | string | Botの更新日時 (YYYY-MM-DDThh:mm:ssTZD) format : date-time readOnly : true |
Property | Type | Description |
---|---|---|
language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
botName | string | Bot名 required maxLength : 100 |
Property | Type | Description |
---|---|---|
language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
description | string | Botの説明 required maxLength : 100 |
Property | Type | Description |
---|---|---|
language | string | 多国語言語コード required Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW |
photoUrl | string | Botのプロフィール画像が保存されたURL required maxLength : 1000 |
example
1{
2 "botId": 2000001,
3 "botName": "Example bot",
4 "photoUrl": "https://example.com/favicon.png",
5 "description": "WorksMobile's A.I. conversation enabled bot",
6 "administrators": [
7 "d191e339-3299-44e6-7a44-04d9cb01a5e0"
8 ],
9 "subadministrators": [
10 "e417a131-a56d-44a4-5304-033e16fca8d1"
11 ],
12 "allowDomains": [
13 10000001
14 ],
15 "enableCallback": true,
16 "callbackEvents": [
17 "text",
18 "location",
19 "sticker",
20 "image",
21 "file"
22 ],
23 "callbackUrl": "https://example.com/callback",
24 "createdTime": "2022-08-08T01:12:05+09:00",
25 "modifiedTime": "2022-08-09T01:12:05+09:00",
26 "enableGroupJoin": true,
27 "defaultRichmenuId": "40001",
28 "i18nBotNames": [
29 {
30 "language": "en_US",
31 "botName": "Example bot"
32 }
33 ],
34 "i18nDescriptions": [
35 {
36 "language": "en_US",
37 "description": "Example description"
38 }
39 ],
40 "i18nPhotoUrls": [
41 {
42 "language": "en_US",
43 "photoUrl": "https://example.com/favicon.png"
44 }
45 ]
46}