Background
Bots can receive messages in two modes: Stream mode and HTTP mode. This document describes how to receive messages in both modes.Prerequisites
- Complete the Create an app process.
- Complete the process of adding app capabilities.
Procedure
Stream mode (recommended)
For more languages, refer to the Server-side Stream mode documentation.
- Prepare the Java development environment:
- Runtime: JDK 1.8 or later
-
Install the Java SDK:
Add the dependency to your project’s
pom.xmlfile or download the corresponding JAR package. You can view and download the latest SDK version here.
-
Server-side integration example:
-
After the development is complete, add the Bot to a group. When you send “Hello” by @ the Bot, the server receives a message in the following format:
HTTP mode
-
Prepare the Java development environment:
- Runtime: JDK 1.7 or later
-
Server-side integration example:
-
After the development is complete, add the Bot to a group. When you send “Hello” by @ the Bot, the server receives a message in the following format: