Login
Exchange a user’s email and password for an API token. The token is a Laravel Sanctum personal access token: send it as Authorization: Bearer <token> on every other call. Five tries a minute per address. Accounts with two-factor sign-in cannot use this endpoint.
POST
/
admin
/
api
/
v1
/
login
Login
curl --request POST \
--url https://erp.arukz.com/admin/api/v1/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "admin@example.com",
"password": "password"
}
'import requests
url = "https://erp.arukz.com/admin/api/v1/login"
payload = {
"email": "admin@example.com",
"password": "password"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'admin@example.com', password: 'password'})
};
fetch('https://erp.arukz.com/admin/api/v1/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://erp.arukz.com/admin/api/v1/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'admin@example.com',
'password' => 'password'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "Login successful",
"token": "1|abcd1234efgh5678ijkl...",
"token_type": "Bearer",
"user": {
"id": 1,
"name": "Admin User",
"email": "admin@example.com"
}
}{
"message": "The provided credentials are incorrect.",
"errors": {
"email": [
"The provided credentials are incorrect."
]
}
}Body
application/json
Response
Login successful
⌘I
Login
curl --request POST \
--url https://erp.arukz.com/admin/api/v1/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "admin@example.com",
"password": "password"
}
'import requests
url = "https://erp.arukz.com/admin/api/v1/login"
payload = {
"email": "admin@example.com",
"password": "password"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({email: 'admin@example.com', password: 'password'})
};
fetch('https://erp.arukz.com/admin/api/v1/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://erp.arukz.com/admin/api/v1/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'admin@example.com',
'password' => 'password'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "Login successful",
"token": "1|abcd1234efgh5678ijkl...",
"token_type": "Bearer",
"user": {
"id": 1,
"name": "Admin User",
"email": "admin@example.com"
}
}{
"message": "The provided credentials are incorrect.",
"errors": {
"email": [
"The provided credentials are incorrect."
]
}
}