Login
This API endpoint allows you to log in to the system by sending a POST request with the necessary credentials.
//A code snippet on how to consume the API
var raw = "";
var requestOptions = {
method: 'POST',
body: raw,
redirect: 'follow'
};
fetch("https://demo.backend.monicredit.com/api/v1/core/auth/login", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));//A code snippet on how to consume the API
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://demo.backend.monicredit.com/api/v1/core/auth/login',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
POST {{BaseURL}}/core/auth/login
If the login is successful, the API will return a response with a 200 status code and a JSON object containing the data of the authenticated user.
Request Body
Name
Type
Description
email*
String
test@test.com
password*
String
##123!
{
"success": true,
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vZGVtby5tb25pY3JlZGl0Mi50ZXN0L2FwaS92MS9jb3JlL2F1dGgvbG9naW4iLCJpYXQiOjE2NzE0NzEyMTYsImV4cCI6MTY3MTgzMTIxNiwibmJmIjoxNjcxNDcxMjE2LCJqdGkiOiJQWlIwOEdUNzVKRFJFRkt3Iiwic3ViIjoiVVM2MzhhMTNjNzg3NThkIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.8H_Bn-rbmFLUp_nBkGnS0huRPFQ7gXfB9IM2RlZ_WiU",
"refreshToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vZGVtby5tb25pY3JlZGl0Mi50ZXN0L2FwaS92MS9jb3JlL2F1dGgvbG9naW4iLCJpYXQiOjE2NzE0NzEyMTYsImV4cCI6MTY3MTgzMTIxNiwibmJmIjoxNjcxNDcxMjE2LCJqdGkiOiJQWlIwOEdUNzVKRFJFRkt3Iiwic3ViIjoiVVM2MzhhMTNjNzg3NThkIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.8H_Bn-rbmFLUp_nBkGnS0huRPFQ7gXfB9IM2RlZ_WiU",
"userData": {
"ability": [
{
"id": 00,
"name": "view-account-settings",
"module_id": 00
}
],
"avatar": null,
"acn": "Test",
"email": "test@test.com",
"email_verified_at": "2022-12-05T17:32:31.000000Z",
"fullName": "Test Test",
"id": "US0000000",
"role": "merchant",
"activeMerchant": "MC000000",
"activeAccount": "ACC0000000",
"twofa_type": null,
"twofa_enable": "NO"
}
}Last updated