查询群组资料
POST
https://zim-api.zego.im/
通过该接口查询群资料,包含群组名称、群组公告、群组头像、群组禁言信息、群组规格限制、群组创建时间和群组属性。
说明
调用频率限制:20 次/秒。
Request
Query Parameters
Action string必填
可选值: [QueryGroupInfo]
接口原型参数
https://zim-api.zego.im/?Action=QueryGroupInfo
AppId uint32必填
💡公共参数。应用 Id,由 ZEGO 分配的用户唯一凭证。可从 ZEGO 控制台 获取。
SignatureNonce string必填
💡公共参数。16 位 16 进制随机字符串(8 字节随机数的 hex 编码)。生成算法可参考 签名示例。
Timestamp int64必填
💡公共参数。当前 Unix 时间戳,单位为秒。生成算法可参考 签名示例,最多允许 10 分钟的误差。
SignatureVersion string必填
可选值: [2.0]
默认值: 2.0
💡公共参数。签名版本号。
Signature string必填
💡公共参数。签名,用于验证请求的合法性。请参考签名机制生成。
- application/json
Body
required
GroupId string必填
可选值: <= 32 characters
查询目标的群组 ID。
Responses
- 200
OK
- application/json
- 数据结构
- 按数据结构生成的示例
- 示例
Schema
- true:是。
- false:否。
- 1:群主。
- 2:群管理员。
- 3:群成员。
- 其他值:您自定义的群组角色,一般建议大于 100。
- 0:无需验证,任何人可以直接加入群组。
- 1:用户需发起入群申请,群主或群管理员批准后,该用户才能加入群组。
- 2:外部用户需经群内成员邀请方可入群。
- 0:所有群成员都能邀请外部用户入群。
- 1:只有群主或者群管理员可以发起邀请。
- 0:可以直接邀请外部用户入群,无需对方同意。
- 1:邀请某人加入群组后,需要对方同意。
- Array[
- ]
Code number
返回码。
以下仅列出了接口业务逻辑相关的返回码,完整返回码请参考 全局返回码。
| 返回码 | 说明 | 解决方案 |
|---|---|---|
| 660000002 | 输入参数错误。 | 请检查输入的参数。 |
| 660300005 | 调用接口的频率超出了 AppID 级别限制。 | 请稍后再试。 |
| 660500002 | 操作者用户未注册。 | 请让操作者先注册 ZIM 服务。 |
Message string
操作结果描述。
RequestId string
请求 ID。
GroupName string
群组名称。
GroupNotice string
群组公告。
GroupDataSeq number
群组资料修改次数。
GroupAvatar string
群组头像地址。
IsAllForbid boolean
是否全员禁言。
说明
IsAllForbid 和 ForbidList 不会同时存在。
ForbidList number[]
被禁言的群组角色。
LimitInfo object
群组规格限制。
MemberCountLimit number
群成员人数上限。
JoinMode number
加入群组的模式:
InviteMode number
邀请模式:
BeInvitedMode number
受邀请模式:
NumberMessage number
新成员入群后可拉取的历史消息数目。
ForbidExpireTime number
禁言结束的 Unix 时间戳,单位为毫秒(ms)。
GroupCreateTime number
群组创建的 Unix 时间戳,单位为毫秒(ms)。
GroupId string
群组 ID。
GroupAttributes object[]
群组属性列表。
Key string
群属性的键。
Value string
群属性的值。
{
"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"
}
]
}{
"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"
}
]
}{
"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"
}
]
}{
"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"
}
]
}
