POST /api/v3/lightning/devices/{lcuid}/log¶
Summary¶
POST /lightning/devices/{lcuid}/log
Description¶
Post a log entry for a lightning device
Tags: lightning
Parameters¶
Header Parameters¶
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
Authorization |
string |
✓ Yes | Bearer {AuthToken} |
|
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: message
Properties:
message(string) (required): The string message to log.data(object): An optional array of key value pair data.level(string): The log level Must be one of the PSR-3 log levels see PSR-3 Log Levels.
Responses¶
Response: 200¶
Description: Sample Response
Content Type: application/json¶
Schema¶
Type: object
Properties:
success(boolean)
Example Response¶
Example Implementations¶
Bash (cURL)¶
curl --request POST \
--url "https://api.lucit.app/api/v3/lightning/devices/{lcuid}/log" \
--header "Authorization: Bearer {AuthToken}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "AppIdV3: LCUID-LAP-********-****-****-****-************"
JavaScript (Fetch API)¶
const url = "https://api.lucit.app/api/v3/lightning/devices/{lcuid}/log";
const headers = {
"Authorization": "Bearer {AuthToken}",
"Content-Type": "application/json",
"Accept": "application/json",
"AppIdV3": "LCUID-LAP-********-****-****-****-************"
};
fetch(url, {
method: "POST",
headers: headers
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
PHP (Guzzle)¶
<?php
require_once 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.lucit.app/api/v3/lightning/devices/{lcuid}/log', [
'headers' => [
'Authorization' => 'Bearer {AuthToken}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'AppIdV3' => 'LCUID-LAP-********-****-****-****-************',
]
]);
$body = $response->getBody();
$data = json_decode($body, true);
print_r($data);
Python (Requests)¶
import requests
import json
url = "https://api.lucit.app/api/v3/lightning/devices/{lcuid}/log"
headers = {
"Authorization": "Bearer {AuthToken}",
"Content-Type": "application/json",
"Accept": "application/json",
"AppIdV3": "LCUID-LAP-********-****-****-****-************"
}
response = requests.post(url, headers=headers)
print(response.json())