https://xxxxxx/v4/sns/friend_update?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 硅谷: adminapiusa.im.qcloud.com 雅加达: adminapiidn.im.qcloud.com |
v4/sns/friend_update | 请求接口 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID |
identifier | |
usersig | |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295 |
contenttype | 请求格式固定值为 json |
{"From_Account":"id","UpdateItem":[{"To_Account":"id1","SnsItem":[{"Tag":"Tag_SNS_IM_Remark","Value":"remark1"}]}]}
{"From_Account":"id","UpdateItem":[{"To_Account":"id1","SnsItem":[{"Tag":"Tag_SNS_IM_Remark","Value":"remark1"},{"Tag":"Tag_SNS_IM_Group","Value":["group1","group2"]},{"Tag":"Tag_SNS_Custom_Test","Value":"test"}]}]}
{"From_Account":"id","UpdateItem":[{"To_Account":"id1","SnsItem":[{"Tag":"Tag_SNS_IM_Remark","Value":"remark1"}]},{"To_Account":"id2","SnsItem":[{"Tag":"Tag_SNS_IM_Remark","Value":"remark2"},{"Tag":"Tag_SNS_IM_Group","Value":["group1","group2"]}]},{"To_Account":"id3","SnsItem":[{"Tag":"Tag_SNS_IM_Remark","Value":"remark3"},{"Tag":"Tag_SNS_IM_Group","Value":["group3"]},{"Tag":"Tag_SNS_Custom_Test","Value":"test"}]}]}
字段 | 类型 | 属性 | 说明 |
From_Account | String | 必填 | 需要更新该 UserID 的关系链数据 |
UpdateItem | Array | 必填 | 需要更新的好友对象数组,单次请求的好友数不得超过1000 |
To_Account | String | 必填 | 好友的 UserID |
SnsItem | Array | 必填 | 需要更新的关系链数据对象数组 |
Tag | String | 必填 | |
Value | Array/String/Integer | 必填 | 需要更新的关系链字段的值,关系链字段的值类型信息请参见 好友表 |
{"ResultItem":[{"To_Account":"id1","ResultCode":0,"ResultInfo":""}],"ActionStatus":"OK","ErrorCode":0,"ErrorInfo":"","ErrorDisplay":""}
{"ResultItem":[{"To_Account":"id1","ResultCode":0,"ResultInfo":""},{"To_Account":"id2","ResultCode":30011,"ResultInfo":"Err_SNS_FriendUpdate_Group_Num_Exceed_Threshold"},{"To_Account":"id3","ResultCode":30002,"ResultInfo":"Err_SNS_FriendImport_SdkAppId_Illegal"}],"Fail_Account":["id2","id3"],"ActionStatus":"OK","ErrorCode":0,"ErrorInfo":"","ErrorDisplay":""}
字段 | 类型 | 说明 |
ResultItem | Array | 批量更新好友的结果对象数组 |
To_Account | String | 请求更新的好友的 UserID |
ResultCode | Integer | To_Account 的处理结果,0表示成功,非0表示失败,非0取值的详细描述请参见 错误码说明 |
ResultInfo | String | To_Account 的错误描述信息,成功时该字段为空 |
Fail_Account | Array | 返回处理失败的用户列表,仅当存在失败用户时才返回该字段 |
ActionStatus | String | 请求处理的结果,OK 表示处理成功,FAIL 表示失败 |
ErrorCode | Integer | |
ErrorInfo | String | 详细错误信息 |
ErrorDisplay | String | 详细的客户端展示信息 |
错误码 | 描述 |
30001 | 请求参数错误,请根据错误描述检查请求参数 |
30002 | SDKAppID 不匹配 |
30003 | 请求的用户账号不存在 |
30004 | 请求需要 App 管理员权限 |
30006 | 服务器内部错误,请重试 |
30007 | 网络超时,请稍后重试 |
30008 | 并发写导致写冲突,建议使用批量方式 |
30011 | 分组已达系统上限 |
本页内容是否解决了您的问题?