Create user
Updated date: 30/04/2023
Updated by: VNPT eContract's team
Purpose
Function to create new user information and login account for the system.
- Request URL:
/api/users/create
- HTTP method:
POST
- HTTP content-type:
application/json
- Authorize:
Bearer token
- Parameter:
Key | Type | Description |
---|---|---|
code | string | [Required] Code of user |
username | string | [Required] Username of user |
name | string | [Required] Full Name of user |
email | string | [Required] Email of user |
phone | string | [Required] Phone number |
groupIds | Array[int] | Array of group user Ids |
departmentIds | Array[int] | Array of department Ids |
roleIds | Array[Guild] | Array of role Ids |
taxcode | string | Tax code of user |
address | string | Address of user |
fax | string | Fax number of user |
description | string | Description |
signatureText | string | Default signature text |
signConfirmationEnabled | boolean | Sign, approve using two-factor authentication |
generateSelfSignedCertEnabled | boolean | Generate Self-signed certificate |
status | int | Status of user 1: Enabled -1: Disabled |
receiveOtpMethod | int | Receive OTP method 1: Email 2: SMS -1: None |
receiveNotificationMethod | int | Receive document notification method 0: Email 1: SMS -1: None |
signMethod | int | Sign method 1: (Only old version) Sign draw 2: VNPT Smart CA 3: Sign Token |
receiveInfoAccountMethod | int | Receive account information 0: Email 1: SMS |
Sample request
{
"code": "nguoidung01",
"username": "nguoidung01",
"name": "Người dùng 01",
"email": "test@email.com",
"phone": "0938475932",
"taxcode": "MST00005",
"address": "42 Phạm Ngọc Thạch, phường 6, quận 3, thành phố Hồ Chí Minh",
"fax": "123",
"description": "",
"signatureText": "",
"signConfirmationEnabled": true,
"generateSelfSignedCertEnabled": true,
"status": 1,
"receiveOtpMethod": 1,
"receiveNotificationMethod": 0,
"signMethod": 2,
"groupIds": [2],
"departmentIds": [23],
"roleIds": ["2b999cd0-32ec-4e4a-16b8-08da6df5fc5a"]
}
Sample response body
{
"data": {
"id": 4401,
"createdDate": "2022-12-13T14:55:32.2867265+07:00",
"comId": 164,
"code": "Test0.5817962344319714",
"name": "Test0.5817962344319714",
"phone": "",
"email": "test@email.com",
"isValid": false,
"signConfirmationEnabled": true,
"isAccountLocked": false,
"accountId": "75d5d881-9a88-40ea-9eca-5e370a087e3a",
"signatureText": "",
"signMethod": {
"value": 2,
"description": "VNPT Smart CA"
},
"status": {
"value": 1,
"description": "Enabled"
},
"receiveOtpMethod": {
"value": 1,
"description": "Email"
},
"receiveNotificationMethod": {
"value": 0,
"description": "Email"
},
"personalCertificateId": 3061,
"personalCertificate": {
"id": 3061,
"personalCertificatePath": "164\\2022\\12\\13\\7aab7aeb-ae83-44f5...",
"isValid": true,
"issuerDN": "CN=VNPT eContract Certificate, O=VNPT eContract Group, OU=VNPT eContract, C=VN",
"serialNumber": "747B0B58DAB71FD5",
"subjectDN": "OID.0.9.2342.19200300.100.1.1=id:4401...",
"validFrom": "2022-12-13T14:55:33+07:00",
"validTo": "2027-12-13T14:55:33+07:00",
"certificateType": 0,
"createdDate": "2022-12-13T14:55:35.1629534+07:00",
"createdByUserId": 2341,
"isActive": true,
"ownerId": 4401
}
},
"success": true,
"code": 0,
"messages": [
"Create user success"
]
}