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, createBotData)
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 classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
CreateBotData createBotData = new CreateBotData(); // CreateBotData |
try {
CreateBotResponse result = apiInstance.createBot(apiToken, createBotData);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#createBot");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
createBotData | CreateBotData | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
Object deleteBotById(apiToken, botUserid)
Delete a bot
Deletes a bot from an application.
// Import classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
String botUserid = "botUserid_example"; // String |
try {
Object result = apiInstance.deleteBotById(apiToken, botUserid);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#deleteBotById");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String |
Object
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
JoinChannelsResponse joinChannels(apiToken, botUserid, joinChannelsData)
Join channels
Makes a bot join one or more channels.
// Import classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
String botUserid = "botUserid_example"; // String |
JoinChannelsData joinChannelsData = new JoinChannelsData(); // JoinChannelsData |
try {
JoinChannelsResponse result = apiInstance.joinChannels(apiToken, botUserid, joinChannelsData);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#joinChannels");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
joinChannelsData | JoinChannelsData | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
leaveChannels(apiToken, botUserid, channelUrl)
Leave channels - When leaving all channels
Makes a bot leave one or more group channels.
// Import classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
String botUserid = "botUserid_example"; // String |
String channelUrl = "channelUrl_example"; // String |
try {
apiInstance.leaveChannels(apiToken, botUserid, channelUrl);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#leaveChannels");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
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
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
Object leaveChannelsByUrl(apiToken, botUserid, channelUrl)
Leave channels - When leaving a channel by its channel URL
Makes a bot leave one or more group channels.
// Import classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
String botUserid = "botUserid_example"; // String |
String channelUrl = "channelUrl_example"; // String |
try {
Object result = apiInstance.leaveChannelsByUrl(apiToken, botUserid, channelUrl);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#leaveChannelsByUrl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
channelUrl | String |
Object
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
ListBotsResponse listBots(apiToken, token, limit)
List bots
Retrieves a list of all bots within an application.
// Import classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
String token = "token_example"; // String |
Integer limit = 56; // Integer |
try {
ListBotsResponse result = apiInstance.listBots(apiToken, token, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#listBots");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
token | String | [optional] | |
limit | Integer | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
SendBirdMessageResponse sendBotsMessage(apiToken, botUserid, sendBotSMessageData)
Send a bot's message
Sends a bot's message to a channel.
bot_userid
Type: string
Description: Specifies the ID of the bot to send a message.
// Import classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
String botUserid = "botUserid_example"; // String |
SendBotSMessageData sendBotSMessageData = new SendBotSMessageData(); // SendBotSMessageData |
try {
SendBirdMessageResponse result = apiInstance.sendBotsMessage(apiToken, botUserid, sendBotSMessageData);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#sendBotsMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
sendBotSMessageData | SendBotSMessageData | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
UpdateBotByIdResponse updateBotById(apiToken, botUserid, updateBotByIdData)
Update a bot
Updates information on a bot.
// Import classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
String botUserid = "botUserid_example"; // String |
UpdateBotByIdData updateBotByIdData = new UpdateBotByIdData(); // UpdateBotByIdData |
try {
UpdateBotByIdResponse result = apiInstance.updateBotById(apiToken, botUserid, updateBotByIdData);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#updateBotById");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String | ||
updateBotByIdData | UpdateBotByIdData | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
ViewBotByIdResponse viewBotById(apiToken, botUserid)
View a bot
Retrieves information on a bot.
// Import classes:
import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.model.*;
import org.sendbird.client.api.BotApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api-APP_ID.sendbird.com");
BotApi apiInstance = new BotApi(defaultClient);
String apiToken = "{{API_TOKEN}}"; // String |
String botUserid = "botUserid_example"; // String |
try {
ViewBotByIdResponse result = apiInstance.viewBotById(apiToken, botUserid);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BotApi#viewBotById");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
apiToken | String | ||
botUserid | String |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |