POST/bots

Adds a bot for the customer. A bot is added on a tenant basis, so you need to add its domain as well if you want to use the bot in each domain. You need to therefore add both a bot's tenant and domain by using the Add a bot and Add a bot domain operations to use the bot.

Use the allowDomains parameter to specify the scope of domains for a bot.

You can add a bot's name, photo and description in multiple languages so that they will be displayed in the language that matches the client's language settings.

You can also choose a message room type. The default value is a 1:1 message room, and you can enable "Invitation to team/group or 1:N chat room available" using the enableGroupJoin parameter.

You can specify the customer's message callback server. Only HTTPS is accepted for the server, and if the callback URL is set to an empty string, the server will not send a callback. You can also specify the callbackEvents parameter to selectively receive user events you want. The events specified by the callbackEvents parameter are activated among the menus that appear at the bottom of a 1:1 message room with the bot.

Note

  • You can add up to 300 bots.
  • A new line character in the name parameter is substituted with a blank space.
  • Self-signed certificates are not allowed in callbackUrl.
  • To see the list of allowed certificate authorities, see CA List.

Caution

  • The following API operations must not be called as parallel for same bot. Add, Update, Partially update, Delete, Add a domain, Update a domain, Partially update a domain, Delete a domain, Add a bot user, Delete a bot user

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

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 name


required
maxLength : 100 
photoUrl string 

URL of a bot profile image (PNG format, 640 x 640 recommended and only HTTPS allowed)


required
maxLength : 1000 
description string 

Bot description


required
maxLength : 100 
administrators array (string) 

Primary contacts of the bot


required
minItems : 1
maxItems : 3
uniqueItems : true 
subadministrators array (string) 

Secondary contacts of the bot


minItems : 0
maxItems : 3
uniqueItems : true 
allowDomains array (integer) 

List of domains where bots are enabled


minItems : 0
uniqueItems : true 
enableCallback boolean 

Indicates whether to receive bot events.


default : false 
callbackEvents array (string) 

Bot event types

  • "text": Text
  • "location": Location information
  • "sticker": Sticker
  • "image": Image
  • "file": File
  • "audio": Audio
  • "video": Video

minItems : 0
uniqueItems : true 
callbackUrl string 

The customer server receiving bot events. Only HTTPS is allowed.


maxLength : 1000 
enableGroupJoin boolean 

Indicates whether to join a 1:N message room


default : false 
defaultRichmenuId string 

The default rich menu ID for all users

 
i18nBotNames array (i18nBotNames) 

Multilingual bot name


minItems : 0 
i18nDescriptions array (i18nDescriptions) 

Multilingual bot description


minItems : 0 
i18nPhotoUrls array (i18nPhotoUrls) 

Multilingual bot image


minItems : 0 

i18nBotNames

PropertyTypeDescription
language string 

Language code


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

Bot name


required
maxLength : 100 

i18nDescriptions

PropertyTypeDescription
language string 

Language code


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

Bot description


required
maxLength : 100 

i18nPhotoUrls

PropertyTypeDescription
language string 

Language code


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

URL of a bot profile image


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  "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 name


required
maxLength : 100 
photoUrl string 

URL of a bot profile image (PNG format, 640 x 640 recommended and only HTTPS allowed)


required
maxLength : 1000 
description string 

Bot description


required
maxLength : 100 
administrators array (string) 

Primary contacts of the bot


required
minItems : 1
maxItems : 3
uniqueItems : true 
subadministrators array (string) 

Secondary contacts of the bot


minItems : 0
maxItems : 3
uniqueItems : true 
allowDomains array (integer) 

List of domains where bots are enabled


minItems : 0
uniqueItems : true 
enableCallback boolean 

Indicates whether to receive bot events.


default : false 
callbackEvents array (string) 

Bot event types

  • "text": Text
  • "location": Location information
  • "sticker": Sticker
  • "image": Image
  • "file": File
  • "audio": Audio
  • "video": Video

minItems : 0
uniqueItems : true 
callbackUrl string 

The customer server receiving bot events. Only HTTPS is allowed.


maxLength : 1000 
enableGroupJoin boolean 

Indicates whether to join a 1:N message room


default : false 
defaultRichmenuId string 

The default rich menu ID for all users

 
i18nBotNames array (i18nBotNames) 

Multilingual bot name


minItems : 0 
i18nDescriptions array (i18nDescriptions) 

Multilingual bot description


minItems : 0 
i18nPhotoUrls array (i18nPhotoUrls) 

Multilingual bot image


minItems : 0 
createdTime string 

Bot creation time (YYYY-MM-DDThh:mm:ssTZD)


format : date-time
readOnly : true 
modifiedTime string 

Bot update time (YYYY-MM-DDThh:mm:ssTZD)


format : date-time
readOnly : true 

i18nBotNames

PropertyTypeDescription
language string 

Language code


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

Bot name


required
maxLength : 100 

i18nDescriptions

PropertyTypeDescription
language string 

Language code


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

Bot description


required
maxLength : 100 

i18nPhotoUrls

PropertyTypeDescription
language string 

Language code


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

URL of a bot profile image


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  "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}