Skip to main content

Add Users to Blocklist

Add one or more users to the blocklist of a specified user. Users added to the blocklist cannot send one-to-one chat messages to the current user.

  • The blocklist service restricts users from sending messages to each other, but adding to the blocklist is a one-way operation. For example, if User A blocks User B, it means B cannot send messages to A. However, A can still send messages to B, and B will receive them normally.
  • There is an upper limit to the total number of users in a single user's blocklist. For Chat Starter Plan and Chat Pro Plan, the limit is 3000 users.
  • Sending one-to-one chat messages via the server API is not restricted by the blocklist by default. To enable this restriction, set verifyBlacklist to 1 when calling the relevant API.
tip

While establishing the user blocklist relationship on the IM server, it is recommended to maintain a copy of the user blocklist relationship on your own application server for easier business data processing.

Request Method

POST: https://Data Center Domain/user/blocklist/add.json

Rate Limit: 100 requests per second

Signature Rule: All server API requests must be verified according to the rules. For details, see API Request Signature.

Body Parameters

The HTTP request body data format is application/x-www-form-urlencoded, and the following HTTP form parameters are supported:

ParameterTypeRequiredDescription
userIdStringYesUser ID.
blackUserIdStringYesThe user ID to be added to the blocklist. A maximum of 20 blackUserId can be added at once. There is an upper limit to the total number of users in a single user's blocklist. For Chat Starter Plan and Chat Pro Plan, the limit is 3000 users.

Request Example

POST /user/blocklist/add.json HTTP/1.1
Host: api.rong-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/x-www-form-urlencoded

userId=jlk456j5&blackUserId=jlk454&blackUserId=jlk457

Response

The HTTP response body contains a JSON object with the following structure:

Return ValueReturn TypeDescription
codeNumberReturn code, 200 means success.

Response Example

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{"code":200}