POST /api/v3/lightning/device-requests/request¶
Summary¶
POST /lightning/device-requests/request
Description¶
Request a new lightning device code and token
You will use the lcuid of the device request and the token in the check for device step See /lightning/device-requests/check-for-device
Tags: lightning
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: device_provided_uuid, width, height
Properties:
device_provided_uuid(string) (required): A unique id, provided by the device.width(number) (required): Width in pixels Example 1024.height(number) (required): Height in pixels Example 768.device_info(object): Information about the device that is making the request See Capacitor DeviceInfo.
Responses¶
Response: 200¶
Description: Sample Response
Content Type: application/json¶
Schema¶
Type: object
Properties:
success(boolean)lightning_device_request(object) Type:object
Properties:
code(integer): The code that the device will use to authenticatecode_string(string): The code in dashed string format for easy readingdevice_provided_uuid(string): The unique id provided by the deviceexpires_at(string): The time that the code will expirelcuid(string): The unique id of the requested codewidth(integer)height(integer)-
device_info(array) -
token(string): The token that the device must use to authenticate requests with this device code / lcuid existing_device(array)
Example Response¶
{
"success": true,
"lightning_device_request": {
"code": 536659653,
"code_string": "536-659-653",
"device_provided_uuid": "imx8GEw1nJ3Wr1at",
"expires_at": "2026-01-07T00:45:26.000000Z",
"lcuid": "LCUID-LDR-a521d297-764b-4d55-8ea6-0322a8a9a07a",
"width": 1024,
"height": 768,
"device_info": []
},
"token": "8C9tUUT:695da59e:a37359d42689c87c157eca57ae7b0de3",
"existing_device": []
}
Example Implementations¶
Bash (cURL)¶
curl --request POST \
"https://api.lucit.app/api/v3/lightning/device-requests/request" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "AppIdV3: LCUID-LAP-********-****-****-****-************" \
--data "{
\"device_provided_uuid\": \"12345678-1234-1234-1234-123456789012\",
\"width\": 7019827.03,
\"height\": 7019827.03
}"
JavaScript (Fetch API)¶
const url = new URL(
"https://api.lucit.app/api/v3/lightning/device-requests/request"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"AppIdV3": "LCUID-LAP-********-****-****-****-************",
};
let body = {
"device_provided_uuid": "12345678-1234-1234-1234-123456789012",
"width": 7019827.03,
"height": 7019827.03
};
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/lightning/device-requests/request',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'AppIdV3' => 'LCUID-LAP-********-****-****-****-************',
],
'json' => [
'device_provided_uuid' => '12345678-1234-1234-1234-123456789012',
'width' => 7019827.03,
'height' => 7019827.03,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Python (Requests)¶
import requests
import json
url = 'https://api.lucit.app/api/v3/lightning/device-requests/request'
payload = {
"device_provided_uuid": "12345678-1234-1234-1234-123456789012",
"width": 7019827.03,
"height": 7019827.03
}
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¶
{
"success": true,
"lightning_device_request": {
"code": 536659653,
"code_string": "536-659-653",
"device_provided_uuid": "imx8GEw1nJ3Wr1at",
"expires_at": "2026-01-07T00:45:26.000000Z",
"lcuid": "LCUID-LDR-a521d297-764b-4d55-8ea6-0322a8a9a07a",
"width": 1024,
"height": 768,
"device_info": []
},
"token": "8C9tUUT:695da59e:a37359d42689c87c157eca57ae7b0de3",
"existing_device": []
}