Skip to main content
POST

Overview

Batch get IM connection addresses for multiple users, used to assign different connection nodes for different users.

Query Parameters

integer
default:0
Whether to return intranet addresses
  • 0 - Return external network addresses
  • 1 - Return internal network addresses

Request Body

array
required
Array of user IDs
string
User ID

Response Fields

The response is an array, each element contains the following fields:
array
required
List of user IDs assigned to this address
string
required
TCP connection address, format: host:port
string
required
WebSocket connection address, format: ws://host:port
string
required
WebSocket Secure connection address, format: wss://host:port

Status Codes

Use Cases

Multi-User Connection Setup

Batch Connect Multiple Users:

Load Distribution

Distribute Users Across Nodes:

Connection Pool Management

Manage Connection Pools by Node:

Geographic Distribution

Route Users by Geographic Location:

Best Practices

  1. Batch Size: Use appropriate batch sizes to balance performance and resource usage
  2. Error Handling: Handle partial failures gracefully when some users can’t be routed
  3. Caching: Cache node assignments to reduce API calls for frequently accessed users
  4. Load Monitoring: Monitor node load distribution and adjust routing as needed
  5. Failover: Implement failover mechanisms when assigned nodes become unavailable
  6. Geographic Optimization: Consider user geographic location for optimal routing
  7. Connection Pooling: Use connection pools to efficiently manage multiple user connections