Overview
Send multiple messages in batch to improve message sending efficiency, suitable for group notifications, bulk push, and other scenarios.Request Body
The request body is an array of message objects, each message object contains the following fields:Required Parameters
Base64 encoded message content
Sender user ID
Target channel ID
Channel type (1=personal channel, 2=group channel)
Optional Parameters
Message header information
Client message number
Stream message number
Message expiration time (seconds), 0 means no expiration
Specified list of subscribers to receive the message
Subscriber user ID
Response Fields
The response is an array, each element corresponds to a sent message:Server-generated message ID
Message sequence number
Client message number (echo)
Status Codes
| Status Code | Description |
|---|---|
| 200 | Batch messages sent successfully |
| 400 | Request parameter error |
| 403 | No sending permission |
| 500 | Internal server error |
Use Cases
System Notifications
- Announcement Push: Send system announcements to multiple groups
- Activity Notifications: Batch send activity reminder messages
- Maintenance Notifications: Batch notifications before system maintenance
Marketing Promotion
- Promotional Messages: Send promotional information to target user groups
- New Feature Introduction: Batch push new feature usage guides
- User Surveys: Send questionnaire survey messages
Operations Management
- Data Statistics: Batch send data reports
- Task Assignment: Batch assign tasks to team members
- Meeting Notifications: Batch send meeting invitations
Performance Optimization
Batch Size
- Recommended Batch: Single batch sending should not exceed 100 messages
- Batch Processing: Large volumes of messages can be sent in batches to avoid timeouts
- Concurrency Control: Control the number of concurrent batch requests
Message Optimization
- Content Compression: For identical content, use templates to reduce data transmission
- Asynchronous Processing: Use asynchronous methods to handle batch sending
- Error Retry: Implement retry mechanism for failed messages
Best Practices
- Message Deduplication: Ensure each message’s client_msg_no is unique
- Error Handling: Handle cases where some messages fail to send
- Permission Verification: Verify sender’s sending permission for all target channels
- Content Review: Review batch message content
- Rate Limiting: Implement reasonable batch sending rate limits
- Monitoring & Alerts: Monitor batch sending success rate and performance

