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.eyJhdWQiOiI3IiwianRpIjoiNWQ1ZGEzMGZmZTlhNmE2MTI5NzEyMjI2MjlkY2JjNzYxMWIzNWUwNzVhYWQ1NWI3NDJiZmQ3NDE0MmRiN2M0ZjU1MWU5MmZlNGQyNzEwODkiLCJpYXQiOjE3OTE0OTQ5OTYuNTY4MTQ4LCJuYmYiOjE3OTE0OTQ5OTYuNTY4MTUxLCJleHAiOjE4MjMwMzA5OTYuNTUzMDU5LCJzdWIiOiI2MDc2MyIsInNjb3BlcyI6W119.grvGLjqbo0p_bQlDyV9L1z2GwRNBf8sFJ0SHbEpZWENIGHrzHNy-KTqMmr9mfat1owV90uUfQjlneh7tbFKyYRSFWShcW_hRTP-Q069ChqCVzHi_EslY16Vd9-xslo9stRzHmLMhJ30rJuQt-1Qn01UyC6eWZ-WUds17XlVrWr3D2kv49tV1qyvOiSym94GiV8dqTg8HT5q8ZhBD5K3b9khsS2BOYzomZYbYG8nIw3Zfd6ST2c_CzrfLQMZiFghbJAjs40cwU92t4ub3Puzlk-97VcwUxj6O5L7nP0hkyrZZGyiakchw9OUG_KZOAMgqmwncmTNGCM8a3-zubjVIJW22qKVbbTwI8IN7QqE1jbBQlPTj6381BkAjU0hO_3CRtcMOo0OfAgmlPyNsiLr3dDzDPe5467p__OM4xrdpcPfPnoeqTIe9VYb6Hpx2d7-tRB8beQ5-ZHPHdk6o_WxMmQFVwuntNSO58xpIBqYX8IY8B8niljVvwk_9YJVXIU0oCANeSBNlEjjPqKKo1mG_DcfRSzQtdFBaOfQ5XPd7U3LGg9itd7zgEuyVJ9oNrie1gXg0JGe7USRLokTiPBIAy9CZ5FrrGdEzyMvYKSOZTq-LjkyDzzGDsL5vpFOfOLouhl3Vhed_eLCxjuIScuiaUN-BAeK9-6DByw8Hv7TOG64",
"user_lcuid": "LCUID-LU-d447930a-b5d0-425a-9b98-9e240abccbb9"
}
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.eyJhdWQiOiI3IiwianRpIjoiNWQ1ZGEzMGZmZTlhNmE2MTI5NzEyMjI2MjlkY2JjNzYxMWIzNWUwNzVhYWQ1NWI3NDJiZmQ3NDE0MmRiN2M0ZjU1MWU5MmZlNGQyNzEwODkiLCJpYXQiOjE3OTE0OTQ5OTYuNTY4MTQ4LCJuYmYiOjE3OTE0OTQ5OTYuNTY4MTUxLCJleHAiOjE4MjMwMzA5OTYuNTUzMDU5LCJzdWIiOiI2MDc2MyIsInNjb3BlcyI6W119.grvGLjqbo0p_bQlDyV9L1z2GwRNBf8sFJ0SHbEpZWENIGHrzHNy-KTqMmr9mfat1owV90uUfQjlneh7tbFKyYRSFWShcW_hRTP-Q069ChqCVzHi_EslY16Vd9-xslo9stRzHmLMhJ30rJuQt-1Qn01UyC6eWZ-WUds17XlVrWr3D2kv49tV1qyvOiSym94GiV8dqTg8HT5q8ZhBD5K3b9khsS2BOYzomZYbYG8nIw3Zfd6ST2c_CzrfLQMZiFghbJAjs40cwU92t4ub3Puzlk-97VcwUxj6O5L7nP0hkyrZZGyiakchw9OUG_KZOAMgqmwncmTNGCM8a3-zubjVIJW22qKVbbTwI8IN7QqE1jbBQlPTj6381BkAjU0hO_3CRtcMOo0OfAgmlPyNsiLr3dDzDPe5467p__OM4xrdpcPfPnoeqTIe9VYb6Hpx2d7-tRB8beQ5-ZHPHdk6o_WxMmQFVwuntNSO58xpIBqYX8IY8B8niljVvwk_9YJVXIU0oCANeSBNlEjjPqKKo1mG_DcfRSzQtdFBaOfQ5XPd7U3LGg9itd7zgEuyVJ9oNrie1gXg0JGe7USRLokTiPBIAy9CZ5FrrGdEzyMvYKSOZTq-LjkyDzzGDsL5vpFOfOLouhl3Vhed_eLCxjuIScuiaUN-BAeK9-6DByw8Hv7TOG64",
"user_lcuid": "LCUID-LU-d447930a-b5d0-425a-9b98-9e240abccbb9"
}
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
}