logo
In-app Chat
ZIMAudio
On this page

DeleteAllFriends

GET

https://zim-api.zego.im/

By calling this API, you can delete all friends for a user in one-way or two-way mode.

Taking users A and B as examples to illustrate one-way deletion and two-way deletion:

  • One-way deletion: When user A deletes user B in one-way mode, user B is no longer a friend of user A, but user A is still a friend of user B.
  • Two-way deletion: When user A deletes user B in two-way mode, they are no longer friends with each other.

After successfully deleting friends for users, the clients of the relevant users will receive friend list update notifications through the following ZIM SDK callback interface:

iOSAndroidmacOSWindows
friendListChangedonFriendListChangedfriendListChangedonFriendListChanged
WebMini ProgramFlutterReact Native
friendListChangedfriendListChangedonFriendListChangedfriendListChanged
uni-app | uni-app xHarmonyOS
friendListChangedfriendListChanged
Note
The parameter FromUserId Only supports numbers, English characters, and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', '{', '}', '|', '~'
Note
QPS Limit: 20 times/s

Request

Query Parameters

    Action stringrequired

    Possible values: [DeleteAllFriends]

    API prototype parameter

    https://zim-api.zego.im/?Action=DeleteAllFriends

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Public parameter. A 16-character hexadecimal random string (hex encoding of 8-byte random number). Refer to Signature example for how to generate.

    Timestamp int64required

    💡Public parameter. Current Unix timestamp, in seconds. Refer to Signature example for how to generate, with a maximum error of 10 minutes.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    Signature stringrequired

    💡Public parameter. Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.

    FromUserId stringrequired

    Possible values: <= 32 characters

    Delete all friends for this UserId (who has logged in to the ZIM service by calling the login method on the client, or has completed registration by calling the server-side API).

    DeleteType numberrequired

    Possible values: [0, 1]

    Deletion type:

    • 0:Two-way deletion.
    • 1:One-way deletion.

Responses

OK
Schema
    Code integer

    Return code.

    The following only lists the return codes related to the API business logic. For the complete return codes, please refer to Return codes.

    Return CodeDescriptionSuggested Solution
    660000001General business error.Please retry or contact ZEGOCLOUD Technical Support.
    660000002Input parameter error。Please check the input parameters。
    660300005The API call frequency exceeds the AppID-level limit.Please try again later.
    Message string

    Description of the request result.

    RequestId string

    Request ID.

Previous

Delete friends

Next

Create a room

On this page

Back to top