关注用户
功能说明
关注用户,支持批量关注用户。
说明:
接口调用说明
请求 URL 示例
https://xxxxxx/v4/follow/follow_add?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
请求参数说明
参数  | 说明  | 
xxxxxx  | SDKAppID 所在国家/地区对应的专属域名: 中国: console.tim.qq.com新加坡: adminapisgp.im.qcloud.com首尔:  adminapikr.im.qcloud.com东京: adminapijpn.im.qcloud.com法兰克福: adminapiger.im.qcloud.com孟买: adminapiind.im.qcloud.com硅谷: adminapiusa.im.qcloud.com | 
v4/follow/follow_add  | 请求接口。  | 
sdkappid  | 创建应用时即时通信 IM 控制台分配的 SDKAppID。  | 
identifier  | |
usersig  | |
random  | 请输入随机的32位无符号整数,取值范围0 - 4294967295。  | 
contenttype  | 请求格式固定值为 json。 | 
最高调用频率
200次/秒。
请求包示例
{"From_Account":"UserID_001","FollowItem":[{"To_Account":"UserID_002"},{"To_Account":"UserID_003"}]}
请求包字段说明
字段  | 类型  | 属性  | 说明  | 
From_Account  | String  | 必填  | 发起关注操作的用户的 UserID。  | 
FollowItem  | Array  | 必填  | 关注结构体对象。  | 
To_Account  | String  | 必填  | 待关注的用户的 UserID,单次请求的 To_Account 数不得超过20。  | 
应答包体示例
{"ResultItem": [{"To_Account": "UserID_002","ResultCode": 0,"ResultInfo": ""},{"To_Account": "UserID_003","ResultCode": 0,"ResultInfo": ""}],"ActionStatus": "OK","ErrorCode": 0,"ErrorInfo": "","ErrorDisplay": ""}
应答包字段说明
字段  | 类型  | 说明  | 
ResultItem  | Array  | 批量关注的结果对象数组。  | 
To_Account  | String  | 请求关注的用户的 UserID。  | 
ResultCode  | Integer  | To_Account 的处理结果: 0:处理成功。 非0:处理失败。  | 
ResultInfo  | String  | To_Account 的错误描述信息,成功时该字段为空。  | 
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 管理员权限。  | 
30005  | |
30006  | 服务器内部错误,请重试。  | 
30007  | 网络超时,请稍后重试。  | 
32100  | From_Account 的关注数已达系统上限。  | 
32101  | To_Account 的粉丝数已达系统上限。  | 
32102  | From_Account 的互关数已达系统上限。  | 
32103  | To_Account 的互关数已达系统上限。  | 
接口调试工具
参考
可能触发的回调