Overview
The message module lets business backends write and manage messages through the Platform API. In addition to normal sending, batch delivery, and business notifications, Enterprise capabilities cover content processing, streaming messages, unread counts, and read state.
Capability scope
| Capability | Description |
|---|---|
| Send messages | Write a message to a one-to-one or group conversation with a sender, target, content type, push options, and send time. |
| Batch sending | Send the same message to multiple users or deliver a low-frequency system notification to all users. |
| Business notifications | Deliver custom business events through OpenIM. Clients receive OnRecvCustomBusinessMessage; the request controls whether a conversation message is also created and which reliability level is used. |
| Message management | Revoke a message by conversation ID and message Seq and synchronize the revoke event to relevant users. |
| Time synchronization | Get the message server time for send timestamps, migration, and business log alignment. |
| Message modification Enterprise | Modify message content or extension fields and synchronize the change to relevant clients. |
| Content processing Enterprise | Translate message or business text through a server-side API. |
| Streaming messages Enterprise | Create a streaming message and append content for progressively generated responses such as AI output. |
| Unread count management Enterprise | Query, clear, or reset unread counts for selected user conversations. |
| Read state Enterprise | Mark a selected user conversation as read. |
Common APIs
- Message content types
- Send a message
- Batch send messages
- Send a business notification
- Revoke a message
- Get server time
- Modify a message Enterprise
- Translate text Enterprise
- Create a streaming message Enterprise
- Append to a streaming message Enterprise
- Get conversation unread counts Enterprise
- Mark a conversation as read Enterprise
Enums
ContentType
contentType determines the JSON structure of content. See Message content types for message-specific fields and examples.
SessionType
Message sessionType uses the same values as ConversationType.
MsgFrom
| Value | Name | Description |
|---|---|---|
| 100 | UserMsgType | User message. |
| 200 | SysMsgType | System message. |
MessageStatus
| Value | Name | Description |
|---|---|---|
| 1 | MsgNormal | Normal message. |
| 4 | MsgDeleted | Deleted message. |
Integration advice
Before sending from the backend, verify that the sender identity, target user or group, content type, and push options originate from a trusted business workflow. Normal user chat is generally sent by the client SDK under the signed-in user's identity; the Platform API is better suited to system messages, operational notifications, migration, and administration.
When importing historical messages, use sendTime to preserve the original timestamp. Import users, groups, and friend relationships first, then write messages in conversation order to avoid timeline discontinuities.
Related pages
Was this page helpful?