Update User By Employee ID

This end point is use for update user

[PUT] /ruangkerja/users/:employeeID

Information

This API is a function for update single user by employee id as parameter.

Headers

NameTypeExampleRequiredDescription
Authorizationstringaccess_tokenYESToken of authentication. Get from Authentication API
Acceptstringapplication/jsonYESDefines the message format that is expected by the client
Content-Typestringapplication/jsonYESDefines the message format of the request body that is sent by the client

Parameter

NameTypeRequiredLocationDescription
employeeIDstringYESbodyEmployee ID of user. Allowed format: Alphabet (a-z, A-Z), Numeric (0-9)
namestringYESbodyName of user
newEmployeeIDstringOPTIONALbodyNew employee ID field is for change the employee ID. Allowed format: Alphabet (a-z, A-Z), Numeric (0-9)
usernamestringOPTIONALbodyUsername is used by users to sign in. Allowed format: Alphabet (a-z,A-Z) Numerical (0-9)
phonestringOPTIONALbodyPhone of user. Phone is required if email empty
isActiveboolYESbodyStatus of user
tagSerials[]stringOPTIONALbodyTag serials
organizationSerialstringOPTIONALbodyOrganization serial of user

Note: Email and phone number can be entered both

Example cURL Request

curl --location --request PUT 'https://api.ruangkerja.id/ruangkerja/users/EMPLY001' \
--header 'Authorization: access_token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "employeeID": "EMPLY001",
    "name": "John Doe",
    "newEmployeeID": null,
    "username": null,
    "phone": "6281122334455",
    "isActive": true,
    "tagSerials": ["RUKRTAG-9WHL0JGP"],
    "organizationSerial": "COMPFJLYTHWL"
}'

Example Success Response

{
    "status": "success",
    "message": "Success",
    "data": {
        "serial": "JOHNILXV3QAJJEL3"
    }
}

Example Failed Response

{
    "errorCode": 10101,
    "message": "USER_EMPLOYEE_ID_EXISTS",
    "detail": "employee id already been taken"
}

See also: Error Dictionary.