Skip to content

cooltheobob/send-bird-sdk-java

Repository files navigation

Sendbird banner image

link to docs

This is a Java library that makes talking to the Sendbird Platform API easier. With this library you can extend your Sendbird integration to include advanced features like channel automation and user management.

🔥 Quick start

import org.sendbird.client.ApiClient;
import org.sendbird.client.ApiException;
import org.sendbird.client.Configuration;
import org.sendbird.client.api.UserApi;
import org.openapitools.client.model.ListUsersResponse;

class User {
    ApiClient defaultClient;
    String apiToken;
    UserApi apiInstance;
    public User(ApiClient defaultClient){
        apiInstance = new UserApi(defaultClient);
        apiToken = "YOUR_API_KEY_FROM_DASHBOARD";

    }
    public void listUsers(){

        try {
            String token = null;
            Integer limit = 56;
            String activeMode = "activated";
            Boolean showBot = true;
            String userIds = null;
            String nickname = null;
            String nicknameStartswith = null;
            String metadatakey = null;
            String metadatavaluesIn = null;
            ListUsersResponse result = apiInstance.listUsers(apiToken, token, limit, activeMode, showBot, userIds, nickname, nicknameStartswith, metadatakey, metadatavaluesIn);
            System.out.println(result);

        } catch (ApiException e) {
            System.err.println("Exception when calling listUsers");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

class App {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api-YOUR_APP_ID_FROM_DASHBOARD.sendbird.com");
        User user = new User(defaultClient);
        user.listUsers();
    }
}

⚒️ Prerequisite

In order to make requests with this SDK you will need you master API token. This can be found through the Sendbird dashboard. Each app you create in Sendbird has its own master api token. These tokens can be found in Settings > Application > General.

how to find you api token

💻 Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven (3.8.3+)/Gradle (7.2+)

⚙️ Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add these dependency to your project's POM:

<dependencies>
    <dependency>
        <groupId>org.sendbird</groupId>
        <artifactId>sendbird-platform-sdk</artifactId>
        <version>1.0.9</version>
    </dependency>
</dependencies>

Gradle users

Add this dependency to your project's build file:

dependencies {
    implementation "org.sendbird:sendbird-platform-sdk:1.0.9"
}

allprojects {
    repositories {
        maven { url "https://repo.sendbird.com/public/maven" }
    }
}

🗃️ Documentation

All the documentation for this project lives in the /docs directory of this repo.

Helpful links
Documentation
Announcement docs/AnnouncementApi.md
Application docs/ApplicationApi.md
Bot docs/BotApi.md
GroupChannel docs/GroupChannelApi.md
Message docs/MessageApi.md
OpenChannel docs/OpenChannelApi.md
User docs/UserApi.md
Webhooks docs/WebhooksApi.md

About

send-bird-sdk-java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages