Create User
Request Description
Request Headers
| Parameter Name | 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
json
{
"user_name":"zhangsan",
"name":"张三",
"mobile":"+86-15200000000",
"email":"15200000000@qq.com",
"pwd":"qwe123!@#",
"pwd_must_modify":false,
"attr_gender":"male",
"attr_birthday":"2022-02-17",
"attr_nick_name":"张三",
"mailing_address":"湖北省武汉市",
"zip_code":"430000",
"first_name":'',
"middle_name":'',
"last_name":'',
"industry":"事业单位",
"external_id":"12345678741d29069abcdef089d4q87sk12",
"head_img": "data:image/jpeg;base64,.......",
"extension": {
"age":"28"
}
}Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| user_name | Username | No | String | Username, the unique identifier of the user within the enterprise. Can be specified in the request parameters; if not passed, the system will generate it automatically |
| name | Name | No | String | |
| mobile | Mobile Number | No | String | Mobile numbers support international dialing codes, format: country code-mobile number |
| No | String | |||
| pwd | Password | No | String | The password must meet the format defined by the enterprise |
| pwd_must_modify | Force Password Change | No | Boolean | Whether the user must change password upon next successful login. Default value is true |
| attr_gender | Gender | No | String | Optional values: "unknow": confidential "male": male "female": female |
| attr_birthday | Birthday | No | String | Format: yyyy-mm-dd |
| attr_nick_name | Nickname | No | String | |
| mailing_address | Mailing Address | No | String | |
| zip_code | Zip Code | No | String | |
| first_name | First Name | No | String | |
| middle_name | Middle Name | No | String | |
| last_name | Last Name | No | String | |
| industry | Industry | No | String | |
| external_id | External System ID | No | String | Third-party user ID |
| head_img | User Avatar | No | String | User avatar, supports base64-encoded image strings and URLs starting with http or https |
| extension | Extended Attributes | No | JSONObject | Extended attributes; extended attributes need to be defined in the enterprise |
Note: The enterprise can modify whether system-built-in attributes are required and their display names in "Enterprise Center - User Attribute Definition" (system attributes cannot be deleted), and can also extend user attributes according to business needs. Interface request parameters are processed based on the attributes defined in the "User Attribute Definition" module. The format for custom date attributes is yyyy-mm-dd.
Response Example
Success Example
HTTP/1.1 200 OK
json
{
"user_id": "20201028102749564-9082-DC8CD2722"
}Error Example
HTTP/1.1 400 Bad Request
json
{
"error_msg": "User not found",
"error_code": "IDAAS.TENANT.USER.0001"
}Response Parameters
| Parameter Name | Chinese Name | Type | Description |
|---|---|---|---|
| user_id | Created user user_id | String | Auto-generated by the IDaaS platform |
Error Codes
| Status Code | Error Code | Chinese Error Message | English Error Message | Resolution |
|---|---|---|---|---|
| 400 | IDAAS.TENANT.USER.0001 | 用户未找到 | User not found | Please check whether the user exists |
| 400 | IDAAS.TENANT.USER.0002 | 用户名不能为空 | Username cannot be empty | Please check whether the username field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0003 | 姓名不能为空 | Name cannot be empty | Please check whether the name field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0004 | 手机号不能为空 | Mobile number cannot be empty | Please check whether the mobile number field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0005 | 邮箱不能为空 | E-mail cannot be empty | Please check whether the email field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0006 | 密码不能为空 | Password cannot be empty | Please check whether the password field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0007 | 性别不能为空 | Gender cannot be empty | Please check whether the gender field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0008 | 生日不能为空 | Birthday cannot be empty | Please check whether the birthday field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0009 | 昵称不能为空 | Nick name cannot be empty | Please check whether the nickname field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0010 | 邮寄地址不能为空 | Mailing address cannot be empty | Please check whether the mailing address field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0011 | 邮政编码不能为空 | Zip code cannot be empty | Please check whether the zip code field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0012 | 名字不能为空 | First name cannot be empty | Please check whether the first name field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0013 | 中间名不能为空 | Middle name cannot be empty | Please check whether the middle name field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0014 | 姓氏不能为空 | Last name cannot be empty | Please check whether the last name field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0015 | 所属行业不能为空 | Industry cannot be empty | Please check whether the industry field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0016 | 外部ID不能为空 | External ID cannot be empty | Please check whether the external ID field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0017 | 扩展属性{0}不能为空 | Extended property {0} cannot be empty | Please check whether the extended property {0} field in the request parameters is empty |
| 400 | IDAAS.TENANT.USER.0018 | 用户名不符合校验规则 | The username does not meet the verification rules | Please check whether the username field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0019 | 姓名不符合校验规则 | The name does not meet the verification rules | Please check whether the name field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0020 | 手机号不符合校验规则 | The mobile number does not meet the verification rules | Please check whether the mobile number field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0021 | 邮箱不符合校验规则 | The e-mail does not meet the verification rules | Please check whether the email field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0023 | 性别不符合校验规则 | The gender does not meet the verification rules | Please check whether the gender field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0024 | 生日不符合校验规则 | The birthday does not meet the verification rules | Please check whether the birthday field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0025 | 昵称不符合校验规则 | The nickname does not meet the verification rules | Please check whether the nickname field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0026 | 邮寄地址不符合校验规则 | The mailing address does not meet the verification rules | Please check whether the mailing address field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0027 | 邮政编码不符合校验规则 | The zip code does not meet the verification rules | Please check whether the zip code field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0028 | 名字不符合校验规则 | The first name does not meet the verification rules | Please check whether the first name field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0029 | 中间名不符合校验规则 | The middle name does not meet the verification rules | Please check whether the middle name field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0030 | 姓氏不符合校验规则 | The last name does not meet the verification rules | Please check whether the last name field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0031 | 所属行业不符合校验规则 | The industry does not meet the verification rules | Please check whether the industry field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0032 | 外部ID不符合校验规则 | The external ID does not meet the verification rules | Please check whether the external ID field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.USER.0033 | 扩展属性{0}不符合校验规则 | The extended attribute {0} does not meet the verification rules | Please check whether the extended attribute {0} field in the request parameters meets the validation rules in "Enterprise Center - User - User Attribute Definition" |
| 400 | IDAAS.TENANT.MOBILE.0002 | 未经认证的手机号 | An unauthenticated cell mobile number | Please check whether the "Enterprise Center - Enterprise Configuration - International Dialing Code Configuration" meets the configuration rules |
| 400 | IDAAS.TENANT.USER.0034 | 用户名已存在 | Username already exists | Please check whether the user exists |
| 400 | IDAAS.TENANT.USER.0035 | 手机号已存在 | Mobile number already exists | Delete the mobile number and re-add it, or replace it with a mobile number that has not been added |
| 400 | IDAAS.TENANT.USER.0036 | 邮箱已存在 | E-mail already exists | Delete the email and re-add it, or replace it with an email that has not been added |
| 400 | IDAAS.TENANT.USER.0037 | 扩展属性{0}已存在 | Extended property {0} already exists | Delete the extended property {0} and re-add it, or replace it with an extended property {0} that has not been added |
| 400 | IDAAS.TENANT.PWD.0001 | 不允许使用历史密码 | The password is used before, cannot be used again | Please re-enter the password |
| 400 | IDAAS.TENANT.PWD.0002 | 密码不允许使用用户名的倒写 | Password cannot username in reverse order | Please re-enter the password |
| 400 | IDAAS.TENANT.PWD.0003 | 密码中不允许包含:用户名、手机号、邮箱前缀、姓名拼音 | Password cannot contain :username, mobile number, email prefix, name in PinYing | Please re-enter the password |
| 400 | IDAAS.TENANT.PWD.0004 | 密码复杂度低, | Your password complexity is low, | Please re-enter the password |
| 400 | IDAAS.TENANT.PWD.0005 | 该密码为弱密码 | The password is weak | Please re-enter the password |
| 400 | IDAAS.TENANT.PWD.0006 | 密码中最大字符重复数不能超过 | Number of character repeat in password should not exceed | Please re-enter the password |
| 400 | IDAAS.TENANT.PWD.0007 | 密码长度为{0}~{1}个字符 | The password must contain {0} to {1} characters | Please re-enter the password |