ZenSpace
  1. light
ZenSpace
  • ZenSpace Integration Documentation
  • ZenSpace General Architecture - Overview
  • ZenSpace API V1.0
    • Device Management
      • lock
        • Get Device Status
        • Subscribe to Device Events
        • Action on IoT Device
        • Get Device Control
      • camera
        • Get Device Status
        • Subscribe to Device Events
        • Action on IoT Device
        • Get Device Instruction
        • Get Device Control
      • light
        • Get Device Instruction
        • Get Device Status
        • Subscribe to Device Events
        • Action on IoT Device
        • Get Device Control
      • fan
        • Get Device Status
        • Subscribe to Device Events
        • Action on IoT Device
        • Get Device Instruction
        • Get Device Control
      • o3-sensor
        • temprature
          • Subscribe to Device Events Copy Copy
          • Get Device Status
        • buzzer
          • Get Device Status Copy
          • Action on IoT Device
        • occupancy
          • Get Device Status
        • ring-light
          • Action on IoT Device
          • Get Device Status
        • Get Device Instruction
        • Get Device Status
        • Subscribe to Device Events
        • Action on IoT Device
        • Get Device Control
      • meeting-room-display
        • Get Device Status
      • Get Device Instruction Copy
      • Fetch Associated Device Types
    • Bookings
      • Create, Update, or Cancel a Booking
      • Bulk Booking Operation
      • Check-in Operation
    • Meeting Space
      • Store Meeting Space Availability
      • Get the list of meeting spaces.
      • Get the state of a specific meeting space.
  • ZenSpace API V2.0
    • Device Management
      • lock
        • Get Device Control
        • Action on IoT Device
        • Subscribe to Device Events
        • Get Device Status
      • camera
        • Subscribe to Device Events
        • Get Device Control
        • Get Device Instruction
        • Action on IoT Device
        • Get Device Status
      • light
        • Get Device Status
          POST
        • Subscribe to Device Events
          GET
        • Get Device Instruction
          POST
        • Get Device Control
          POST
        • Action on IoT Device
          POST
      • fan
        • Get Device Instruction
        • Get Device Control
        • Action on IoT Device
        • Subscribe to Device Events
        • Get Device Status
      • o3-sensor
        • temprature
          • Get Device Status
          • Subscribe to Device Events Copy Copy
        • buzzer
          • Action on IoT Device
          • Get Device Status Copy
        • occupancy
          • Get Device Status
        • ring-light
          • Get Device Status
          • Action on IoT Device
        • Action on IoT Device
        • Get Device Control
        • Subscribe to Device Events
        • Get Device Status
        • Get Device Instruction
      • meeting-room-display
        • Get Device Status
      • Fetch Associated Device Types
        GET
      • Get Device Instruction Copy
        GET
    • Bookings
      • Check-in Operation
      • Bulk Booking Operation
      • Create, Update, or Cancel a Booking
    • Meeting Space
      • Get the state of a specific meeting space.
      • Get the list of meeting spaces.
      • Store Meeting Space Availability
  • ZenSpace Supported Devices
    • ZenSpace Device Integration
  1. light

Subscribe to Device Events

Developing
GET
/devices/events
Retrieve real-time events generated by devices, such as status changes or alerts.

Request

Header Params
X-API-Key
string 
required
API key for authentication.
Example:
your-api-key
Body Params application/json
device_type
string 
required
Example:
lock
Example
{
    "device_type": "lock"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET '/devices/events' \
--header 'X-API-Key: your-api-key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "device_type": "lock"
}'

Responses

🟢200OK
application/json
Successfully subscribed to events.
Body
data
array [object {3}] 
optional
eventType
string 
optional
Type of event.
Example:
lockAlert
timestamp
string 
optional
Time of the event.
Example:
2025-01-08T10:00:00Z
details
object 
optional
Additional event details.
Example:
{"door_feedback":"open"}
Example
{
    "data": [
        {
            "eventType": "lockAlert",
            "timestamp": "2025-01-08T10:00:00Z",
            "details": {
                "door_feedback": "open"
            }
        }
    ]
}
🔴500Server Error
Modified at 2025-05-09 12:02:11
Previous
Get Device Status
Next
Get Device Instruction
Built with