Skip to main content
POST

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

string
required
Base64 encoded message content
string
required
Sender user ID
string
required
Target channel ID
integer
required
Channel type (1=personal channel, 2=group channel)

Optional Parameters

object
Message header information
string
Client message number
string
Stream message number
integer
Message expiration time (seconds), 0 means no expiration
array
Specified list of subscribers to receive the message
string
Subscriber user ID

Response Fields

The response is an array, each element corresponds to a sent message:
integer
required
Server-generated message ID
integer
required
Message sequence number
string
required
Client message number (echo)

Status Codes

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

  1. Message Deduplication: Ensure each message’s client_msg_no is unique
  2. Error Handling: Handle cases where some messages fail to send
  3. Permission Verification: Verify sender’s sending permission for all target channels
  4. Content Review: Review batch message content
  5. Rate Limiting: Implement reasonable batch sending rate limits
  6. Monitoring & Alerts: Monitor batch sending success rate and performance