Get presence history for a sensor
GET
/presence/{id}/history
const url = 'https://api.occulights.com/api/v1/presence/example/history';const options = {method: 'GET', headers: {Authorization: '<Authorization>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.occulights.com/api/v1/presence/example/history \ --header 'Authorization: <Authorization>'Get historical presence data for a specific sensor within a time range
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Sensor ID
Query Parameters
Section titled “Query Parameters”since
string
Start time (RFC3339 format)
until
string
End time (RFC3339 format)
includePreceding
boolean
Include preceding event before ‘since’
Responses
Section titled “Responses”OK
Media typeapplication/json
Array<Array<object>>
Example generated
[ [ { "cursor": "example", "durationSeconds": 1, "presenceStatus": "example", "sensorId": "example", "startedAt": "example" } ]]Bad Request
Media typeapplication/json
object
message
string
Example generated
{ "message": "example"}Unauthorized
Media typeapplication/json
string
Example generated
exampleNot Found
Media typeapplication/json
object
message
string
Example generated
{ "message": "example"}Internal Server Error
Media typeapplication/json