# Authenticate a user Authenticate a user Endpoint: POST /api/v1/authentication/login Version: 2.0.0 ## Request fields (application/json): - `username` (string, required) Example: "username" - `password` (string, required) Example: "password" ## Response 200 fields (application/json): - `message` (string, required) Example: "Bearer token created and it expires in 120 minutes" - `data` (string, required) Example: "eyJ0eXAiOiJKV1QiLC..." - `error` (boolean, required) - `token_exp` (string, required) Example: "April, 22 2025 16:28:55" ## Response 400 fields (application/json): - `data` (string, required) - `error` (boolean, required) Example: true - `pagination` (object, required) Example: {"totalPages":1,"maxRows":0,"offset":0,"page":1,"totalRecords":0} - `pagination.totalPages` (integer) Example: 1 - `pagination.maxRows` (integer) - `pagination.offset` (integer) - `pagination.page` (integer) Example: 1 - `pagination.totalRecords` (integer) Example: 1 - `messages` (array, required) Example: ["Missing parameter"] ## Response 401 fields (application/json): - `data` (string, required) - `error` (boolean, required) Example: true - `pagination` (object, required) Example: {"totalPages":1,"maxRows":0,"offset":0,"page":1,"totalRecords":0} - `pagination.totalPages` (integer) Example: 1 - `pagination.maxRows` (integer) - `pagination.offset` (integer) - `pagination.page` (integer) Example: 1 - `pagination.totalRecords` (integer) Example: 1 - `messages` (array, required) Example: ["Invalid Authorization"] ## Response 405 fields (application/json): - `data` (string, required) - `error` (boolean, required) Example: true - `pagination` (object, required) Example: {"totalPages":1,"maxRows":0,"offset":0,"page":1,"totalRecords":0} - `pagination.totalPages` (integer) Example: 1 - `pagination.maxRows` (integer) - `pagination.offset` (integer) - `pagination.page` (integer) Example: 1 - `pagination.totalRecords` (integer) Example: 1 - `messages` (array, required) Example: ["Method Not Allowed"]