员工身份(EIAM)

用户授权应用账号

接口

# 权限

身份管理API是以应用维度授权的,在调用接口前需为不同的应用设置接口权限,详情请参考API权限

权限代码 描述
user_all 用户管理接口的读写权限
all 全部接口读写权限

# 请求说明

POST https://{your_domain}/api/v2/tenant/users/{user_id}/applications/{app_id}/accounts

# 请求头

参数名 中文名称 必须 类型 描述
Authorization 授权 String 格式:Bearer {access_token}
Content-Type 内容类型 String 固定值:application/json; charset=utf-8

# 请求示例

{
    "account_name":"example01"
}
1
2
3

# 请求参数

参数名 中文名称 必须 类型 描述
user_id 用户ID String 要启用的用户ID
app_id 应用ID String 要授权的应用ID
account_name 应用账号名 String 为空时默认取用户名

# 返回示例

正确示例:
HTTP/1.1 200 OK
Content-Type: application/json
{
    "account_id": "20220414103145123-C349-6B6D9C126"
}

错误示例:
HTTP/1.1 400 Bad Request
{
  "error_msg": "用户不存在",
  "error_code": "USER.0001"
}
1
2
3
4
5
6
7
8
9
10
11
12
13

# 返回参数

参数名 中文名称 类型 描述
account _id 应用账号id String

# 错误码

状态码 错误码 错误信息 处理措施
400 USER.0001 用户不存在 请检查对应用户是否存在
User does not exist
400 APP.0001 应用不存在 请检查对应应用是否存在
App does not exist
400 APP.ACC.0029 应用账号已存在 请检查对应应用账号是否存在
App account already exists
400 APP.ACC.0013 账号名已存在 当前账号名已存在,请更换为其他不存在的值
Account name already exists