Skip to main content

Block Users

Block users to prevent all communication with them. Use blockUsers() with an array of UIDs.
Returns an object with UIDs as keys and "success" or "fail" as values. Each User in the request is processed independently.

Unblock Users

Unblock previously blocked users using unblockUsers() with an array of UIDs.
Returns an object with UIDs as keys and "success" or "fail" as values. Each User in the request is processed independently.

Get List of Blocked Users

Use BlockedUsersRequestBuilder to fetch blocked users with filtering and pagination.

Set Limit

Sets the number of blocked users to fetch per request.

Set Search Keyword

Filters blocked users by a search string.

Set Direction

Filters by block direction:
  • BLOCKED_BY_ME — Users blocked by the logged-in user
  • HAS_BLOCKED_ME — Users who have blocked the logged-in user
  • BOTH — Both directions (default)
Finally, once all the parameters are set to the builder class, you need to call the build() method to get the object of the BlockedUsersRequest class. Once you have the object of the BlockedUsersRequest class, you need to call the fetchNext() method. Calling this method will return a list of User objects containing n number of blocked users where N is the limit set in the builder class.
After configuring the builder, call build() to get the BlockedUsersRequest object, then call fetchNext() to retrieve blocked users.
The fetchNext() method returns an array of User objects representing blocked users. Relevant fields to access on returned users:

Next Steps

Retrieve Users

Fetch and filter user lists

User Presence

Track online/offline status of users

User Management

Create, update, and delete users

Flag Message

Report inappropriate messages from users