Update presence for a device
PUT
/presence/{id}
const url = 'https://api.occulights.com/api/v1/presence/example';const options = { method: 'PUT', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"deviceType":"hub","state":"occupied"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.occulights.com/api/v1/presence/example \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "deviceType": "hub", "state": "occupied" }'Update the presence status for a specific device
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Sensor ID
Request Body
Section titled “Request Body”Presence state, select between occupied or vacant
Media typeapplication/json
Possible values: “occupied”, “vacant”
object
deviceType
string
state
string
Example
occupiedResponses
Section titled “Responses”OK
Media typeapplication/json
object
message
string
Example generated
{ "message": "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