Create User with Password¶
Create a user with default password, and add the user to an OU.
Request Format¶
POST https://{apigw-address}/app-portal-service/v2.3/user/createAndJoinViaPwd
Request Parameters (Query)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
orgId |
Mandatory |
String |
OU ID. |
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
name |
Mandatory |
String |
User name. |
Mandatory |
String |
User email. |
|
password |
Optional |
String |
User password. If specified, the password is the default password of the user. If not specified, the interface returns a token to reset user password. |
domain |
Optional |
String |
The domain that the user belongs to. If specified, the user account is a domain account. If not specified, the user account is a non-domain account. |
nickName |
Optional |
String |
The nickname of the user. |
company |
Optional |
String |
The company that the user works for. |
department |
Optional |
String |
The department that the user belongs to. |
position |
Optional |
String |
The position of the user. |
Response Parameter¶
Name |
Data Type |
Description |
---|---|---|
data |
Data Struct |
The information of the created user. |
Data Struct¶
Name |
Data Type |
Description |
---|---|---|
userId |
String |
User ID. |
token |
String |
The Token to reset the user password. |
success |
Boolean |
The result of creating the user, true for success, and false for failure. |
Error Codes¶
Error Code |
Description |
---|---|
31400 |
Required parameters are missing, or the password does not match the OU password rules. |
31403 |
The application does not have the permission to create or delete user accounts. |
31404 |
The domain does not exist, or the OU does not acquire the application. |
31408 |
The user name or email already exists. |
31429 |
The time of resetting passwords reaches the limit. |
Samples¶
Request Sample¶
url: /app-portal-service/v2.3/user/createAndJoinViaPwd?orgId=your_org_ID
method: POST
{
"name": "your_user_name",
"email": "your_user_email",
"password": "your_user_password"
}
Return Sample¶
{
"code": 0,
"message": "",
"data": {
"userId": "your_user_id",
"success": true
}
}