sendbird / sendbird-platform-sdk-java

Sendbird Platform SDK for Java
MIT License
8 stars 6 forks source link

Add Start/Stop Typing indicator specs #19

Closed jerry-jeon-sb closed 10 months ago

jerry-jeon-sb commented 10 months ago

Sample code snippet

        String apiToken = ""; //Your Api Token
        String appId = ""; //Your App ID
        String channelUrl = ""; //Channel URL
        String botId = ""; //Bot ID

        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api-" + appId + ".sendbird.com");

        GroupChannelApi groupChannelApi = new GroupChannelApi(defaultClient);
        GcTypingIndicatorsData gcTypingIndicatorsData = new GcTypingIndicatorsData();
        List<String> userIds = new ArrayList<>();
        userIds.add(botId);
        gcTypingIndicatorsData.setUserIds(userIds);

        try {
            OcDeleteChannelByUrl200Response result = groupChannelApi.gcStopTypingIndicators(channelUrl)
                    .apiToken(apiToken)
                    .gcTypingIndicatorsData(gcTypingIndicatorsData)
                    .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling GroupChannelApi#gcStopTypingIndicators");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }