logo
In-app Chat
On this page

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.

ParameterTypeRequiredDescription
ActionNumberYesThe modification behavior of the current request.
  • 0(Default):Update group attributes.
  • 1:Delete group attributes.
FromUserIdStringYesThe operator id, which needs to be registered.
GroupIdStringYesThe group id.
AttributesArray of ModifyGroupAttributeYesThe updated group attribute information.

ModifyGroupAttribute structure:

ParameterTypeRequiredDescription
KeyStringYesThe 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.
ValueStringNoThe 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

ParameterTypeRequiredDescription
CodeNumberYesThe return status code (0 indicates success).
MessageStringYesThe return status information.
RequestIdStringYesThe request unique identifier.
FailKeysArray of FailListNoThe list of keys that failed to be updated or deleted.
AttributesArray of StGroupAttributesNoThe list of successfully updated or deleted group attributes.

FailList structure:

ParameterTypeRequiredDescription
ReasonStringYesThe reason for the failure.
KeyStringYesThe key value that failed to be updated or deleted.

StGroupAttributes structure:

ParameterTypeRequiredDescription
AttributesArray of StAttributeYesThe list of successfully updated or deleted group attributes.

StAttribute structure:

ParameterTypeRequiredDescription
KeyStringNoThe key of the group attribute.
ValueStringNoThe 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 codeDescriptionSolution
660000002Parameter error.Please check the parameters.
660300006The call frequency of the interface exceeds the group/room limit.Please try again later.
660500002FromUserId is not registered.Please register FromUserId first.
660600001The group does not exist.Please confirm whether the input GroupId is correct, or create a group.
660600009Failed to get group information.Please confirm whether the GroupId is correct. If correct, contact ZEGOCLOUD Technical Support.
660600028Failed to modify group information.Please contact ZEGOCLOUD Technical Support.
660300019The total length of the value of the group attribute has exceeded the limit.Please contact ZEGOCLOUD Technical Support.

Previous

Update group information

Next

Query group information

On this page

Back to top