功能说明
可以通过本接口,搜索模糊匹配的群名片(GroupNameCard)/群成员名称(UserNick)或者精确匹配群成员的 UserID。
接口调用说明
请求 URL 示例
https://xxxxxx/v4/group_member_search/search?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
请求参数说明
参数 | 说明 |
xxxxxx | 当前仅支持中国站,SDKAppID 所在国家/地区对应的专属域名: 中国: console.tim.qq.com 新加坡: adminapisgp.im.qcloud.com 其他站点暂不支持。 |
v4/group_member_search/search | 群成员搜索接口。 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID。 |
identifier | |
usersig | |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295。 |
contenttype | 请求格式固定值为 json 。 |
最高调用频率
2次/秒。
请求包示例
{"GroupType":[],"GroupIdList":[],"KeywordMatchType": 1,"Keywords": ["发"],"Count": 1}
请求包字段说明
字段 | 类型 | 属性 | 说明 |
GroupType | Array | 选填 | 群组类型。 |
GroupIdList | Array | 选填 | 过滤群组范围。 |
KeywordMatchType | Integer | 选填 | 逻辑运算符。 1:and 0:or 默认为 or。 |
Keywords | Array | 必填 | 模糊搜索的 Keywords。 |
Count | Integer | 必填 | 一次请求最大记录数,最大100条,超过100条按100处理。 |
Cursor | String | 选填 | 续拉参数,上个请求的 Response 中带回,首次请求为空。 |
应答包体示例
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0,"IsFinish": false,"TotalCount": 1,"GroupMembers": [{"GroupType": "Public","GroupID": "@TGS#2F6UQRAG3","GroupName": "测试测试测试","GroupMemberUserID": "wwwwwwww","GroupMemberTinyID": 144115214509753268,"GroupMemberUserName": "发货那就","GroupMemberNameCard": ""}],"Cursor": "182MQ8Z_bi4h6TVgJzpDyKWQ4YTVG2L7_HrnyVIYIzM"}
应答包字段说明
字段 | 类型 | 说明 |
ActionStatus | String | 请求处理的结果,OK 表示处理成功,FAIL 表示失败。 |
ErrorCode | Integer | 错误码,0表示成功,非0表示失败。 |
ErrorInfo | String | 错误信息。 |
IsFinish | Bool | 搜索是否结束。 |
TotalCount | Integer | 命中的搜索结果个数。 |
GroupMembers | Array | 命中的用户数。 |
GroupType | String | 群组类型。 |
GroupID | String | 群组 ID。 |
GroupName | String | 群组名称。 |
GroupMemberUserID | String | 群成员 UserID。 |
GroupMemberTinyID | Integer | 群成员 TinyID。 |
GroupMemberNameCard | String | 群成员名片。 |
Cursor | Integer | 续拉参数,下个请求的 Response 中带回。 |
错误码说明
除非发生网络错误(例如502错误),否则该接口的 HTTP 返回码均为200。实际的错误码、错误信息是通过应答包体中的 ResultCode、ResultInfo、ErrorCode 以及 ErrorInfo 来表示的。
本 API 私有错误码如下:
错误码 | 描述 |
27003 | 请求参数异常,请根据错误提示排查原因。 |
27004 | 服务内部异常,重试仍有问题可以通过工单联系我们。 |
60018 | 请求过于频繁,请稍后重试。 |
60020 | 云端搜索套餐包过期或者响应搜索场景没有开启,请检查后重试。 |