Update User Bulk
This end point is use for update users
[POST] /ruangkerja/users/update-bulk
Information
This API is a function for update multiple users in single operation by employee id as parameter.
Headers
Name | Type | Example | Required | Description |
---|---|---|---|---|
Authorization | string | access_token | YES | Token of authentication. Get from Authentication API |
Accept | string | application/json | YES | Defines the message format that is expected by the client |
Content-Type | string | application/json | YES | Defines the message format of the request body that is sent by the client |
Parameter
Name | Type | Required | Location | Description |
---|---|---|---|---|
employeeID | string | YES | body | Employee ID of user. Allowed format: Alphabet (a-z, A-Z), Numeric (0-9) |
name | string | YES | body | Name of user |
newEmployeeID | string | OPTIONAL | body | New employee ID field is for change the employee ID. Allowed format: Alphabet (a-z, A-Z), Numeric (0-9) |
username | string | OPTIONAL | body | Username is used by users to sign in. Allowed format: Alphabet (a-z,A-Z) Numerical (0-9) |
phone | string | OPTIONAL | body | Phone of user. Phone is required if email empty |
isActive | bool | YES | body | Status of user |
tagSerials | []string | OPTIONAL | body | Tag serials |
organizationSerial | string | OPTIONAL | body | Organization serial of user |
Example cURL Request
curl --location --request POST 'https://api.ruangkerja.id/ruangkerja/users/update-bulk' \
--header 'Authorization: access_token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"items": [
{
"employeeID": "EMPLY001",
"name": "John Doe",
"newEmployeeID": null,
"username": null,
"phone": "6281122334455",
"isActive": true,
"tagSerials": ["RUKRTAG-9WHL0JGP"],
"organizationSerial": "COMPFJLYTHWL"
}
]
}'
Example Success Response
{
"data": {
"failedItems": [],
"successItems": [
{
"payload": {
"employeeID": "EMPLY001",
"name": "John Doe",
"newEmployeeID": null,
"username": null,
"phone": "6281122334455",
"isActive": true,
"tagSerials": ["RUKRTAG-9WHL0JGP"]
},
"response": {
"serial": "OPENAPI9Z7ZIHIFW"
}
}
]
},
"status": "success",
"message": "success"
}
Example Failed Response
{
"data": {
"failedItems": [
{
"error": {
"detail": "employee id already been taken",
"errorCode": 10101,
"message": "USER_EMPLOYEE_ID_EXISTS"
},
"payload": {
"employeeID": "EMPLY001",
"name": "John Doe",
"newEmployeeID": null,
"username": null,
"phone": "6281122334455",
"isActive": true,
"tagSerials": ["RUKRTAG-9WHL0JGP"]
}
}
],
"successItems": []
},
"status": "success",
"message": "success"
}
See also: Error Dictionary.