拉取关注、粉丝与互关列表
功能说明
分页拉取指定用户的粉丝/关注/互关列表。
接口调用说明
请求 URL 示例
https://xxxxxx/v4/follow/follow_get?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
请求参数说明
参数 | 说明 |
xxxxxx | SDKAppID 所在国家/地区对应的专属域名: 中国: console.tim.qq.com 新加坡: adminapisgp.im.qcloud.com 首尔: adminapikr.im.qcloud.com 法兰克福: adminapiger.im.qcloud.com 孟买: adminapiind.im.qcloud.com 硅谷: adminapiusa.im.qcloud.com |
v4/follow/follow_get | 请求接口。 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID。 |
identifier | |
usersig | |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295。 |
contenttype | 请求格式固定值为 json 。 |
最高调用频率
200次/秒。
请求包示例
{"From_Account":"UserID_001","FollowType":1,"StartCursor":"","WantNum":100,}
请求包字段说明
字段 | 类型 | 属性 | 说明 |
From_Account | String | 必填 | 用户的 UserID。 |
FollowType | Integer | 必填 | 待拉取的类型: 1 - 粉丝 2 - 关注 3 - 互关 |
StartCursor | String | 必填 | 分页的起始位置:首页为空,续拉请求填上一页回包返回的 NextCursor 字段。 |
WantNum | Integer | 必填 | 拉取的数量:默认每页返回100条数据,最多支持1000条数据。 |
应答包体示例
{"FollowItem": [{"To_Account": "UserID_002","FollowTime": 1702262118,"ProfileItem": [{"Tag": "Tag_Profile_IM_Nick","Value": "NickNameTest2"},{"Tag": "Tag_Profile_IM_AllowType","Value": "AllowType_Type_DenyAny"},{"Tag": "Tag_Profile_IM_SelfSignature","Value": "I'm Test2"},{"Tag": "Tag_Profile_Custom_Test","Value": "Custom Data2"}],"profile_sequence": 123},{"To_Account": "UserID_003","FollowTime": 1702262118,"ProfileItem": [{"Tag": "Tag_Profile_IM_Nick","Value": "NickNameTest3"},{"Tag": "Tag_Profile_IM_AllowType","Value": "AllowType_Type_AllowAny"},{"Tag": "Tag_Profile_IM_SelfSignature","Value": "I'm Test3"},{"Tag": "Tag_Profile_Custom_Test","Value": "Custom Data3"}],"profile_sequence": 111}],"NextCursor": "","ActionStatus": "OK","ErrorCode": 0,"ErrorInfo": "","ErrorDisplay": ""}
应答包字段说明
字段 | 类型 | 说明 |
FollowItem | Array | 粉丝/关注/互关列表。 |
To_Account | String | 粉丝/关注/互关的用户的 UserID。 |
FollowTime | Integer | 关注时间。 |
NextCursor | String | 下一页的起始位置,为空时表示已拉到全量数据。 |
ActionStatus | String | 请求处理的结果: OK:处理成功。 FAIL:处理失败。 |
ErrorCode | Integer | 错误码: 0:处理成功。 非0:处理失败。 |
ErrorInfo | String | 详细错误信息。 |
错误码说明
除非发生网络错误(例如502错误),否则该接口的 HTTP 返回码均为200。实际的错误码、错误信息是通过应答包体中的 ResultCode、ResultInfo、ErrorCode 以及 ErrorInfo 来表示的。 公共错误码(60000到79999)请参见 错误码。 本 API 私有错误码如下:
错误码 | 描述 |
30001 | 请求参数错误,请根据错误描述检查请求参数。 |
30002 | SDKAppID 不匹配。 |
30003 | 请求的用户账号不存在。 |
30004 | 请求需要 App 管理员权限。 |
30006 | 服务器内部错误,请重试。 |
30007 | 网络超时,请稍后重试。 |