POST/bots

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

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

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

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

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

参照

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

注意

  • 同一の Bot に対して、Bot の テナント登録、更新、部分更新、削除、ドメイン登録、ドメイン更新、ドメイン部分更新、ドメイン削除、利用ユーザーの登録、利用ユーザーの削除 API を同時に呼び出さないでください。

Authorization

oauth2

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

Scope

bot

HTTP Request

POSThttps://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 
channelEvents array (string) 

Callback 受信するトークルームイベントタイプ

  • message: メッセージ
  • join: 複数人トークルームに招待
  • leave: 複数人トークルームから退室
  • joined: メンバーが複数人トークルームに参加
  • left: メンバーが複数人トークルームに退室
  • postback: ポストバックアクション
  • begin: 1:1 トークルームに参加
  • end: 1:1 トークルームから退室

default : message,join,leave,joined,left,postback
minItems : 0
uniqueItems : true 
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    1000000113  ],14  "enableCallback": true,15  "callbackEvents": [16    "text",17    "location",18    "sticker",19    "image",20    "file",21    "audio",22    "video"23  ],24  "channelEvents": [25    "message",26    "join",27    "leave",28    "joined",29    "left",30    "postback",31    "begin",32    "end"33  ],34  "callbackUrl": "https://example.com/callback",35  "enableGroupJoin": true,36  "defaultRichmenuId": "40001",37  "i18nBotNames": [38    {39      "language": "en_US",40      "botName": "Example bot"41    }42  ],43  "i18nDescriptions": [44    {45      "language": "en_US",46      "description": "Example description"47    }48  ],49  "i18nPhotoUrls": [50    {51      "language": "en_US",52      "photoUrl": "https://example.com/favicon.png"53    }54  ]55}

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 
channelEvents array (string) 

Callback 受信するトークルームイベントタイプ

  • message: メッセージ
  • join: 複数人トークルームに招待
  • leave: 複数人トークルームから退室
  • joined: メンバーが複数人トークルームに参加
  • left: メンバーが複数人トークルームに退室
  • postback: ポストバックアクション
  • begin: 1:1 トークルームに参加
  • end: 1:1 トークルームから退室

default : message,join,leave,joined,left,postback
minItems : 0
uniqueItems : true 
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    1000000114  ],15  "enableCallback": true,16  "channelEvents": [17    "message",18    "join",19    "leave",20    "joined",21    "left",22    "postback",23    "begin",24    "end"25  ],26  "callbackEvents": [27    "text",28    "location",29    "sticker",30    "image",31    "file",32    "audio",33    "video"34  ],35  "callbackUrl": "https://example.com/callback",36  "createdTime": "2022-08-08T01:12:05+09:00",37  "modifiedTime": "2022-08-09T01:12:05+09:00",38  "enableGroupJoin": true,39  "defaultRichmenuId": "40001",40  "i18nBotNames": [41    {42      "language": "en_US",43      "botName": "Example bot"44    }45  ],46  "i18nDescriptions": [47    {48      "language": "en_US",49      "description": "Example description"50    }51  ],52  "i18nPhotoUrls": [53    {54      "language": "en_US",55      "photoUrl": "https://example.com/favicon.png"56    }57  ]58}