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:
Untitled
https://zim-api.zego.im/?Action=QueryRoomAttribute
&<Common request parameters>
1
Copied!
  • Request body:
Untitled
{
    "RoomId": "room123",
    "FromUserId": "fromUserId"   
}
1
Copied!

Response parameters

The response parameters are as follows:

ParameterTypeRequiredDescription
Codeint32YesReturn status code (0 means success).
MessagestringYesReturn status information.
RequestIdstringYesRequest unique identifier.
AttributeSeqNumberRoom attribute seq.
AttributesArray of RoomAttributeRoom attribute list.

RoomAttribute structure:

ParameterTypeDescription
KeyStringRoom attribute key value.
ValueStringRoom attribute value value.
AutoDeleteNumberWhether to automatically delete.

Response example

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

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