Bot API
Bot APIs are admin APIs and therefore can only be accessed using Private Key. If you want to know what exact headers you need to send in admin APIs, You can check the Admin API section.
Create Bot
You can create a bot by using the Create a New User API call except that a callback URL is specified in order for the bot to receive messages.
POST https://api.channelize.io/v2/users
Body Params
The following table lists the parameters this API call supports.
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | string | no | auto generated | The unique ID of the bot. |
displayName | string | yes | - | The bot's name. |
profileImageUrl | string | no | null | The URL of bot's profile image. |
role | string | yes | "user" | The user's role. The allowed values are "user" and "bot". Set "bot" to create bot |
config | object | yes | null | The bot's configuration which includes callbackUrl & aiPlatform. |
createdAt | string | no | $now | The timestamp when the bot was created. |
Currently the allowed value for aiPlatform is "custom".
{
"displayName": "Channelize Dummy Bot",
"role": "bot",
"config": {
"aiPlatform": "custom",
"callbackUrl": "https://dummybot.com"
}
}
Response Body
Status Code : 201
{
"id": "86428bd0-0459-11ea-b71b-cd93082f1d39",
"displayName": "Channelize Dummy Bot",
"language": "en",
"isOnline": false,
"visibility": true,
"notification": true,
"role": "bot",
"config": {
"callbackUrl": "https://dummybot.com",
"aiPlatform": "custom"
},
"createdAt": "2019-11-11T08:01:53.932Z",
"updatedAt": "2019-11-11T08:01:53.932Z",
"isDeleted": false
}
List Bots
You can list bots by passing role query param to bot in “List Users” API call.
GET https://api.channelize.io/v2/users?role=bot
Query Parameters
Name | Type | Required | Description |
---|---|---|---|
search | string | no | Specify the searching text. This searching text will be matched with bot's display name.. |
sort | string | no | Specify the sorting criteria for your results. Allowed values are displayName ASC and displayName DESC. |
limit | number | no | Specify the number of results. |
skip | number | no | Specify the number of results you want to skip from the begining. |
Response Body
Status Code: 200
[
{
"id": "86428bd0-0459-11ea-b71b-cd93082f1d39",
"displayName": "Channelize Dummy Bot",
"language": "en",
"isOnline": false,
"visibility": true,
"notification": true,
"role": "bot",
"config": {
"callbackUrl": "https://dummybot.com",
"aiPlatform": "custom"
},
"createdAt": "2019-11-11T08:01:53.932Z",
"updatedAt": "2019-11-11T08:01:53.932Z",
"isDeleted": false
}
]
View Bot
You can view bot by using the “View User” API call.
GET https://api.channelize.io/v2/users/{botId}
Response Body
Status Code: 200
{
"id": "86428bd0-0459-11ea-b71b-cd93082f1d39",
"displayName": "Channelize Dummy Bot",
"language": "en",
"isOnline": false,
"visibility": true,
"notification": true,
"role": "bot",
"config": {
"callbackUrl": "https://dummybot.com",
"aiPlatform": "custom"
},
"createdAt": "2019-11-11T08:01:53.932Z",
"updatedAt": "2019-11-11T08:01:53.932Z",
"isDeleted": false
}
Update Bot
You can update bot details such as display name and callback URL by using the “Update User” API call.
PUT https://api.channelize.io/v2/users/{botId}
Body Parameters
Name | Type | Required | Description |
---|---|---|---|
displayName | string | no | The bot's name. |
config | object | no | The bot's configuration which includes callbackUrl & aiPlatform. |
{
"displayName": "Channelize Dummy Bot1",
"config": {
"callbackUrl": "https://dummybot1.com"
}
}
Response Body
Status Code: 204
null
Delete Bot
You can delete bot by using the “Delete User” API call.
DELETE https://api.channelize.io/v2/users/{botId}
Response Body
Status Code: 204
null