创建或更新用户信息
创建或更新用户信息,在使用所有对话类api前均需要先调用此接口创建用户。后续需要更新用户信息时可重复调用此接口。
POST
/openapi/v1/user_profile
content-type
application/json
请求参数:
{
"user_id": "xxx",
"user_name": "用户名",
"user_account": "",
"user_mobile": "",
"user_email": "",
"wechat_work_user_id": "",
"wechat_open_id": "",
"dingding_open_id": "",
"attr_xxx1": 20,
"attr_xxx2": "12栋"
}
参数 | 类型 | 规则 | 说明 |
---|---|---|---|
user_id | string | 必填 | 用户唯一标识。 |
user_name | string | 选填 | 用户名称。 |
user_account | string | 选填 | 用户账号的友好标识。 |
user_mobile | string | 选填 | 用户手机号码。 |
user_email | string | 选填 | 用户邮箱。 |
wechat_work_user_id | string | 选填 | 企业微信openid。 |
wechat_open_id | string | 选填 | 微信openid。 |
dingding_open_id | string | 选填 | 钉钉openid。 |
attr_xxx1 | string/int | 自定义 | 自定义属性,由调用方定义参数名与参数值。 |
attr_xxx2 | string/int | 自定义 | 自定义属性,由调用方定义参数名与参数值。 |
应答结果:
{
"code": 0,
"msg": "",
"result": [{
"Key": "user_id",
"Value": "xxx"
}, {
"Key": "user_name",
"Value": "用户名"
}, {
"Key": "attr_xxx1",
"Value": 20
}, {
"Key": "attr_xxx2",
"Value": "12栋"
}]
}
参数 | 说明 |
---|---|
code | 结果代码。(具体见状态码说明) |
msg | 详细信息,对接口请求的补充说明。 |
result | 用户信息键值对 |