You can call this operation to modify the attributes of a friend for a user.
After attributes are successfully modified, the user receives the notification in the following ZIM SDK callbacks.
iOS | Android | macOS | Windows | Web |
---|---|---|---|---|
Flutter | ||||
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.
Parameter |
Type |
Required |
Description |
FromUserId |
String |
Yes |
The ID of the registered user whose friend's attributes are to be modified. |
UserId |
String |
Yes |
The list of friends whose attributes are to be modified. |
Attributes |
Array Of Object |
Yes |
The new attributes. By default, up to five attributes of a friend can be modified at a time. The total length of the `Key` and `Value` parameters cannot exceed 1,024 bytes. If you need a higher limit, contact ZEGOCLOUD technical support. We recommend that you set a proper limit. |
Key |
String |
Yes |
The key of a friend attribute. Valid values: k0 , k1 , k2 , k3 , and k4 . |
Value |
String |
Yes |
The value of a friend attribute. |
Action |
Number |
No |
The action on an attribute. 0 : set the attribute. |
The FromUserId
and UserId
parameters can contain only digits, letters, and the following characters: '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', '{', '}', '|', '~'.
Request URL
https://zim-api.zego.im/?Action=UpdateFriendAttributes
&<Common request parameters>
Request body
{
"FromUserId": "zego_user",
"UserId": "UserId",
"Attributes": [
{
"Key": "k0",
"Value": "Value1"
},
{
"Key": "k2",
"Value": "Value2"
}
],
"Action": 0
}
Parameter | Type | Description |
---|---|---|
Code |
Number |
The return code. When you request to modify the attributes of multiple friends, take note of the following items:
|
Message |
String |
The description of the operation result. |
RequestId |
String |
The request ID. |
FailKey |
Array of Object |
The list of failed results.
|
Key |
String |
The key of the attribute that fails to be modified. |
SubCode |
Number |
The code returned when the request fails. |
{
"Code": 0,
"Message": "success",
"RequestId": "343649807833778782",
"FailKey": [
{
"key": "k0",
"SubCode": 660800032
}
]
}
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 Code | Description | Solution |
---|---|---|
660000001 |
A common service error occurred. |
Try again, or contact ZEGOCLOUD technical support. |
660000002 |
Invalid parameter. |
Check the input parameter. |
660300005 |
The QPS limit specified in AppID is exceeded. |
Try again later. |
660800023 |
The value of the Key parameter for the Attributes parameter is not k0 , k1 , k2 , k3 , or k4 . |
Modify the value of the Key parameter. |
660800024 |
|
Reduce the parameter length. |
660800032 |
Attributes are repeated. |
Modify repeated attributes. |