logo
In-app Chat
Powered Byspreading
On this page

Delete all friends


Overview

You can call this operation to delete all friends for a user in a one-way or two-way manner.

In this example, one-way deletion and two-way deletion are explained.

  • One-way deletion: If user A deletes user B in a one-way manner, user B is no longer a friend of user A, but not vice versa.
  • Two-way deletion: If user A deletes user B in a two-way manner, they are no longer friends with each other.

After friends are deleted, the client of the user receives the friend list update notification in the following ZIM SDK callbacks:

iOSAndroidmacOSWindows
friendListChangedonFriendListChangedfriendListChangedonFriendListChanged
WebFlutterReact Native
friendListChangedonFriendListChangedfriendListChanged

Operation prototype

  • Request method: GET
  • Request URL: https://zim-api.zego.im/?Action=DeleteAllFriends
  • Protocol: HTTPS
  • QPS limit: 20 calls per second

Request parameters

The following table describes only the operation-specific request parameters and some common request parameters. For the complete list of common request parameters, see the Public request parameters section of the Accessing Server APIs topic.

ParameterTypeRequiredDescription
FromUserIdStringYesThe ID of the registered user for whom all friends are to be deleted.
DeleteTypeNumberYesThe deletion type. Valid values:
  • 0: two-way deletion;
  • 1: one-way deletion.
Note

The `FromUserId` and `UserId` parameters can contain only digits, letters, and the following characters: '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', ', ', '|', '~'.

Sample request

Untitled
https://zim-api.zego.im/?Action=DeletedAllFriends
&FromUserId=zego_user&DeleteType=1
&<Common request parameters>
1
Copied!

Response parameters

ParameterTypeDescription
CodeNumberThe return code.
MessageStringThe description of the request result.
RequestIdStringThe request ID.

Sample response

Untitled
{
    "Code": 0,
    "Message": "success",
    "RequestId": "343649807833778782",
}
1
Copied!

Return codes

The following table describes only the return codes related to the business logic of the operation. For the complete list of return codes, see Return codes.

Return CodeDescriptionSolution
660000001A common service error occurred.Try again, or contact ZEGOCLOUD technical support.
660000002Invalid parameter.Check the input parameter.
660300005The QPS limit specified in AppID is exceeded.Try again later.

Previous

Batch delete friends

Next

Destroy the room