功能说明
可以通过本接口,搜索模糊匹配的群名称(GroupName)或者精确匹配群组的 GroupID。
接口调用说明
请求 URL 示例
https://xxxxxx/v4/group_search/search?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
请求参数说明
参数 | 说明 |
xxxxxx | 当前仅支持中国站,SDKAppID 所在国家/地区对应的专属域名: 中国: console.tim.qq.com 新加坡: adminapisgp.im.qcloud.com 其他站点暂不支持。 |
v4/group_search/search | 群组搜索接口。 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID。 |
identifier | |
usersig | |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295。 |
contenttype | 请求格式固定值为 json 。 |
最高调用频率
2次/秒。
请求包示例
{"Count": 100,"GroupType": [],"KeywordMatchType": 1,"Keywords": ["啊"]}
请求包字段说明
字段 | 类型 | 属性 | 说明 |
GroupType | \\[]String | 选填 | 群组类型:Private/Public/ChatRoom/Community |
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": 6,"Groups": [{"GroupType": "Public","GroupID": "@TGS#2BZNQWAG2","GroupName": "咯好无辜啊、IM助手","GroupMemberNum": 2,"GroupFaceUrl": "","GroupIntroduction": "","GroupOwnerUserID": "wangkun","GroupOwnerTinyID": 144115214578713345,"GroupOwnerUserName": "咯好无辜啊"}],"Cursor": "sTTW6iNKGz2TuqprgdJuJflhmwLr2_kZrvRFWpjrkww"}
应答包字段说明
字段 | 类型 | 说明 |
ActionStatus | String | 请求处理的结果,OK 表示处理成功,FAIL 表示失败。 |
ErrorCode | Integer | 错误码,0表示成功,非0表示失败。 |
ErrorInfo | String | 错误信息。 |
IsFinish | Bool | 搜索是否结束。 |
TotalCount | Integer | 命中的搜索结果个数。 |
Groups | Array | 命中的群组数。 |
GroupType | String | 群组类型。 |
GroupID | String | 群组ID。 |
GroupName | String | 群组名称。 |
GroupMemberNum | Integer | 群组人数。 |
GroupFaceUrl | String | 群组头像。 |
GroupIntroduction | String | 群组简介。 |
GroupOwnerUserID | String | 群主 UserID。 |
GroupOwnerTinyID | Integer | 群主 TinyID。 |
GroupOwnerUserName | Integer | 群主昵称。 |
Cursor | Integer | 续拉参数,下个请求的 Response 中带回。 |
错误码说明
除非发生网络错误(例如502错误),否则该接口的 HTTP 返回码均为200。实际的错误码、错误信息是通过应答包体中的 ResultCode、ResultInfo、ErrorCode 以及 ErrorInfo 来表示的。
本 API 私有错误码如下:
错误码 | 描述 |
27003 | 请求参数异常,请根据错误提示排查原因。 |
27004 | 服务内部异常,重试仍有问题可以通过工单联系我们。 |
60018 | 请求过于频繁,请稍后重试。 |
60020 | 云端搜索套餐包过期或者响应搜索场景没有开启,请检查后重试。 |