Search K
Appearance
Appearance
Gets one or more points for a device, based on filtering.
device id
integer
JSON Filter object
{"limit":10,"order":["timestamp DESC"]}
{"where":{"between":["2024-12-01T00:00:00.000Z","2024-12-01T23:59:59.999Z"]},"order":["timestamp DESC"]}
JSON
curl -X GET \
'https://api.lightbug.cloud/api/devices/id/points?filter=%7B%22limit%22%3A10%2C%22order%22%3A%5B%22timestamp+DESC%22%5D%7D%2C%7B%22where%22%3A%7B%22between%22%3A%5B%222024-12-01T00%3A00%3A00.000Z%22%2C%222024-12-01T23%3A59%3A59.999Z%22%5D%7D%2C%22order%22%3A%5B%22timestamp+DESC%22%5D%7D' \
-H "Content-Type: application/json"
fetch('https://api.lightbug.cloud/api/devices/id/points?filter=%7B%22limit%22%3A10%2C%22order%22%3A%5B%22timestamp+DESC%22%5D%7D%2C%7B%22where%22%3A%7B%22between%22%3A%5B%222024-12-01T00%3A00%3A00.000Z%22%2C%222024-12-01T23%3A59%3A59.999Z%22%5D%7D%2C%22order%22%3A%5B%22timestamp+DESC%22%5D%7D', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'https://api.lightbug.cloud/api/devices/id/points';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$query = http_build_query([
'filter' => '{"limit":10,"order":["timestamp DESC"]},{"where":{"between":["2024-12-01T00:00:00.000Z","2024-12-01T23:59:59.999Z"]},"order":["timestamp DESC"]}',
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'https://api.lightbug.cloud/api/devices/id/points'
params = {
'filter': [
'{\'limit\':10,\'order\':[\'timestamp DESC\']}',
'{\'where\':{\'between\':[\'2024-12-01T00:00:00.000Z\',\'2024-12-01T23:59:59.999Z\']},\'order\':[\'timestamp DESC\']}'
]
}
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, params=params, headers=headers)
print(response.json())