https://console.tim.qq.com/v4/profile/portrait_get?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
下表仅列出调用本接口时涉及修改的参数及其说明,更多参数详情请参考 REST API 简介。
参数 | 说明 |
---|---|
v4/profile/portrait_get | 请求接口 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID |
identifier | 必须为 App 管理员帐号,更多详情请参见 App 管理员 |
usersig | App 管理员帐号生成的签名,具体操作请参见 生成 UserSig |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295 |
200次/秒。
{
"To_Account":["id1"],
"TagList":
[
"Tag_Profile_IM_Nick"
]
}
{
"To_Account":["id1"],
"TagList":
[
"Tag_Profile_IM_Nick",
"Tag_Profile_IM_AllowType",
"Tag_Profile_IM_SelfSignature",
"Tag_Profile_Custom_Test"
]
}
{
"To_Account":["id1","id2","id3"],
"TagList":
[
"Tag_Profile_IM_Nick"
]
}
{
"To_Account":["id1","id2","id3","id4"],
"TagList":
[
"Tag_Profile_IM_Nick",
"Tag_Profile_IM_AllowType",
"Tag_Profile_IM_SelfSignature",
"Tag_Profile_Custom_Test"
]
}
字段 | 类型 | 属性 | 说明 |
---|---|---|---|
To_Account | Array | 必填 | 需要拉取这些 UserID 的资料; 注意:每次拉取的用户数不得超过100,避免因回包数据量太大以致回包失败 |
TagList | Array | 必填 | 指定要拉取的资料字段的 Tag,支持的字段有: 1. 标配资料字段,详情可参见 标配资料字段 2. 自定义资料字段,详情可参见 自定义资料字段 |
{
"UserProfileItem":
[
{
"To_Account":"id1",
"ProfileItem":
[
{
"Tag":"Tag_Profile_IM_Nick",
"Value":"NickNameTest1"
}
],
"ResultCode":0,
"ResultInfo":""
}
],
"ActionStatus":"OK",
"ErrorCode":0,
"ErrorInfo":"",
"ErrorDisplay":""
}
{
"UserProfileItem":
[
{
"To_Account":"id1",
"ProfileItem":
[
{
"Tag":"Tag_Profile_IM_Nick",
"Value":"NickNameTest1"
},
{
"Tag":"Tag_Profile_IM_AllowType",
"Value":"AllowType_Type_NeedConfirm"
},
{
"Tag":"Tag_Profile_IM_SelfSignature",
"Value":"I'm Test1"
},
{
"Tag":"Tag_Profile_Custom_Test",
"Value":"Custom Data1"
}
],
"ResultCode":0,
"ResultInfo":""
}
],
"ActionStatus":"OK",
"ErrorCode":0,
"ErrorInfo":"",
"ErrorDisplay":""
}
{
"UserProfileItem":
[
{
"To_Account":"id1",
"ProfileItem":
[
{
"Tag":"Tag_Profile_IM_Nick",
"Value":"NickNameTest1"
}
],
"ResultCode":0,
"ResultInfo":""
},
{
"To_Account":"id2",
"ProfileItem":
[
{
"Tag":"Tag_Profile_IM_Nick",
"Value":"NickNameTest2"
}
],
"ResultCode":0,
"ResultInfo":""
},
{
"To_Account":"id3",
"ProfileItem":
[
{
"Tag":"Tag_Profile_IM_Nick",
"Value":"NickNameTest3"
}
],
"ResultCode":0,
"ResultInfo":""
}
],
"ActionStatus":"OK",
"ErrorCode":0,
"ErrorInfo":"",
"ErrorDisplay":""
}
{
"UserProfileItem":
[
{
"To_Account":"id1",
"ProfileItem":
[
{
"Tag":"Tag_Profile_IM_Nick",
"Value":"NickNameTest1"
},
{
"Tag":"Tag_Profile_IM_AllowType",
"Value":"AllowType_Type_NeedConfirm"
},
{
"Tag":"Tag_Profile_IM_SelfSignature",
"Value":"I'm Test1"
},
{
"Tag":"Tag_Profile_Custom_Test",
"Value":"Custom Data1"
}
],
"ResultCode":0,
"ResultInfo":""
},
{
"To_Account":"id2",
"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"
}
],
"ResultCode":0,
"ResultInfo":""
},
{
"To_Account":"id3",
"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"
}
],
"ResultCode":0,
"ResultInfo":""
},
{
"To_Account":"id4",
"ResultCode":40006,
"ResultInfo":"Err_Profile_PortraitGet_Read_Custom_Data_Fail"
}
],
"Fail_Account":["id4"],
"ActionStatus":"OK",
"ErrorCode":0,
"ErrorInfo":"",
"ErrorDisplay":""
}
字段 | 类型 | 说明 |
---|---|---|
UserProfileItem | Array | 返回的用户资料结构化信息 |
To_Account | String | 返回的用户的 UserID |
ProfileItem | Array | 返回的用户的资料对象数组,数组中每一个对象都包含了 Tag 和 Value |
Tag | String | 返回的资料对象的名称: 1. 标配资料字段,详情可参见 标配资料字段 2. 自定义资料字段,详情可参见 自定义资料字段 |
Value | uint64_t/string/bytes | 拉取的资料对象的值,详情可参见 资料字段 |
ResultCode | Integer | To_Account 的处理结果,0表示成功,非0表示失败 |
ResultInfo | String | To_Account 的错误描述信息,成功时该字段为空 |
Fail_Account | Array | 返回处理失败的用户列表,仅当存在失败用户时才返回该字段 |
ActionStatus | String | 请求处理的结果,“OK” 表示处理成功,“FAIL” 表示失败 |
ErrorCode | Integer | 错误码,0表示成功,非0表示失败 |
ErrorInfo | String | 详细错误信息 |
ErrorDisplay | String | 详细的客户端展示信息 |
除非发生网络错误(例如502错误),否则该接口的 HTTP 返回码均为200。真正的错误码,错误信息是通过应答包体中的 ErrorCode、ErrorInfo 来表示的。
公共错误码(60000到79999)参见 错误码 文档。
本 API 私有错误码如下:
错误码 | 描述 |
---|---|
40001 | 请求参数错误,请根据错误描述检查请求参数 |
40002 | 请求参数错误,没有指定 To_Account |
40003 | 请求的用户帐号不存在 |
40004 | 请求需要 App 管理员权限 |
40006 | 服务器内部错误,请稍后重试 |
40007 | 没有资料字段的读权限,详情可参见 资料字段 |
40009 | 资料字段的 Tag 不存在 |
通过 REST API 在线调试 工具调试本接口。
设置资料(v4/profile/portrait_set)
哪个 企业邮箱 性价比高?其实企业 邮箱 的市场相对很成熟了,基本上专业做企业...
TOP云 (west.cn)12月12日消息,据外媒消息,近日亚马逊和谷歌战争升级,随着谷...
目前,有关服务器虚拟化的发展问题,所面临的挑战有五个: 1、缺乏虚拟化的总体...
导读 2021 年 8 月 1 日 在由 Linux 基金会亚太区、开源中国共同主办的 GOTC 202...
cout setw(10) "姓名" setw(10) "学号" setw(10) "性别" setw(10) "年龄" setw(1...
1. 接口描述 接口请求域名: vpc.tencentcloudapi.com 。 本接口(DeleteNetwork...
本文介绍如何在裸金属服务器操作系统内部修改登录密码。 建议优先 在控制台上重...
登录鉴权简介 即时通信 IM 的前身是 QQ 的即时通信系统,我们抽离 QQ 的通用模块...
百度云计算战略发布会前瞻:与英特尔合作计划或曝光?百度云召开战略发布会?百...
本文介绍如何通过阿里云ECS Java SDK调用RunInstances创建一台或多台ECS实例。 ...