All URIs are relative to https://api-APP_ID.sendbird.com
Method | HTTP request | Description |
---|---|---|
createBot | POST /v3/bots | Create a bot |
deleteBotById | DELETE /v3/bots/{bot_userid} | Delete a bot |
joinChannels | POST /v3/bots/{bot_userid}/channels | Join channels |
leaveChannels | DELETE /v3/bots/{bot_userid}/channels | Leave channels - When leaving all channels |
leaveChannelsByUrl | DELETE /v3/bots/{bot_userid}/channels/{channel_url} | Leave channels - When leaving a channel by its channel URL |
listBots | GET /v3/bots | List bots |
sendBotsMessage | POST /v3/bots/{bot_userid}/send | Send a bot's message |
updateBotById | PUT /v3/bots/{bot_userid} | Update a bot |
viewBotById | GET /v3/bots/{bot_userid} | View a bot |
CreateBotResponse createBot(apiToken, opts)
Create a bot
Create a bot Creates a new bot within the application. Creating a bot is similar to creating a normal user, except that a callback URL is specified in order for the bot to receive events. > Note: The bot must join a group channel first to interact with users. In group channels, you can invite a bot through the invite as members action instead. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-create-a-bot
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let opts = {
'createBotData': new SendbirdPlatformSdk.CreateBotData() // CreateBotData |
};
apiInstance.createBot(apiToken, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
createBotData | CreateBotData | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
Object deleteBotById(apiToken, botUserid)
Delete a bot
Delete a bot Deletes a bot from an application. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-delete-a-bot ----------------------------
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let botUserid = "botUserid_example"; // String |
apiInstance.deleteBotById(apiToken, botUserid).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String |
Object
No authorization required
- Content-Type: Not defined
- Accept: application/json
JoinChannelsResponse joinChannels(apiToken, botUserid, opts)
Join channels
Join channels Makes a bot join one or more channels. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-join-channels ----------------------------
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let botUserid = "botUserid_example"; // String |
let opts = {
'joinChannelsData': new SendbirdPlatformSdk.JoinChannelsData() // JoinChannelsData |
};
apiInstance.joinChannels(apiToken, botUserid, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
joinChannelsData | JoinChannelsData | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
leaveChannels(apiToken, botUserid, opts)
Leave channels - When leaving all channels
Leave channels Makes a bot leave one or more group channels. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-leave-channels ----------------------------
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let botUserid = "botUserid_example"; // String |
let opts = {
'channelUrl': "channelUrl_example" // String |
};
apiInstance.leaveChannels(apiToken, botUserid, opts).then(() => {
console.log('API called successfully.');
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
channelUrl | String | [optional] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: Not defined
Object leaveChannelsByUrl(apiToken, botUserid, channelUrl)
Leave channels - When leaving a channel by its channel URL
Leave channels Makes a bot leave one or more group channels. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-leave-channels ----------------------------
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let botUserid = "botUserid_example"; // String |
let channelUrl = "channelUrl_example"; // String |
apiInstance.leaveChannelsByUrl(apiToken, botUserid, channelUrl).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
channelUrl | String |
Object
No authorization required
- Content-Type: Not defined
- Accept: application/json
ListBotsResponse listBots(apiToken, opts)
List bots
List bots Retrieves a list of all bots within an application. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-list-bots ----------------------------
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let opts = {
'token': "token_example", // String |
'limit': 56 // Number |
};
apiInstance.listBots(apiToken, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
token | String | [optional] | |
limit | Number | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
SendBirdMessageResponse sendBotsMessage(apiToken, botUserid, opts)
Send a bot's message
Send a bot's message Sends a bot's message to a channel. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-send-a-bot-s-message ---------------------------- `bot_userid` Type: string Description: Specifies the ID of the bot to send a message.
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let botUserid = "botUserid_example"; // String |
let opts = {
'sendBotSMessageData': new SendbirdPlatformSdk.SendBotSMessageData() // SendBotSMessageData |
};
apiInstance.sendBotsMessage(apiToken, botUserid, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
sendBotSMessageData | SendBotSMessageData | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
UpdateBotByIdResponse updateBotById(apiToken, botUserid, opts)
Update a bot
Update a bot Updates information on a bot. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-update-a-bot ----------------------------
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let botUserid = "botUserid_example"; // String |
let opts = {
'updateBotByIdData': new SendbirdPlatformSdk.UpdateBotByIdData() // UpdateBotByIdData |
};
apiInstance.updateBotById(apiToken, botUserid, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
updateBotByIdData | UpdateBotByIdData | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
ViewBotByIdResponse viewBotById(apiToken, botUserid)
View a bot
View a bot Retrieves information on a bot. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-view-a-bot ----------------------------
import SendbirdPlatformSdk from 'sendbird-platform-sdk';
let apiInstance = new SendbirdPlatformSdk.BotApi();
let apiToken = {{API_TOKEN}}; // String |
let botUserid = "botUserid_example"; // String |
apiInstance.viewBotById(apiToken, botUserid).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String |
No authorization required
- Content-Type: Not defined
- Accept: application/json