logo
In-app Chat
On this page

Query group information


Description

With this API, you can query group information, including group name, group notice, group avatar, group mute information, group specification limits, group creation time, and group attributes.

Request method and endpoint

  • Request method: POST
  • Request URL: https://zim-api.zego.im/?Action=QueryGroupInfo
  • 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
FromUserIdStringYesThe user ID of the queryer. (The user has logged in ZIM service through the login method in the client, or has completed registration through the server API.)
GroupIdStringYesThe group ID of the query target.

Request example

  • Request URL:

    Untitled
    https://zim-api.zego.im/?Action=QueryGroupInfo
    &<公共请求参数>
    
    1
    Copied!
  • Request body:

    Untitled
    {
        "FromUserId": "userId",
        "GroupId": "groupId"
    }
    
    1
    Copied!

Response parameters

ParameterTypeDescription
CodeNumberReturn code.
MessageStringOperation result description.
RequestIdStringRequest ID.
GroupNameStringGroup name.
GroupNoticeStringGroup notice.
GroupDataSeqNumberNumber of group data modifications.
GroupAvatarStringGroup avatar address.
IsAllForbidBoolWhether all members are muted.
  • true: Yes.
  • false: No.
ForbidListNumberThe muted group roles.
  • 1: Group owner.
  • 2: Group admin.
  • 3: Group member.
  • Other values: Your custom group roles, generally recommended to be greater than 100.
LimitInfoObjectGroup specification limits.
└MemberCountLimitNumberMaximum number of group members.
└JoinModeNumberGroup joining mode:
  • 0: No verification required, anyone can join the group directly.
  • 1: Users need to initiate a join request, and can only join the group after the group owner or admin approves.
  • 2: External users can only join the group through invitation from group members.
└InviteModeNumberInvitation mode:
  • 0: All group members can invite external users to join the group.
  • 1: Only the group owner or admin can initiate invitations.
└BeInvitedModeNumberInvitation acceptance mode:
  • 0: Can directly invite external users to join the group without their consent.
  • 1: After inviting someone to join the group, their consent is required.
└NumberMessageNumberNumber of historical messages that new members can pull after joining the group.
ForbidExpireTimeNumberUnix timestamp when the mute expires, in milliseconds (ms).
GroupCreateTimeNumberUnix timestamp when the group was created, in milliseconds (ms).
GroupIdStringGroup ID.
GroupAttributesArray of ObjectList of group attributes.
└KeyStringKey of the group attribute.
└ValueStringValue of the group attribute.
Note

IsAllForbid and ForbidList cannot exist simultaneously.

Response example

Untitled
{
    "Code": 0,
    "Message": "success",
    "RequestId": "343649807833778782",
    "GroupName": "GroupName",
    "GroupNotice": "GroupNotice",
    "GroupDataSeq": 1,
    "GroupAvatar": "https://xxx.com/xxx.png",
    "IsAllForbid": true,
    "ForbidList": [2,3],
    "LimitInfo": {
        "MemberCountLimit": 100,
        "JoinMode": 1,
        "InviteMode": 1,
        "BeInvitedMode": 1,
        "NumberMessage": 100
    },
    "ForbidExpireTime": 1000,
    "GroupCreateTime": 10000,
    "GroupId": "GroupId",
    "GroupAttributes": [
        {
            "Key": "1",
            "Value": "1"
        },
        {
            "Key": "2",
            "Value": "2"
        }
    ]
}
1
Copied!

Return codes

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

Return codeDescriptionSolution
660000002Invalid input parameters.Please check the input parameters.
660300005The frequency of calling the interface exceeds the AppID level limit.Please try again later.
660500002The operator user is not registered.Please register the ZIM service first.

Previous

Update group information

Next

Modify group specification limits