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()
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 { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiCreateBotRequest = {
// string (optional)
apiToken: "{{API_TOKEN}}",
// CreateBotData (optional)
createBotData: {
botUserid: "botUserid_example",
botNickname: "botNickname_example",
botProfileUrl: "botProfileUrl_example",
botType: "botType_example",
botCallbackUrl: "botCallbackUrl_example",
isPrivacyMode: true,
enableMarkAsRead: true,
showMember: true,
channelInvitationPreference: 1,
},
};
apiInstance.createBot(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
createBotData | CreateBotData | ||
apiToken | [string] | (optional) defaults to undefined |
CreateBotResponse
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
any deleteBotById()
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 { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiDeleteBotByIdRequest = {
// string
botUserid: "bot_userid_example",
// string (optional)
apiToken: "{{API_TOKEN}}",
};
apiInstance.deleteBotById(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
botUserid | [string] | defaults to undefined | |
apiToken | [string] | (optional) defaults to undefined |
any
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
JoinChannelsResponse joinChannels()
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 { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiJoinChannelsRequest = {
// string
botUserid: "bot_userid_example",
// string (optional)
apiToken: "{{API_TOKEN}}",
// JoinChannelsData (optional)
joinChannelsData: {
botUserid: "botUserid_example",
channelUrls: [
"channelUrls_example",
],
},
};
apiInstance.joinChannels(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
joinChannelsData | JoinChannelsData | ||
botUserid | [string] | defaults to undefined | |
apiToken | [string] | (optional) defaults to undefined |
JoinChannelsResponse
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void leaveChannels()
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 { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiLeaveChannelsRequest = {
// string
botUserid: "bot_userid_example",
// string (optional)
apiToken: "{{API_TOKEN}}",
// string (optional)
channelUrl: "channel_url_example",
};
apiInstance.leaveChannels(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
botUserid | [string] | defaults to undefined | |
apiToken | [string] | (optional) defaults to undefined | |
channelUrl | [string] | (optional) defaults to undefined |
void
No authorization required
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
any leaveChannelsByUrl()
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 { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiLeaveChannelsByUrlRequest = {
// string
botUserid: "bot_userid_example",
// string
channelUrl: "channel_url_example",
// string (optional)
apiToken: "{{API_TOKEN}}",
};
apiInstance.leaveChannelsByUrl(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
botUserid | [string] | defaults to undefined | |
channelUrl | [string] | defaults to undefined | |
apiToken | [string] | (optional) defaults to undefined |
any
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListBotsResponse listBots()
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 { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiListBotsRequest = {
// string (optional)
apiToken: "{{API_TOKEN}}",
// string (optional)
token: "token_example",
// number (optional)
limit: 1,
};
apiInstance.listBots(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
apiToken | [string] | (optional) defaults to undefined | |
token | [string] | (optional) defaults to undefined | |
limit | [number] | (optional) defaults to undefined |
ListBotsResponse
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SendBirdBotsMessageResponse sendBotsMessage()
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 { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiSendBotsMessageRequest = {
// string
botUserid: "bot_userid_example",
// string (optional)
apiToken: "{{API_TOKEN}}",
// SendBotSMessageData (optional)
sendBotSMessageData: {
message: "message_example",
channelUrl: "channelUrl_example",
customType: "customType_example",
data: "data_example",
sendPush: true,
mentioned: [
"mentioned_example",
],
markAsRead: true,
dedupId: "dedupId_example",
createdAt: 1,
extendedMessagePayload: {
suggestedReplies: [
"suggestedReplies_example",
],
customView: {},
},
targetMessageId: 1,
},
};
apiInstance.sendBotsMessage(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
sendBotSMessageData | SendBotSMessageData | ||
botUserid | [string] | defaults to undefined | |
apiToken | [string] | (optional) defaults to undefined |
SendBirdBotsMessageResponse
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateBotByIdResponse updateBotById()
Update a bot Updates information on a bot. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-update-a-bot ----------------------------
import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiUpdateBotByIdRequest = {
// string
botUserid: "bot_userid_example",
// string (optional)
apiToken: "{{API_TOKEN}}",
// UpdateBotByIdData (optional)
updateBotByIdData: {
botUserid: "botUserid_example",
botNickname: "botNickname_example",
botProfileUrl: "botProfileUrl_example",
botCallbackUrl: "botCallbackUrl_example",
isPrivacyMode: true,
enableMarkAsRead: true,
showMember: true,
channelInvitationPreference: 1,
},
};
apiInstance.updateBotById(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
updateBotByIdData | UpdateBotByIdData | ||
botUserid | [string] | defaults to undefined | |
apiToken | [string] | (optional) defaults to undefined |
UpdateBotByIdResponse
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ViewBotByIdResponse viewBotById()
View a bot Retrieves information on a bot. https://sendbird.com/docs/chat/v3/platform-api/guides/bot-interface#2-view-a-bot ----------------------------
import { Sendbird } from 'sendbird-platform-sdk';
import * as fs from 'fs';
const configuration = Sendbird.createConfiguration();
const apiInstance = new Sendbird.BotApi(configuration);
let body:Sendbird.BotApiViewBotByIdRequest = {
// string
botUserid: "bot_userid_example",
// string (optional)
apiToken: "{{API_TOKEN}}",
};
apiInstance.viewBotById(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
botUserid | [string] | defaults to undefined | |
apiToken | [string] | (optional) defaults to undefined |
ViewBotByIdResponse
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]