Nhảy tới nội dung
Phiên bản: 2.2.0

Tạo mới hoặc cập nhật người dùng

Ngày cập nhật: 30 tháng 4, 2023
Người cập nhật: VNPT eContract's team


Mục đích

Hàm thực hiện tạo mới hoặc cập nhật các thông tin của 1 hoặc nhiều người người dùng trong hệ thống.

  • Request URL: /api/users/create-or-update
  • HTTP method: POST
  • HTTP content-type: application/json
  • Authorize: Bearer token
  • Parameter:
KeyTypeDescription
codestring[Bắt buộc] Mã người dùng
userNamestring[Bắt buộc] Tên đăng nhập
namestringHọ và Tên người dùng
emailstringEmail người dùng
phonestringSố điện thoại
groupIdsArray[int]Mảng Id nhóm người dùng
departmentIdsArray[int]Mảng Id bộ phận
roleIdsArray[Guild]Mảng Id vai trò
taxcodestringMã số thuế
addressstringĐịa chỉ
faxstringSố fax
descriptionstringMô tả
signatureTextstringVăn bản ký mặc định
signConfirmationEnabledbooleanKý, phê duyệt sử dụng xác thực 2 lớp
generateSelfSignedCertEnabledbooleanTạo chữ ký số tự tạo
statusintTrạng thái người dùng
1: Hoạt động
-1: Ngưng hoạt động
receiveOtpMethodintPhương pháp nhận OTP
1: Email
2: SMS
-1: Không có
receiveNotificationMethodintPhương pháp nhận thông báo chứng từ
1: Email
2: SMS
-1: Không có
signMethodintPhương pháp ký
1: (Only old version) Sign draw
2: VNPT Smart CA
3: Ký số USB Token
receiveInfoAccountMethodintPhương pháp nhận thông tin tài khoản
0: Email
1: SMS

Mẫu 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"
]
}
]

Mẫu 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."
]
}