POST /api/v3/auth¶
Summary¶
POST auth
Description¶
Retrieve your Bearer token for a supplied token and secret
Your call to this endpoint, along with your header value for AppIdV3 will return a long-lived Bearer token that you can use to authenticate all future calls
See More at Lucit Application Tokens
Tags: auth
Parameters¶
Header Parameters¶
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
Content-Type |
string |
✓ Yes | application/json |
|
Accept |
string |
✓ Yes | application/json |
|
AppIdV3 |
string |
✓ Yes | LCUID-LAP-********-****-****-****-************ |
Request Body¶
Required: Yes
Content Type: application/json¶
Schema¶
Type: object
Required fields: token, secret
Properties:
token(string) (required): is the Auth token you created for your App in Lucitsecret(string) (required): This is the secret that was generated when you created your Auth Token
Responses¶
Response: 200¶
Description: Succesful
Content Type: application/json¶
Schema¶
Type: object
Properties:
ok(boolean)token(string): The Bearer token to use for future callsuser_lcuid(string): The LCUID of the user
Example Response¶
{
"ok": true,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiZjllZmJjZTU4NTg1OWNiNjg5M2ZhMGEzZWVmYjMzYmRmNWJlN2IxN2JlOTZkYWJmM2JhYTI0Mjc4M2EzNDdlZGQ0NzgxMjBmZDUyYTA2MjEiLCJpYXQiOjE3Njc3NDQ2MjguMjIyODQ4LCJuYmYiOjE3Njc3NDQ2MjguMjIyODUsImV4cCI6MTc5OTI4MDYyOC4yMTQ3MDIsInN1YiI6IjczMTQiLCJzY29wZXMiOltdfQ.j9c8dl0MJKbcwpDMiPXmQzBxSNQUeegyu5goZKGg0fBDTBD6T77qaVBHV-IrDIvznU_qMBSmRqPejsqGC6GRojxKhHWeQQbsmzWTp7typ8qucjUsVIVqWX10DT7Io8FcgmAsXN7zmWvuoUBIJQ3SlfrPVKjK8qBiI-BeKlKmpQ86-Mswzd6bsn-n4nzEpu65rxEu52eZjktI32qQmHxWQqtHLFHPY7HxP0DL0WPogRigY0bnRSQyAmqlv0L2y_z3Uc9WGRQRFV1KdTOFO6PwZICgHGdELhGvSbuk4lpFGr540aZVCezewpt0Q2A-TV6kuE6JTZznkPGrT_49JYeCgQQizzNzxwF4rGf1GwTFZHNtgOXPzRWJPGzqNrti7UbePUZffHkkFtDcAQBiYxyuISHEV9DLRZxiFjlf7mQgtf-1VeJ9gI-gP_i10Aiw2Wc9wkC_TIfTofXs6mXz3oORXHVpw-d05zvvF26mxgBm6QBN2HstfWyNiJlnaN-adAA9lrYLX5ieHTB7BJjR4F9XmpfWzmgHeyQUCnfa2Fsrg0BqcXOwJzA2Qixj1SucxuofczSLC0HDpBR2hNUF1kELsMDBLVoeMuhC607YPS376aPLvN6iuprD_KmXIr8XpxW6JV8Fgx7XJ2kVrBUE_XfBpJZTURKZcHX-KWgB-MKeemg",
"user_lcuid": "LCUID-LU-0d3a09a6-45ff-46a9-8dca-ce7e2323c0b9"
}
Response: 401¶
Description: Invalid Token
Content Type: application/json¶
Schema¶
Type: object
Properties:
ok(boolean)http_code(integer)code(string)message(string)data(object) Type:object
Properties:
auth_error_code(string)-
auth_error_details(string) -
lucore_error_response(boolean)
Example Response¶
{
"ok": false,
"http_code": 401,
"code": "unauthorized",
"message": "You do not have permissions for this endpoint or you have supplied invalid credentials",
"data": {
"auth_error_code": "app_is_invalid",
"auth_error_details": "App not found, does not exist or has been deleted"
},
"lucore_error_response": true
}
Example Implementations¶
Bash (cURL)¶
curl --request POST \
"https://api.lucit.app/api/v3/auth" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "AppIdV3: LCUID-LAP-********-****-****-****-************" \
--data "{
\"token\": \"aliquid\",
\"secret\": \"aliquid\"
}"
JavaScript (Fetch API)¶
const url = new URL(
"https://api.lucit.app/api/v3/auth"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"AppIdV3": "LCUID-LAP-********-****-****-****-************",
};
let body = {
"token": "aliquid",
"secret": "aliquid"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
PHP (Guzzle)¶
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.lucit.app/api/v3/auth',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'AppIdV3' => 'LCUID-LAP-********-****-****-****-************',
],
'json' => [
'token' => 'aliquid',
'secret' => 'aliquid',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Python (Requests)¶
import requests
import json
url = 'https://api.lucit.app/api/v3/auth'
payload = {
"token": "aliquid",
"secret": "aliquid"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'AppIdV3': 'LCUID-LAP-********-****-****-****-************'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example Responses¶
200 Response¶
{
"ok": true,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiZjllZmJjZTU4NTg1OWNiNjg5M2ZhMGEzZWVmYjMzYmRmNWJlN2IxN2JlOTZkYWJmM2JhYTI0Mjc4M2EzNDdlZGQ0NzgxMjBmZDUyYTA2MjEiLCJpYXQiOjE3Njc3NDQ2MjguMjIyODQ4LCJuYmYiOjE3Njc3NDQ2MjguMjIyODUsImV4cCI6MTc5OTI4MDYyOC4yMTQ3MDIsInN1YiI6IjczMTQiLCJzY29wZXMiOltdfQ.j9c8dl0MJKbcwpDMiPXmQzBxSNQUeegyu5goZKGg0fBDTBD6T77qaVBHV-IrDIvznU_qMBSmRqPejsqGC6GRojxKhHWeQQbsmzWTp7typ8qucjUsVIVqWX10DT7Io8FcgmAsXN7zmWvuoUBIJQ3SlfrPVKjK8qBiI-BeKlKmpQ86-Mswzd6bsn-n4nzEpu65rxEu52eZjktI32qQmHxWQqtHLFHPY7HxP0DL0WPogRigY0bnRSQyAmqlv0L2y_z3Uc9WGRQRFV1KdTOFO6PwZICgHGdELhGvSbuk4lpFGr540aZVCezewpt0Q2A-TV6kuE6JTZznkPGrT_49JYeCgQQizzNzxwF4rGf1GwTFZHNtgOXPzRWJPGzqNrti7UbePUZffHkkFtDcAQBiYxyuISHEV9DLRZxiFjlf7mQgtf-1VeJ9gI-gP_i10Aiw2Wc9wkC_TIfTofXs6mXz3oORXHVpw-d05zvvF26mxgBm6QBN2HstfWyNiJlnaN-adAA9lrYLX5ieHTB7BJjR4F9XmpfWzmgHeyQUCnfa2Fsrg0BqcXOwJzA2Qixj1SucxuofczSLC0HDpBR2hNUF1kELsMDBLVoeMuhC607YPS376aPLvN6iuprD_KmXIr8XpxW6JV8Fgx7XJ2kVrBUE_XfBpJZTURKZcHX-KWgB-MKeemg",
"user_lcuid": "LCUID-LU-0d3a09a6-45ff-46a9-8dca-ce7e2323c0b9"
}
401 Response¶
{
"ok": false,
"http_code": 401,
"code": "token_invalid_or_unauthorized",
"message": "Your token is missing, invalid, or un-authorized",
"data": [],
"lucore_error_response": true
}
401 Response¶
{
"ok": false,
"http_code": 401,
"code": "secret_invalid",
"message": "Your token secret is missing, invalid, or un-authorized",
"data": [],
"lucore_error_response": true
}
401 Response¶
{
"ok": false,
"http_code": 401,
"code": "unauthorized",
"message": "You do not have permissions for this endpoint or you have supplied invalid credentials",
"data": {
"auth_error_code": "app_is_invalid",
"auth_error_details": "App not found, does not exist or has been deleted"
},
"lucore_error_response": true
}