Skip to main content
Version: 1.0.0

Create or update user

Updated date: 30/04/2023
Updated by: VNPT eContract's team


Purpose

The function that creates new or updates existing information of one or multiple users within the system.

  • Request URL: /api/users/create-or-update
  • HTTP method: POST
  • HTTP content-type: application/json
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
codestring[Required] Code of user
userNamestring[Required] Username of user
namestringFull Name of user
emailstringEmail of user
phonestringPhone number
groupIdsArray[int]Array of group user Ids
departmentIdsArray[int]Array of department Ids
roleIdsArray[Guild]Array of role Ids
taxcodestringTax code of user
addressstringAddress of user
faxstringFax number of user
descriptionstringDescription
signatureTextstringDefault signature text
signConfirmationEnabledbooleanSign, approve using two-factor authentication
generateSelfSignedCertEnabledbooleanGenerate Self-signed certificate
statusintStatus of user
1: Enabled
-1: Disabled
receiveOtpMethodintReceive OTP method
1: Email
2: SMS
-1: None
receiveNotificationMethodintReceive document notification method
0: Email
1: SMS
-1: None
signMethodintSign method
1: (Only old version) Sign draw
2: VNPT Smart CA
3: Sign Token
receiveInfoAccountMethodintReceive account information
0: Email
1: SMS

Sample request

[
{
"code": "dochub.demo",
"username": "dochub.demo@email.com",
"name": "Người dùng 01",
"email": "dochub.demo@email.com",
"phone": "0938475932",
"taxcode": "0321221422",
"address": "Quận 3, TP.Hồ Chí Minh",
"fax": "123",
"description": "",
"signatureText": "",
"signConfirmationEnabled": true,
"generateSelfSignedCertEnabled": true,
"status": 1,
"receiveOtpMethod": 1,
"receiveNotificationMethod": 0,
"signMethod": 2,
"groupIds": [
1014
],
"departmentIds": [
33
],
"roleIds": [
"2b999cd0-32ec-4e4a-16b8-08da6df5fc5a"
]
}
]

Sample response body

{
"data": [
{
"id": 8072,
"createdDate": "2023-06-28T14:31:30.9534748",
"comId": 164,
"code": "dochub.demo",
"name": "Người dùng 01",
"phone": "0938475932",
"email": "dochub.demo@email.com",
"isValid": false,
"signConfirmationEnabled": true,
"isAccountLocked": false,
"signatureText": "",
"signMethod": {
"value": 2,
"description": "VNPT Smart CA"
},
"status": {
"value": 1,
"description": "Enabled"
},
"receiveOtpMethod": {
"value": 1,
"description": "Email"
},
"receiveNotificationMethod": {
"value": 0,
"description": "Email"
},
"personalCertificateId": 5111
}
],
"success": true,
"code": 0,
"messages": [
"Create 0 user success, update 1 user success."
]
}