Skip to main content

Authentication Dashboard

This API is used to authenticate users to access the Dashboard service.

Endpoint

URL : {BaseURL}/api/v1/auth/login
Method : POST
Header : Content-Type : Application/JSON

Request

This section describes the request parameters and provides examples of JSON requests used to authentication user.
Description Parameter Request
FieldData TypeMandatoryFormatDescription
usernameString
(200)
YESEmailUser's email address. Required. Must be a valid email format, with a minimum length of 5 characters and a maximum length of 200 characters.
passwordString
(200)
YESAlphanumericUser's password. Required. Must have a minimum length of 8 characters and maximum length is 200. to contain at least one lowercase letter, one uppercase letter, one number, and one special character.
Sample JSON Request
curl --location --globoff '{{BaseURL}}/api/v1/auth/login' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "User-dashboard@mail.com",
"password": "Tes12345!"
}'

Response

This section describes the response parameters and provides JSON response examples returned by the Prezent platform after a user successfully login.
Description Parameter Response
FieldData TypeMandatoryFormatDescription
requestIDString
(36)
YESUUIDUnique identifier for the request.
rcInteger
(3)
YESNumericResponse code indicating the status of the operation.
MessageString
(200)
YESAlphanumericA descriptive message regarding the response.
dataJSON ObjectYESJSON ObjectDetail information from data.
keyString
(200)
NOAlphanumericThis field is intended for use with the Sandeza Integrated key.
tokenString
(2000)
YESJWTAuthentication token for the logged-in user.
userIdString
(36)
YESUUIDUnique identifier of the user.
userNameString
(200)
YESAlphanumericName of the user.
userEmailString
(200)
YESEmailUser's email address.
userPhoneNumberString
(200)
YESNumericUser's phone number.
roleIdString
(36)
YESUUIDIdentifier of the customer.
roleNameString
(200)
YESAlphanumericName of the user's role.
companyIdString
(36)
YESUUIDIdentifier of the user's company.
companyNameString
(200)
YESAlphanumericName of the user's company.
divisionIdString
(36)
YESUUIDIdentifier of the user's division.
divisionNameString
(200)
YESAlphanumericName of the user's division.
isInternalBooleanYESTrue / falseIndicates whether the user is an internal system user.
Sample JSON Response
{
"requestId": "12fec0b7-0340-43b8-a13a-f6e015931ecb",
"rc": 200,
"message": "read data successfully",
"data": {
"key": "",
"token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjYwbTBsdU56ek5HT0NobFhQMV82U0taNk1MTGp4OTZ0QUNHN3NUYktobk0iLCJ0eXAiOiJKV1QifQ.eyJ1c2VySWQiOiJmMGI3ODA5OS1jNTQxLTQzMWQtODRjOC1iOGFlMTczZTM5NDgiLCJ1c2VyTmFtZSI6InNhdG9zaGkgbmFrYW1vdG8iLCJyb2xlSWQiOiJmMzRhOTBmYy1hNjZmLTRlNTMtOTNmNy02MjBlYWQ3OGE4Y2YiLCJyb2xlTmFtZSI6IlN5c3RlbSBBZG1……..",
"userId": "f0b78099-c541-431d-84c8-b8ae173e3yyy",
"userName": "userDashboard",
"userEmail": "User-dashboard@mail.com",
"userPhoneNumber": "+6282100000001",
"roleId": "f34a90fc-a66f-4e53-93f7-620ead78yyyy",
"roleName": "Operator",
"companyId": "7059942f-d617-4438-9a69-6b44fd51yyyy",
"companyName": "PT Company",
"divisionId": "5897ddd5-cd92-4ff0-bc0c-cd0573f37yyy",
"divisionName": "Marcom",
"isInternal": false
}
}