Modify Group Attributes
Description
This API allows you to set the attributes of a specified group.
Request method and endpoint
- Request method: POST
- Request URL:
https://zim-api.zego.im/?Action=ModifyGroupAttribute
- Protocol: HTTPS
- Rate limit: 20 requests/second
Request parameters
Listed below are the parameters specific to this request and part of the common request parameters. For the complete list of common request parameters, see Accessing Server APIs - Common parameters.
Parameter | Type | Required | Description |
---|---|---|---|
Action | Number | Yes | The modification behavior of the current request.
|
FromUserId | String | Yes | The operator id, which needs to be registered. |
GroupId | String | Yes | The group id. |
Attributes | Array of ModifyGroupAttribute | Yes | The updated group attribute information. |
ModifyGroupAttribute structure:
Parameter | Type | Required | Description |
---|---|---|---|
Key | String | Yes | The key of the group attribute. Note If the group attribute key already exists, it will be updated; if the group attribute key does not exist, it will be created. |
Value | String | No | The value of the group attribute. This parameter is required when Action is 0; it is not required when Action is 1. |
Request example
{
"GroupId": "room123",
"FromUserId": "fromUserId",
"Action": 0,
"Attributes": [
{
"Key": "attribute1",
"Value": "value1"
},
{
"Key": "attribute2",
"Value": ""
}
]
}
Response parameters
Parameter | Type | Required | Description |
---|---|---|---|
Code | Number | Yes | The return status code (0 indicates success). |
Message | String | Yes | The return status information. |
RequestId | String | Yes | The request unique identifier. |
FailKeys | Array of FailList | No | The list of keys that failed to be updated or deleted. |
Attributes | Array of StGroupAttributes | No | The list of successfully updated or deleted group attributes. |
FailList structure:
Parameter | Type | Required | Description |
---|---|---|---|
Reason | String | Yes | The reason for the failure. |
Key | String | Yes | The key value that failed to be updated or deleted. |
StGroupAttributes structure:
Parameter | Type | Required | Description |
---|---|---|---|
Attributes | Array of StAttribute | Yes | The list of successfully updated or deleted group attributes. |
StAttribute structure:
Parameter | Type | Required | Description |
---|---|---|---|
Key | String | No | The key of the group attribute. |
Value | String | No | The value of the group attribute. |
Response example
{
"Code": 0,
"Message": "success",
"RequestId": "req-123456789",
"FailKeys": [
{
"Reason": "key db-non-existent",
"Key": "attr1"
},
{
"Reason": "key db-non-existent",
"Key": "attr2"
}
],
"Attributes":
{
"Attributes":[
{
"Key": "attribute1",
"Value": "value1"
},
{
"Key": "attribute2",
"Value": "value2"
}
]
}
}
Return codes
The following table describes only the return codes related to the business logic of the method. For the complete list of return codes, see Return codes.
Return code | Description | Solution |
---|---|---|
660000002 | Parameter error. | Please check the parameters. |
660300006 | The call frequency of the interface exceeds the group/room limit. | Please try again later. |
660500002 | FromUserId is not registered. | Please register FromUserId first. |
660600001 | The group does not exist. | Please confirm whether the input GroupId is correct, or create a group. |
660600009 | Failed to get group information. | Please confirm whether the GroupId is correct. If correct, contact ZEGOCLOUD Technical Support. |
660600028 | Failed to modify group information. | Please contact ZEGOCLOUD Technical Support. |
660300019 | The total length of the value of the group attribute has exceeded the limit. | Please contact ZEGOCLOUD Technical Support. |