Create User
This end point is use for create user
[POST] /ruangkerja/users
Information
This API is a function for create new user.
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 |
username | string | OPTIONAL | body | Username is used by users to sign in. Allowed format: Alphabet (a-z,A-Z) Numerical (0-9) |
string | OPTIONAL | body | Email of user. Email is required if phone empty | |
phone | string | OPTIONAL | body | Phone of user. Phone is required if email empty |
password | string | OPTIONAL | body | Password of user. Password will be send to email, If empty the password will be random |
isActive | bool | YES | body | Status of user |
tagSerials | []string | OPTIONAL | body | Tag serials |
organizationSerial | string | OPTIONAL | body | Organization serial of user |
Note: Email and phone number can be entered both
Example cURL Request
curl --location --request POST 'https://api.ruangkerja.id/ruangkerja/users' \
--header 'Authorization: access_token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"employeeID": "EMPLY001",
"name": "John Doe",
"username": null,
"email": "[email protected]",
"phone": "6281122334455",
"password": null,
"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.