Employee Identity (EIAM)
Authorize Application Account to User
API
# Permissions
The Identity Management APIs are authorized at the application level. Before calling an interface, you need to set interface permissions for different applications. For details, please refer to API Permissions.
| Permission Code | Description |
|---|---|
| user_all | Read and write permissions for user management interfaces |
| all | Read and write permissions for all interfaces |
# Request Specification
POST https://{your_domain}/api/v2/tenant/users/{user_id}/applications/{app_id}/accounts
# Request Headers
| Parameter | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| Authorization | Authorization | Yes | String | Format: Bearer {access_token} |
| Content-Type | Content Type | Yes | String | Fixed value: application/json; charset=utf-8 |
# Request Example
{
"account_name":"example01"
}
1
2
3
2
3
# Request Parameters
| Parameter | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| user_id | User ID | Yes | String | The ID of the user to be authorized |
| app_id | Application ID | Yes | String | The ID of the application to be authorized |
| account_name | Application Account Name | No | String | Defaults to the username if left empty |
# Return Example
Correct Example:
HTTP/1.1 200 OK
Content-Type: application/json
{
"account_id": "20220414103145123-C349-6B6D9C126"
}
Error Example:
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
2
3
4
5
6
7
8
9
10
11
12
13
# Return Parameters
| Parameter Name | Chinese Name | Type | Description |
|---|---|---|---|
| account _id | Application Account ID | String |
# Error Codes
| Status Code | Error Code | Error Message | Handling Measures |
|---|---|---|---|
| 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 |
Okay, input the Markdown. I will only return the translated text.
