Authentication PWA
This API is used to authenticate users to access the PWA service.
Endpoint
URL : {BaseURL}/api/v1/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
| Field | Data Type | Mandatory | Format | Description |
|---|---|---|---|---|
| String (200) | YES | User's email address. Required. Must be a valid email format, with a minimum length of 5 characters and a maximum length of 200 characters. | ||
| password | String (200) | YES | Alphanumeric | User's password. Required. Must have a minimum length of 8 characters and maximum length is 200. Must contain at least one lowercase letter, one uppercase letter, one number, and one special character. |
Sample JSON Request
curl --location --globoff '{{pwa-user-management}}/api/v1/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "pwa-user@mail.com",
"password": "Tes12345!"
}'
Response
This section describes the response parameters and provides JSON response examples returned by the PWA platform after a user successfully login.
Description Parameter Response
| Field | Data Type | Mandatory | Format | Description |
|---|---|---|---|---|
| requestID | String (36) | YES | UUID | Unique identifier for the request. |
| rc | Integer (3) | YES | Numeric | Response code indicating the status of the operation. |
| Message | String (200) | YES | Alphanumeric | A descriptive message regarding the response. |
| data | JSON Object | YES | JSON Object | Detail information from data. |
| token | String (2000) | YES | JWT | Authentication token for the logged-in user. |
| userId | String (36) | YES | UUID | Unique identifier of the user. |
| userName | String (200) | YES | Alphanumeric | Name of the user. |
| String (200) | YES | User's email address. | ||
| phoneNumber | String (200) | YES | Numeric | User's phone number. |
| customerId | String (36) | YES | UUID | Identifier of the customer. |
| companyId | String (36) | YES | UUID | Identifier of the company. |
Sample JSON Response
{
"requestID": "26c9cb66-8071-49fa-8126-136b1068b241",
"rc": 200,
"message": "Login Successfully",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiIwN2Q2YjhiOS1hNDViLTQwZTgtOTc2Zi0wZjdiMTJjNjUyZDIiLCJjdXN0b21lcklkIjoiMzliMjA5MTktM2ZmMS00M2NlLTh….",
"userId": "39b20919-3ff1-43ce-8a35-2780320dayyy",
"userName": "userTest",
"email": "pwa-user@mail.com",
"phoneNumber": "+62081945800005",
"customerId": "39b20919-3ff1-43ce-8a35-2780320dayyy",
"companyId": "07d6b8b9-a45b-40e8-976f-0f7b12c65yyy"
}
}