logo
In-app Chat
On this page

Query room attributes


Description

Query all room attributes of the specified room ID.

Request method and endpoint

  • Request method: POST
  • Request URL: https://zim-api.zego.im/?Action=QueryRoomAttribute
  • Transmission protocol: HTTPS
  • QPS limit: 20 requests/second

Request parameters

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 Common request parameters section of the Accessing Server APIs topic.

ParameterTypeRequiredDescription
FromUserIdStringYesThe operator, which needs to be in the registered state. This user will not be automatically added to the room. Only numbers, English characters, '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', ', ', '|', '~' are supported.
RoomIdStringYesRoom ID. Only numbers, English characters, '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', ', ', '|', '~' are supported.

Request example

  • Request URL:
https://zim-api.zego.im/?Action=QueryRoomAttribute
&<Common request parameters>
  • Request body:
{
    "RoomId": "room123",
    "FromUserId": "fromUserId"   
}

Response parameters

The response parameters are as follows:

ParameterTypeDescription
Codeint32Return status code (0 means success).
MessagestringReturn status information.
RequestIdstringRequest unique identifier.
AttributeSeqint32The sequence number of the room attribute.
AttributesArray of RoomAttributeRoom attribute list.

RoomAttribute structure:

ParameterTypeDescription
KeyStringRoom attribute key value.
ValueStringRoom attribute value value.
Seqint32The sequence number of the Key in the room.
AutoDeleteNumberWhether to automatically delete.

Response example

{
    "Code": 0,
    "Message": "success",
    "RequestId": "req-123456789",
    "AttributeSeq":10,
    "Attributes": [
        {
            "Key": "1",
            "Value": "attr1",
            "Seq": 9,
            "AutoDelete":0,
        },
        {
            "Key": "2",
            "Value": "attr1",
            "Seq": 10,
            "AutoDelete":0,
        }
    ]
}

Return codes

The following return codes are only listed for interface business logic. For the complete list of return codes, see Global return codes.

Return codeDescriptionSolution
660000002Parameter error.Please check the parameters.
660300005Frequency limit.Please try again later.

Previous

Create a room

Next

Update room attributes

On this page

Back to top