Skip to main content

Login

Description

The login endpoint authenticates users and allows them to access their accounts.

HTTP method POST

Endpoint

http://apidev3.mslainternational.com/security/api/auth/login

Request body

NAMEREQUIREDTYPE
username string
passwordstring

Request body example

{
"username": "root",
"password": "root"
}

Status code responses

CodeDescription
200 Return a body response with token
400 Bad request
401 Unauthorized
404 Not Found
500 Internal Server Error

The full documentation error codes can be found here.

Response 200 status code

{
"token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJlMTlkNjg5YS00ZDVhLTExZWQtYmRjMy0wMjQyYWMxMjAwMDIiLCJhdXRoIjoiUk9MRV9CMkNfVVNFUiIsImlhdCI6MTY4MzE0MjQ5OCwiZXhwIjoxNjgzMTUxNDk4fQ.M9Ir0hefBhQmTOHtRo-HT_1yKOkvCDWivZPkbyDfEmm7Gh8ZRPXIb2iTcxyADbvGK1gU2SWFxL0g_WSUzmQusw",
"expiration": 150
}

Response 400 status code

{
"traceId": "a5bef650a58ac590",
"timestamp": "2023-05-08 11:47:32",
"code": "SEC-1001",
"message": "A generic error has occurred.",
"data": null
}

Response 401 status code

{
"traceId": "43a20f33d4e8730d",
"timestamp": "yyyy-mm-dd HH:MM:SS",
"code": "SEC-1004",
"message": "Unauthorized. Please check your credentials or ensure you have the appropriate access."
}

Response 404 status code

{
"traceId": "43a20f33d4e8730d",
"timestamp": "yyyy-mm-dd HH:MM:SS",
"code": "SEC-1004",
"message": "User not found."
}

Response 500 status code

{
"traceId": "43a20f33d4e8730d",
"timestamp": "yyyy-mm-dd HH:MM:SS",
"code": "SEC-1001",
"message": "A generic error has occurred.",
"data": null
}