API overview
ZEGOCLOUD's In-app Chat provides you with the following Server APIs, please refer to Accessing Server APIs to call the following interface.
User related
Method | Description | Default Frequency Limit |
---|---|---|
Query user's online status | Query the online status of a single user or multiple users. | 20 times/second |
Query user information | This API allows you to retrieve information for multiple users based on their user IDs. The response includes each user's name, avatar, and other extended fields. | 20 times/second |
Batch register users | Register ZEGOCLOUD Instant Messaging (ZIM) accounts for users. | 20 times/second |
Modify user information | Modify user information, including the nickname and avatar. | 20 times/second |
Batch add friends | Add up to 20 friends for a user without their consent. | 20 times/second |
Batch send friend requests | Send friend requests to up to 20 users for a user. | 20 times/second |
Batch delete friends | Delete up to 20 friends for a user in a one-way or two-way manner. | 20 times/second |
Delete all friends | Delete all friends for a user in a one-way or-way manner. | 20 times/second |
Query the friend list | Query the list of friends by page based on a user ID, including information such as the friend alias and friend relation creation time. | 20 times/second |
Check friendship | Check the friend relation between a user and up to 20 users. | 20 times/second |
Change the alias of a friend | Change the aliases of up to 20 friends for a user. | 20 times/second |
Modify the attributes of a friend | Modify the attributes of a friend for a user. | 20 times/second |
Batch block users | Block up to 20 users for a user. | 20 times/second |
Batch unblock users | Unblock up to 20 users for a user. | 20 times/second |
Query the blocklist | Get the list of all blocked friends based on a user ID by page. | 20 times/second |
Check blockships | Check whether up to 20 users are on the target user's blacklist. | 20 times/second |
Room related
Method | Description | Default Frequency Limit |
---|---|---|
Obtain information about users in a room | Obtain information about users in a room by room ID, including the number of users, user ID, and username. | 20 times/second |
Remove user from the room | Remove specified users from the room. | 20 times/second |
Destroy the room | Destroy a room. | 20 times/second |
Query whether a user is in a room | Query whether users are in a specified room. | 20 times/second |
Group related
Method | Description | Default Frequency Limit |
---|---|---|
Create a group | Create a group | 20 times/second |
Modify group specification limits | Modify the following group settings: JoinMode , InviteMode , BeInvitedMode , and MemberCountLimit . | 20 times/second |
Query group list in the app | zim-QueryAppGroupList | 20 times/second |
Query group member list | Get the user list in a group based on the group ID. | 20 times/second |
Remove group members | Remove users in the group by specifying their user IDs. | 20 times/second |
Transfer the group ownership | Transfer the group ownership to a group member. | 1 time/second, group level limit |
Add group members | Add users to a specified group chat in batch. | 1 time/second, group level limit |
Set nicknames of group members | Change the nicknames of up to 20 group members at a time in batch. | 1 time/second, group level limit |
Set group member roles | Set roles for group members within the group. | 20 times/second |
Mute a group | Mute or unmute all members or certain roles in a group. | 20 times/second |
Mute group members | Mute or unmute specific members in a group. | 20 times/second |
Disband a group chat | Disband a group chat | 1 time/second, group level limit |
Message related
Method | Description | Default Frequency Limit |
---|---|---|
Send a one-to-one message | Send one-to-one messages to one or more users. | 20 times/second |
Send group messages | Send messages to all online users in a group. | 10 times/second |
Send room messages | Send messages to all online users in a room. | 10 times/second |
Push message to all users | Send messages with specific content, such as text, images, etc., to all online users, including the sender of the message. | 1/second, limited to 100 times per 24 hours |
Recall a one-to-one message | Recall a one-to-one message sent within two minutes. | 20 times/second |
Recall a group message | Recall a group message sent within two minutes. | 20 times/second |
Import one-to-one messages | Import historical one-to-one messages in chronological order from another instant messaging service to ZEGO Instant Messaging (ZIM). | 20 times/second |
Import group messages | Import historical group messages in chronological order from another instant messaging service to ZEGOCLOUD Instant Messaging (ZIM). | 20 times/second |
Call invitation related
Method | Description | Default Frequency Limit |
---|---|---|
Send a call invitation | Create a call invitation in general mode. | 20 times/second |
Accept a call invitation | Accept a call invitation for a user. | 20 times/second |
Reject a call invitation | Reject a call invitation for a user. | 20 times/second |
Conversation related
Method | Description | Default Frequency Limit |
---|---|---|
Mute notifications for conversations | Batch mute notifications for one-to-one chats or group chats. | 20 times/second |
Pin or unpin conversations to or from the top | Pin or unpin up to 20 conversations to or from the top for a user in batch. | 20 times/second |
Query conversation list | Paginate and fetch the all conversation list. | 20 times/second |
Query the message list of one-on-one chats | Paginate and fetch the message list of a specific one-on-one chat for a specified user. | 20 times/second |
Query the message list of group chats | Paginate and fetch the message list of a specific group chat. | 20 times/second |
ZIMAudio Server
Method | Description | Default Frequency Limit |
---|---|---|
Obtain a license | Obtain the license of the audio component. | 20 times/second |
Third party callback
Callback | Description |
---|---|
Login and logout callback | Listen for user login and logout and implement the business logic, for example, counting online users. |
Callback on call invitation sent | After a call is created on the client, the business backend receives the call creation callback from the ZIM server to check whether the call is created successfully. |
Callback on call invitation canceled | When the following situations occur, the business backend can receive a callback from the ZIM server to cancel a call, which helps determine the call status:
|
Callback on call invitation accepted | After the callee accepts the call invitation, the business server can receive the callback on the call invitation accepted by the In-app Chat Server to determine the success of the call invitation acceptance request. |
Callback on call invitation rejected | After the callee rejects the call invitation, the business server can receive the callback on the call invitation rejected by the In-app Chat Server to determine the success of the call invitation request. |
Callback on call invitation timed out | After the call invitation is sent successfully, when the following situations occur, the business server can receive the call timeout callback from the In-app Chat Server to know the target user:
|
Callback on message not sent yet | After setting this callback, when a user sends a message to a one-on-one chat, group chat or room chat, In-app Chat will initiate a request to your business server, and you can perform real-time operations on the message through the response. |
Callback on message sent | After the user sends a message to one-on-one chat, group chat, or room successfully or fails, the business server can receive the message sending callback from the In-app Chat server, and synchronize the message sent by the user to the business server in real time, and store it in the business server. |