User Management
Function
This API is used to create a user.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
POST /v1/csms/users
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API. The token is the value of X-Subject-Token in the response header. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
user_name |
Yes |
String |
Username, which is a unique identifier in an enterprise. |
|
mobile |
Yes |
String |
Mobile number, which is unique in an enterprise. |
|
password |
No |
String |
Password, which must be in the format defined by the enterprise. |
|
org_code |
No |
String |
Main organization code. Enter an existing organization code in an enterprise. If the value is left empty, the organization is under the first root organization. |
|
name |
No |
String |
Real name. If the value is null, user_name is used. You can modify the mandatory attributes. To do so, log in to the administrator portal, and access the User Attributes page under the Users menu. |
|
|
No |
String |
Email address. You can modify the mandatory attributes. To do so, log in to the administrator portal, and access the User Attributes page under the Users menu. |
|
employee_id |
No |
String |
Employee ID. You can modify the mandatory attributes. To do so, log in to the administrator portal, and access the User Attributes page under the Users menu. |
|
first_name |
No |
String |
Name. You can modify the mandatory attributes. To do so, log in to the administrator portal, and access the User Attributes page under the Users menu. |
|
middle_name |
No |
String |
Middle name. You can modify the mandatory attributes. To do so, log in to the administrator portal, and access the User Attributes page under the Users menu. |
|
last_name |
No |
String |
Last name. You can modify the mandatory attributes. To do so, log in to the administrator portal, and access the User Attributes page under the Users menu. |
|
pwd_must_modify |
No |
Boolean |
Whether the password must be changed upon first login. The default value is true. |
|
attr_gender |
No |
String |
Gender. |
|
attr_birthday |
No |
String |
Date of birth, in yyyy-mm-dd format |
|
attr_nick_name |
No |
String |
Alias. |
|
attr_identity_type |
No |
String |
Certificate type. |
|
attr_identity_number |
No |
String |
Certificate number. |
|
attr_area |
No |
String |
Country or region code. |
|
attr_city |
No |
String |
City. |
|
attr_manager_id |
No |
String |
Immediate superior. |
|
attr_user_type |
No |
String |
Personnel type. The value can be regular (formal), intern (internship), dispatch (labor dispatch), or outsourcing (labor outsourcing). |
|
attr_hire_date |
No |
String |
Onboarding date, in yyyy-MM-dd format. |
|
attr_work_place |
No |
String |
Work location. |
|
user_org_relation_list |
No |
Array of UserOrgRelationListOption objects |
Relationships between users and organizations. The main organization information must be included if this parameter is set. |
|
extension |
No |
Object |
Custom extended attribute. |
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
user_id |
String |
User ID. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error details. |
Example Requests
Create a user whose username is zhangsan, mobile number is 12345678901, and email address is zhangsan@example.com.
{
"user_name" : "zhangsan",
"password" : "p******d",
"org_code" : "10000",
"name" : "zhangsan",
"mobile" : "12345678901",
"email" : "zhangsan@example.com",
"employee_id" : "123456789",
"pwd_must_modify" : false,
"first_name" : "F",
"middle_name" : "M",
"last_name" : "L",
"attr_gender" : "male",
"attr_birthday" : "1990-02-01",
"attr_nick_name" : "zhangsan",
"attr_identity_type" : "id_card",
"attr_identity_number" : "123456789",
"attr_area" : "CN",
"attr_city" : "xxx",
"attr_manager_id" : "123456789",
"attr_user_type" : "regular",
"attr_hire_date" : "2021-04-01",
"attr_work_place" : "xxx",
"user_org_relation_list" : [ {
"orgCode" : "10000",
"relationType" : 1
}, {
"orgCode" : "TestOrg1",
"relationType" : 0
}, {
"orgCode" : "TestOrg2",
"relationType" : 0
} ],
"extension" : {
"age" : "18"
}
}
Example Responses
Status code: 201
Request succeeded.
{
"user_id" : "20210621095935811-5E16-6B3060..."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Request succeeded. |
|
400 |
Request failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot