跳到主要内容

批量查询群组资料

查看指定群组资料信息,包括:群名称、所有者、群头像、群简介、群公告、群权限、群扩展属性等。

开通服务

调用此接口前,您须在控制台开通信息托管服务。详情请参阅开启用户信息托管

请求方法

POST: https://数据中心域名/entrust/group/profile/query.json

频率限制: 每秒钟限 100 次

签名规则: 所有服务端 API 请求均需要进行规则校验,详见 API 请求签名

正文参数

HTTP 请求正文数据格式为 application/x-www-form-urlencoded,支持以下 HTTP 表单参数:

参数类型必传说明
groupIdsArray群组 ID,最多一次50个。

请求示例

POST /entrust/group/profile/query.json HTTP/1.1
Host: api.rong-api.com
App-Key: uwd1c0sxdlx2
Nonce: 14314
Timestamp: 1408710653491
Signature: 45beb7cc7307889a8e711219a47b7cf6a5b000e8
Content-Type: application/x-www-form-urlencoded

groupId=groupId1&groupId=groupId2

返回结果

HTTP 响应正文包含具有以下结构的 JSON 对象:

返回值返回类型说明
codeNumber返回码,200 为正常。
profilesJSONArray群组列表信息
profiles 结构
profiles[i].groupIdString群组ID
profiles[i].nameString群名称
profiles[i].groupProfileString群组基本信息, 为 JSON 格式
profiles[i].groupExtProfileString群扩展信息 为 JSON 格式
profiles[i].permissionsString群权限信息, 为 JSON 格式
profiles[i].ownerString群主
profiles[i].createTimeLong群创建时间
profiles[i].memberCountNumber群成员数量

groupProfile 中的 key 如下:

key 值类型长度/取值范围描述
introductionString长度不超过 512 个字符群简介
announcementString长度不超过 1024 个字符群公告
portraitUrlString长度不超过 128 个字符群头像地址

permissions 中的 key 如下:

key 值类型长度/取值范围描述
joinPermNumber取值范围:
  • 0:需要群主验证(默认)
  • 1:不用验证
  • 2:群管理员或群主验证
  • 3: 不允许任何人加入
加入群权限
removePermNumber取值范围:
  • 0:群主(默认)
  • 1:群主+群管理员
  • 2: 所有人
将群成员移出群组权限
memInvitePermNumber取值范围:
  • 0:群主(默认)
  • 1:群主+群管理员
  • 2: 所有人
邀请他人入群权限
invitePermNumber取值范围:
  • 0:需要被邀请人同意(默认)
  • 1: 需要被邀请人同意
邀请加入群组处理方式
profilePermNumber取值范围:
  • 0:群主(默认)
  • 1:群主+群管理员
  • 2: 所有人
修改群资料及权限
memProfilePermNumber取值范围:
  • 0:群主+群管理员+自已(默认)
  • 1:群主+自已
  • 2: 仅自已
设置群成员资料权限

返回结果示例

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"code": 200,
"profiles": [{
"groupId":"gorupId1",
"createTime":1717717737377,
"owner":"userId1",
"name":"gName1",
"groupProfile":"{\"introduction\":\"introductionTest\",\"portraitUrl\":\"XXXX\"}",
"memberCount":10
},
{
"groupId":"gorupId2",
"createTime":1717717737376,
"owner":"userId2",
"name":"gName2",
"announcement":"announcement",
"introduction":"introduction",
"groupExtProfile":"{\"ext_key1\":\"value1\",\"ext_key2\":\"value2\"}",
"memberCount":9
}
]
}