Update User Email Bulk

This end point is use for update bulk user email

[POST] /ruangkerja/users/update-email-bulk

Information

This API is a function for update multiple user emails in single operation by employee id as parameter.

*This operation will update the password used

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
emailstringYESbodyEmail of User
passwordstringOPTIONALbodyIf password empty, the password will be random

Example cURL Request

curl --location --request POST 'https://api.ruangkerja.id/ruangkerja/users/update-bulk-email' \
--header 'Authorization: access_token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
    "items": [
        {
            "employeeID": "EMPLY001",
            "email": "John Doe",
            "password": null
        }
    ]
}'

Example Success Response

{
    "data": {
        "failedItems": [],
        "successItems": [
            {
                "payload": {
                    "employeeID": "EMPLY001",
                    "email": "John Doe",
                    "password": null
                },
                "response": {
                    "serial": "OPENAPI9Z7ZIHIFW"
                }
            }
        ]
    },
    "status": "success",
    "message": "success"
}

Example Failed Response

{
    "data": {
        "failedItems": [
            {
                "error": {
                    "detail": "user email already been taken",
                    "errorCode": 10102,
                    "message": "USER_EMAIL_EXISTS"
                },
                "payload": {
                    "employeeID": "EMPLY001",
                    "email": "John Doe",
                    "password": null
                }
            }
        ],
        "successItems": []
    },
    "status": "success",
    "message": "success"
}

See also: Error Dictionary.