Appearance
Java SDK - Chat API
About 544 wordsAbout 2 min
Comprehensive code examples for the Stream chat java SDK.
Quick Navigation
- Chat (86 methods)
- Common (84 methods)
- Moderation (31 methods)
- Types Reference - interfaces for API requests/responses
Overview
This documentation covers 201 API methods across 3 categories.
Installation
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-stream-app</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>io.getstream</groupId>
<artifactId>stream-sdk-java</artifactId>
<version>3.0.3-feeds</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<mainClass>Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>Basic Setup
import io.getstream.services.FeedsImpl;
import io.getstream.services.CommonImpl;
import io.getstream.services.framework.StreamHTTPClient;
import io.getstream.models.*;
// Initialize the client
StreamHTTPClient httpClient = new StreamHTTPClient("YOUR_API_KEY", "YOUR_API_SECRET");
FeedsImpl feedsClient = new FeedsImpl(httpClient);
CommonImpl commonClient = new CommonImpl(httpClient);Categories
Chat
queryCampaigns()- Retrieve a list of campaigns based on specific criteria, helping you manage and analyze multiple marketing efforts simultaneously.getCampaign()- Obtain detailed information about a specific campaign, allowing you to review its current status and settings.startCampaign()- Initiate or schedule a campaign to begin at a designated time, enabling you to automate your marketing and outreach activities.stopCampaign()- Stop an ongoing campaign to prevent further messages from being sent, useful when campaign objectives have been achieved or if errors are detected.queryChannels()- Access a list of communication channels available in your account, facilitating efficient management and selection for your campaigns.- ... and 81 more methods
Common
getApp()- Retrieve the current application settings to understand or verify the configuration. Use this method when you need to view the existing app settings without making changes.updateApp()- Modify the application settings to align with new requirements or preferences. Use this method when you need to update the app configuration.listBlockLists()- Get a list of all existing block lists to review or manage them. Use this method when you need an overview of current block lists.createBlockList()- Create a new block list to restrict certain content or users as per your criteria. Use this method when setting up a new block list for moderation or content control.getBlockList()- Access a specific block list to view its details and contents. Use this method when you need to inspect the entries of a particular block list.- ... and 79 more methods
Moderation
insertActionLog()- Use this method to record a log of moderation actions taken within a chat, which helps in maintaining a history of actions for accountability and future reference.appeal()- Submit a request to challenge a moderation decision if you believe it was incorrect or unfair, helping to ensure accurate content moderation.getAppeal()- Retrieve details of a specific appeal you have submitted, allowing you to track the status and outcome of the appeal process.queryAppeals()- Search and list submitted appeals based on specific criteria, enabling you to manage and review multiple appeals efficiently.ban()- Use this method to prohibit a user from accessing your service due to violations, ensuring a safe and respectful environment.- ... and 26 more methods
Generated from Stream OpenAPI specification