logo
In-app Chat
ZIMAudio
On this page

UpdateFriendsAlias

POST

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

Through this API, you can batch modify the remarks of up to 20 friends for one user. If you need to increase the limit (up to 50), please contact ZEGOCLOUD Technical Support.

After successfully modifying friend remarks, users receive relevant modification notifications through the following ZIM SDK callback interface:

iOSAndroidmacOSWindows
friendInfoUpdatedonFriendInfoUpdatedfriendInfoUpdatedonFriendInfoUpdated
WebMini ProgramFlutterReact Native
friendInfoUpdatedfriendInfoUpdatedonFriendInfoUpdatedfriendInfoUpdated
uni-app | uni-app xHarmonyOS
friendInfoUpdatedfriendInfoUpdated
Note

The users corresponding to the parameters FromUserId and UserId have logged in to the ZIM service by calling the login method on the client, or have completed registration by calling the server-side API.

QPS Limit
20 times/s

Request

Query Parameters

    Action stringrequired

    Possible values: [UpdateFriendsAlias]

    API prototype parameter

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

    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.

Body

required
    FromUserId stringrequired

    Possible values: <= 32 characters

    Update the remark for specified friends of this user.

    UserIds object[]required
    Possible values: <= 20
    List of users whose remarks are to be updated. A maximum of 20 users can be modified at a time.
  • Array[
  • UserId stringrequired

    Possible values: <= 32 characters

    User ID. Maximum length is 32 bytes.

    FriendAlias string

    Possible values: <= 256 characters

    New friend remark, with a maximum length of 256 characters.

  • ]

Responses

OK
Schema
    Code integer

    Return code.

    The following only lists the Code and SubCode related to the API business logic. For complete return codes, please refer to Global Return Codes.

    Note

    When you initiate a request to update multiple friend remarks at the same time:

    • If 1 or more friend remarks are successfully updated, Code will return 0. In this case, please refer to the specific information in ErrorList to confirm the operation result.
    • If all friend remarks fail to be updated, Code will return the relevant return code. For details, please refer to Global Return Codes.
    Code / SubCodeDescriptionSuggested 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.
    660800019Single batch operation exceeds the limit.Reduce the number of single batch operations.
    660800021FriendAlias exceeds the length limit.Please reduce the content length of the related fields.
    660800034This user is not a friend of FromUserId.Please add this user as a friend first.
    Message string

    Operation result description.

    RequestId string

    Request ID.

    ErrorList object[]
    Check failure list.
    • Code is 0:
    • ErrorList is empty, all friend remarks are successfully modified.
    • ErrorList is not empty, indicating that some friend remarks failed to be modified. Please refer to SubCode for processing.
    • Code is not 0:
    • ErrorList is empty, indicating parameter error, API frequency limit, or system error.
    • ErrorList is not empty, indicating that all friend remarks failed to be modified.
  • Array[
  • UserId string

    User ID whose friend remark failed to be modified.

    SubCode number

    Specific failure return code. For complete return codes, please refer to the Code description or Global Return Codes.

  • ]

Previous

Check friendships

Next

Modify the attributes of a friend

On this page

Back to top