Bot のテナント登録

POST /bots

Bot を登録する。
登録された Bot はテナントに登録されるため、各ドメインで使用するには Bot をドメインに登録する必要がある。
Bot のテナント登録Bot のドメイン登録 を利用して、テナントとドメインの両方に登録する必要がある。
allowDomains パラメータで Bot の利用範囲をドメイン単位で指定できる。

Bot 名、画像、説明文は多言語で登録できる。Bot 利用時はユーザーの言語設定に合わせて表示される。

トークルームへの参加形式を指定できる。
enableGroupJoin パラメータを設定して複数人のトークルームに招待できる。

メッセージ callback 受信サーバーを指定できる。
メッセージ受信サーバーは、HTTPS のみ指定できる。空の文字列を設定するとメッセージ受信サーバー情報が削除され callback を送信しない。

ユーザーが送信できるメッセージタイプは callbackEvents で指定する。
指定したメッセージタイプ以外の項目はグレーアウトし、ユーザーからは送信できない。

参照

  • Bot はテナント単位で最大 300 個まで登録できる。
  • Bot 名に改行文字を入れると空白として処理されされる。
  • callbackUrl にはセキュリティ上の理由から自己署名された証明書は許可されない。
    • 許可された認証機関のリストは CAリスト を参照。

Authorization

oauth2

Access Token を指定します。
指定の方法や Access Token の取得方法は 共通仕様 を参照してください。

Scope

bot

Request

HTTP Request

POST

https://www.worksapis.com/v1.0/bots

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
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) 

ユーザーが送信可能なメッセージタイプ

  • text : テキスト
  • location : ユーザーの位置情報
  • sticker : スタンプ
  • image : 画像
  • file : ファイル
  • audio : 音声
  • video : ビデオ

minItems : 0
uniqueItems : true 
callbackUrl string 

メッセージ受信サーバーの URL(HTTPS のみ)


maxLength : 1000 
enableGroupJoin boolean 

トークルームへの招待形式

  • true : 1:N トークルームに招待できる
  • false : 1:1 トークでのみ利用できる

default : false 
defaultRichmenuId string 

デフォルトリッチメニュー ID

 
i18nBotNames array (i18nBotNames

Bot の多国語名リスト


minItems : 0 
i18nDescriptions array (i18nDescriptions

Bot の多国語説明リスト


minItems : 0 
i18nPhotoUrls array (i18nPhotoUrls

Bot の多国語画像リスト


minItems : 0 

i18nBotNames

PropertyTypeDescription
language string 

多国語言語コード


required
Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW 
botName string 

Bot名


required
maxLength : 100 

i18nDescriptions

PropertyTypeDescription
language string 

多国語言語コード


required
Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW 
description string 

Bot の説明


required
maxLength : 100 

i18nPhotoUrls

PropertyTypeDescription
language string 

多国語言語コード


required
Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW 
photoUrl string 

Bot のプロフィール画像が保存された URL


required
maxLength : 1000 

Request Example

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 "audio",
22 "video"
23 ],
24 "callbackUrl": "https://example.com/callback",
25 "enableGroupJoin": true,
26 "defaultRichmenuId": "40001",
27 "i18nBotNames": [
28 {
29 "language": "en_US",
30 "botName": "Example bot"
31 }
32 ],
33 "i18nDescriptions": [
34 {
35 "language": "en_US",
36 "description": "Example description"
37 }
38 ],
39 "i18nPhotoUrls": [
40 {
41 "language": "en_US",
42 "photoUrl": "https://example.com/favicon.png"
43 }
44 ]
45}

Response

HTTP 201

OK

PropertyTypeDescription
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) 

ユーザーが送信可能なメッセージタイプ

  • text : テキスト
  • location : ユーザーの位置情報
  • sticker : スタンプ
  • image : 画像
  • file : ファイル
  • audio : 音声
  • video : ビデオ

minItems : 0
uniqueItems : true 
callbackUrl string 

メッセージ受信サーバーの URL(HTTPS のみ)


maxLength : 1000 
enableGroupJoin boolean 

トークルームへの招待形式

  • true : 1:N トークルームに招待できる
  • false : 1:1 トークでのみ利用できる

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 

i18nBotNames

PropertyTypeDescription
language string 

多国語言語コード


required
Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW 
botName string 

Bot名


required
maxLength : 100 

i18nDescriptions

PropertyTypeDescription
language string 

多国語言語コード


required
Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW 
description string 

Bot の説明


required
maxLength : 100 

i18nPhotoUrls

PropertyTypeDescription
language string 

多国語言語コード


required
Allowed values : ja_JP, ko_KR, en_US, zh_CN, zh_TW 
photoUrl string 

Bot のプロフィール画像が保存された URL


required
maxLength : 1000 

Response Example

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 "audio",
23 "video"
24 ],
25 "callbackUrl": "https://example.com/callback",
26 "createdTime": "2022-08-08T01:12:05+09:00",
27 "modifiedTime": "2022-08-09T01:12:05+09:00",
28 "enableGroupJoin": true,
29 "defaultRichmenuId": "40001",
30 "i18nBotNames": [
31 {
32 "language": "en_US",
33 "botName": "Example bot"
34 }
35 ],
36 "i18nDescriptions": [
37 {
38 "language": "en_US",
39 "description": "Example description"
40 }
41 ],
42 "i18nPhotoUrls": [
43 {
44 "language": "en_US",
45 "photoUrl": "https://example.com/favicon.png"
46 }
47 ]
48}