web sdk events and alarms - Genetec/DAP GitHub Wiki

Monitoring events and alarms

The Web SDK provides comprehensive real-time event monitoring capabilities, allowing applications to subscribe to and receive notifications about events and alarms as they occur in Security Center.

Event subscriptions

Subscribe to events

To monitor events in real-time, you must first subscribe to the events you want to receive. You can subscribe to events from specific entities or from all entities of a given type.

Subscribe to events from a specific entity:

GET /events/subscribe?q=event({source},{eventType})
  • {source}: Entity GUID or Logical ID of the specific entity
  • {eventType}: The type of event to monitor

Subscribe to events from all entities of a type:

GET /events/subscribe?q=event({entityType},{eventType})
  • {entityType}: The entity type (e.g., Camera, Door, Cardholder)
  • {eventType}: The type of event to monitor

Subscribe to multiple events in a single request:

GET /events/subscribe?q=event({source1},{eventType1}),event({source2},{eventType2}),event({source3},{eventType3})

Example subscriptions

Monitor camera motion events for all cameras:

GET /events/subscribe?q=event(Camera,CameraMotion)

Monitor access events for a specific door:

GET /events/subscribe?q=event(LogicalID(Door,1),AccessGranted)

Monitor multiple event types:

GET /events/subscribe?q=event(Camera,CameraMotion),event(Door,AccessGranted),event(User,UserLoggedOn)

Unsubscribe from events

To stop receiving specific events:

GET /events/unsubscribe?q=event({source},{eventType})

View current subscriptions

To retrieve the list of all active event subscriptions:

GET /events/subscribed

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": [
      {
        "EventType": "AccessGranted",
        "Entities": [
          "78c5aaf7-3b1f-4cca-bbbf-73e3695c55ad",
          "aa25fab7-7f4e-4ae5-9c3c-4ddae5388e86"
        ]
      },
      {
        "EventType": "CameraMotion",
        "Entities": [
          "00000001-0000-babe-0000-2b2fbe79920b",
          "00000001-0000-babe-0000-df7434997b3b"
        ]
      }
    ]
  }
}

Notes:

  • Each item represents one event type subscription
  • Entities contains all entity GUIDs subscribed for that event type
  • Returns empty result if no active subscriptions

Note

When subscribing by entity type (e.g., event(Door,AccessGranted)), the Entities list may take a moment to populate while the server resolves matching entities. Subscriptions by specific GUID appear immediately.

Real-time event streaming

Opening the event stream

To receive real-time events, open an HTTP event stream:

GET /events/

The server will redirect this request to the streaming port (default: 4591) and establish a persistent connection for event delivery.

Connection management

Close a specific connection:

POST /events/closeconnection/{connectionId}
  • {connectionId}: The ID of the connection to close

Always close connections when they are no longer needed to free up server resources.

How HTTP event streaming works

Prerequisites:

  • Must be authenticated with valid credentials
  • Subscribe to desired events before or after opening the stream (events are only sent for active subscriptions)

Connection Flow:

  1. Subscribe to Events (optional but recommended):

    GET /events/subscribe?q=event(Camera,CameraMotion)

    Subscribe to the events you want to receive. Without subscriptions, the stream will be empty.

  2. Client Initiates Connection:

    GET /events

    Client sends GET request to /events on the Web SDK port (default: 4590)

  3. Server Redirect (HTTP 301):

    Location: http://localhost:4591/WebSdk/streaming/events/sessionid={base64-session-id}
    

    Server responds with 301 Moved Permanently, redirecting to the streaming port (default: 4591) with an encoded session ID

  4. Client Follows Redirect: Client follows the redirect to the streaming port.

  5. Stream Established: Server responds with:

    HTTP/1.0 200
    ConnectionId: {guid}
    Content-Type: multipart/mixed; boundary=--GENETECBOUNDARY

    The connection remains open for continuous event delivery.

  6. Event Delivery: Events are delivered in real-time as JSON within multipart boundaries:

    --GENETECBOUNDARY
    Content-type: text/json
    
    {event JSON}
    --GENETECBOUNDARY
    
  7. Connection Cleanup: When finished, close the connection using the ConnectionId from step 5:

    POST /events/closeconnection/{connectionId}

Important Notes:

  • The stream is persistent - it stays open until explicitly closed or the session expires
  • Events are only sent for active subscriptions on the current session
  • The ConnectionId in the response header is used to close the connection
  • Client must support HTTP redirects and persistent connections
  • Session keep-alive is automatic when you have both an active subscription and an open stream (1 minute intervals)

Event stream format

When you open the stream with GET /events, the server returns:

Initial Response Headers:

HTTP/1.0 200
Expires: Thu, 1 Jan 1998 00:00:00 GMT
ConnectionId: f810a565-16cc-493c-8749-41ee8b999539
Content-type: multipart/mixed; boundary=--GENETECBOUNDARY
--GENETECBOUNDARY

The ConnectionId header contains the unique identifier for this connection, which can be used to close it later.

Event Format:

Events are delivered as JSON within multipart boundaries, wrapped in the standard Rsp envelope:

--GENETECBOUNDARY
Content-type: text/json

{"Rsp":{"Status":"Ok","Result":{"Event":{"Condition":"","VideoEncoderDevice":"00000000-0000-0000-0000-000000000000","SourceTimeZone":{"Id":"Singapore Standard Time","DisplayName":"(UTC+08:00) Kuala Lumpur, Singapore","StandardName":"Malay Peninsula Standard Time","DaylightName":"Malay Peninsula Daylight Time","BaseUtcOffset":"08:00:00","AdjustmentRules":null,"SupportsDaylightSavingTime":false},"EventName":2535,"Coordinates":null,"SourceEntity":"00000001-0000-babe-0000-2bddb61cced4","GroupId":"00000000-0000-0000-0000-000000000000","SourceEntityTypes":["Camera"],"Timestamp":"2026-03-15T11:05:44Z","OfflinePeriod":"None","Type":"CameraMotion","RelatedEntities":["00000001-0000-babe-0000-2bddb61cced4"]},"EventType":"CameraMotion","SourceGuid":"00000001-0000-babe-0000-2bddb61cced4","Timestamp":"2026-03-15T11:05:44.3322672Z","GroupId":"00000000-0000-0000-0000-000000000000"}}}
--GENETECBOUNDARY

Key Fields:

  • EventType - Type of event (e.g., CameraMotion, AccessGranted)
  • SourceGuid - Entity that triggered the event
  • Timestamp - When the event occurred (UTC)
  • Event - Detailed event information including source entity types and related entities

Alarm monitoring

Enable alarm monitoring

When alarm monitoring is enabled, triggered alarms are included in the event stream alongside regular events.

Enable alarm monitoring:

POST /events/alarmMonitoring/on

Disable alarm monitoring:

POST /events/alarmMonitoring/off

Alarm stream format

When alarm monitoring is enabled, alarm notifications are delivered in this format:

--GENETECBOUNDARY
Content-type: text/json

{"Rsp":{"Status":"Ok","Result":{"AlarmTriggered":{"AlarmGuid":"8f1f727f-38d9-41e9-ac4d-fe1d41a4a6da","CreationTimestamp":"2026-03-15T11:17:23.7152364Z","InstanceId":18,"OfflinePeriod":"None","PropagationLevel":0,"HasSourceCondition":false,"SourceGuid":"00000001-0000-babe-0000-2bddb61cced4","SourceName":"GUSTAV Unit 10Mbps - Camera - 01","TriggerEvent":"ManualAction","TriggerTimestamp":"2026-03-15T11:17:23.7381299Z","DynamicAlarmContent":{"AttachedEntities":[],"Context":"Alarm with recipient","ForwardedRecipients":[],"Priority":0,"Urls":[]}}}}}
--GENETECBOUNDARY

Important

Monitoring specific individual alarms is not supported. When alarm monitoring is enabled, all triggered alarms are sent to the stream. The alarm entity must have the current user as a recipient for alarm events to appear in the stream.

Managing alarm recipients

Alarm events are only sent to users who are configured as recipients on the alarm entity. Use the Recipients collection on the alarm entity to manage recipients.

Add a recipient:

POST /entity?q=entity={alarm-guid},Recipients.Add({user-or-group-guid},00:00:00)

Parameters:

  • First parameter (Guid): The user or user group entity GUID to add as a recipient
  • Second parameter (TimeSpan): The forward delay before the alarm is escalated to this recipient (use 00:00:00 for immediate delivery)

Remove a recipient:

POST /entity?q=entity={alarm-guid},Recipients.Remove({user-or-group-guid})

Clear all recipients:

POST /entity?q=entity={alarm-guid},Recipients.Clear()

Check if a user is a recipient (includes group membership):

GET /entity?q=entity={alarm-guid},IsRecipient({user-or-group-guid})

Returns true if the entity is a direct recipient or is a member (at any depth) of a user group that is a recipient. Use this to check whether a specific user will receive the alarm.

Check if a user is a member of a recipient group:

POST /entity?q=entity={alarm-guid},Recipients.Contains({user-guid})

Returns true if the user is a member (at any depth) of a recipient group. Returns false for the recipient group entity itself. Use IsRecipient instead if you need to check both direct recipients and group members.

Alarm operations

The /alarm endpoint provides operations for triggering, acknowledging, investigating, and forwarding alarm instances.

HTTP Method: GET (uses q= parameter for operations)

Endpoint format:

GET /alarm?q=MethodName(arg1,arg2,...)

Important

If you include more than one /alarm method call in the same request, the calls run in order and are not rolled back as a group. If a later call fails, earlier successful alarm operations remain applied.

Triggering alarms

Create new alarm instances. All TriggerAlarm() variants return an alarm instance ID for follow-up operations.

Basic alarm trigger

Minimal trigger (alarm only):

GET /alarm?q=TriggerAlarm({alarm-guid})

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {
      "alarminstanceid": 20
    }
  }
}

With source entity:

GET /alarm?q=TriggerAlarm({alarm-guid},{source-entity-guid})

Triggering with context

With context string:

GET /alarm?q=TriggerAlarm({alarm-guid},{source-guid},DynamicAlarmContent(Door forced open))

With priority and attached entities:

GET /alarm?q=TriggerAlarm({alarm-guid},{source-guid},DynamicAlarmContent(Server room breach){Priority=100,AttachedEntities@{entity-guid1}@{entity-guid2}})

Parameters:

  • alarm (GUID or LogicalID) - Alarm entity to trigger
  • sourceEntity (GUID or LogicalID) - Originating entity (use 00000000-0000-0000-0000-000000000000 if none)
  • DynamicAlarmContent(text) - Context wrapper with optional attributes

DynamicAlarmContent attributes (all optional):

  • Priority (int 1-255) - Override alarm priority
  • AttachedEntities@{guid1}@{guid2} - Link entities to alarm instance
  • ForwardedRecipients@{user-guid1}@{user-guid2} - Users/groups to receive alarm
  • Urls@https://example.com/ticket - Additional context links

Note

All attributes must be inside the DynamicAlarmContent(...){...} block.

Note

Do not wrap the context string in quotes. Quote characters inside DynamicAlarmContent(...) are preserved literally in the stored content.

Advanced triggering options

With acknowledgement settings:

GET /alarm?q=TriggerAlarm({alarm-guid},{source-guid},1,true)

Parameters:

  • Third parameter: Acknowledgement condition ID (integer)
  • Fourth parameter: User acknowledgement required (boolean)

With geographic coordinates:

GET /alarm?q=TriggerAlarm({alarm-guid},{source-guid},DynamicAlarmContent(Perimeter alarm),GeoCoordinate(45.5020,-73.5680))

GeoCoordinate format: GeoCoordinate(latitude,longitude) in decimal degrees

With forwarded recipients:

GET /alarm?q=TriggerAlarm({alarm-guid},{source-guid},DynamicAlarmContent(Critical alert){ForwardedRecipients@{user-guid1}@{user-guid2}})

With URLs for additional context:

GET /alarm?q=TriggerAlarm({alarm-guid},{source-guid},DynamicAlarmContent(Incident logged){Urls@https://tickets.example.com/INC-42})

Combined example with all attributes:

GET /alarm?q=TriggerAlarm({alarm-guid},{source-guid},DynamicAlarmContent(Server room breach){Priority=200,AttachedEntities@{camera-guid}@{door-guid},ForwardedRecipients@{supervisor-guid},Urls@https://tickets.example.com/INC-100})

Acknowledging alarms

Acknowledge triggered alarm instances to mark them as reviewed.

AcknowledgeAlarm

Acknowledge alarm with acknowledgement type.

Acknowledge with instance ID and type:

GET /alarm?q=AcknowledgeAlarm({instance-id},{ack-type})

Parameters:

  • instance-id (int) - Instance ID returned from TriggerAlarm
  • ack-type - Acknowledgement type: Ack or Nack

Example:

GET /alarm?q=AcknowledgeAlarm(42,Ack)

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {
      "Acknowledged": true
    }
  }
}

Acknowledge with instance ID, alarm GUID, and type:

GET /alarm?q=AcknowledgeAlarm({instance-id},{alarm-guid},{ack-type})

Parameters:

  • instance-id (int) - Alarm instance ID
  • alarm-guid (GUID) - Alarm entity GUID
  • ack-type - Acknowledgement type: Ack or Nack

Example:

GET /alarm?q=AcknowledgeAlarm(42,{c319de11-3fb9-4c42-b4ee-1745c7287799},Ack)

Acknowledgement Types:

  • Ack - Standard acknowledgement
  • Nack - Alternative acknowledgement

Acknowledge multiple instances of the same alarm:

GET /alarm?q=AcknowledgeAlarm({instance-id-1,instance-id-2},{ack-type})

Use this form when you already have multiple instance IDs for the same alarm and want to acknowledge them in one request.

Acknowledge multiple alarms in one request:

GET /alarm?q=AcknowledgeAlarm({{instance-id-1,alarm-guid-1},{instance-id-2,alarm-guid-2}},{ack-type})

In this form, each inner pair is one {instance-id,alarm-guid} entry. Use it when the instances belong to different alarm entities.

Note

If you are using curl to test bulk alarm operations, add --globoff to prevent curl from expanding {...} syntax into multiple requests.

ForceAcknowledgeAlarm

Force acknowledge alarm, bypassing acknowledgement conditions and requirements.

Force acknowledge alarm:

GET /alarm?q=ForceAcknowledgeAlarm({instance-id},{alarm-guid})

Parameters:

  • instance-id (int) - Instance ID returned from TriggerAlarm
  • alarm-guid (GUID) - Alarm entity GUID

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {}
  }
}

Investigating alarms

Mark alarms as under investigation.

Investigate alarm:

GET /alarm?q=InvestigateAlarm({instance-id},{alarm-guid})

Parameters:

  • instance-id (int) - Alarm instance ID
  • alarm-guid (GUID) - Alarm entity GUID

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {}
  }
}

Investigate multiple alarms in one request:

GET /alarm?q=InvestigateAlarm({{instance-id-1,alarm-guid-1},{instance-id-2,alarm-guid-2}})

Each inner pair identifies one alarm instance to mark as under investigation.

Forwarding alarms

Forward alarm instances to additional recipients.

Forward alarm:

GET /alarm?q=ForwardAlarm({instance-id},{recipient-guid})

Parameters:

  • instance-id (int) - Alarm instance ID
  • recipient-guid (GUID) - User or user group GUID (wrapped in curly braces)

Example:

GET /alarm?q=ForwardAlarm(42,{00000000-0000-0000-0000-000000000003})

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {}
  }
}

Forward alarm to multiple recipients:

GET /alarm?q=ForwardAlarm({instance-id},{recipient-guid-1,recipient-guid-2})

In this form, the second argument is a GUID list. Use it when the same alarm instance should be forwarded to multiple users or groups in one request.

Getting active alarms

Retrieve all currently active alarms in the system. Two endpoints are available:

/activealarms endpoint (Recommended)

Modern endpoint that returns comprehensive alarm data with additional fields.

Get active alarms:

GET /activealarms

Response (JSON with Accept: text/json):

{
  "Rsp": {
    "Status": "Ok",
    "Result": [
      {
        "InstanceID": 42,
        "Guid": "c319de11-3fb9-4c42-b4ee-1745c7287799",
        "TriggerTime": "2025-11-15T11:04:36.000Z",
        "TriggerEntity": "00000000-0000-0000-0000-000000000003",
        "TriggerEvent": 1,
        "TriggerEventSubType": 0,
        "CreationTime": "2025-11-15T11:04:35.000Z",
        "AckTime": null,
        "AckBy": "00000000-0000-0000-0000-000000000000",
        "AckByString": null,
        "AckReason": 28673,
        "ExternalInstanceID": -1,
        "OfflinePeriod": 0,
        "State": 1,
        "InvestigatedBy": "00000000-0000-0000-0000-000000000000",
        "InvestigatedTime": null,
        "HasSourceCondition": false,
        "DynamicContent": "<DynamicContent xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><AttachedEntities xmlns:a=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" /><Context>Server breach</Context><ForwardedRecipients xmlns:a=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" /><Priority>0</Priority><Urls xmlns:a=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" /></DynamicContent>",
        "Priority": 1,
        "Latitude": null,
        "Longitude": null,
        "DynamicContextBy": "00000000-0000-0000-0000-000000000000",
        "DynamicContextByString": null,
        "SourceDynamicContextBy": "00000000-0000-0000-0000-000000000000",
        "SourceDynamicContextByString": null,
        "SourceAckBy": "00000000-0000-0000-0000-000000000000",
        "SourceAckByString": null,
        "ForwardInformation": null
      }
    ]
  }
}

Key fields:

Core alarm information:

  • InstanceID (int) - Unique alarm instance ID
  • Guid (GUID) - Alarm entity GUID
  • TriggerEntity (GUID) - Source entity that triggered the alarm
  • TriggerEvent (int) - Event type that triggered the alarm
  • TriggerEventSubType (int) - Event subtype
  • TriggerTime (DateTime) - When alarm was triggered
  • CreationTime (DateTime) - When alarm instance was created

State and priority:

  • State (byte) - Alarm state (1 = Active, 2 = Acknowledged, etc.)
  • Priority (byte) - Alarm priority (1-255, lower = higher priority)
  • HasSourceCondition (bool) - Whether alarm has a source condition

Acknowledgment information:

  • AckTime (DateTime) - When alarm was acknowledged (null if not acknowledged)
  • AckBy (GUID) - User who acknowledged the alarm
  • AckByString (string) - Username of acknowledging user
  • AckReason (int) - Acknowledgment reason code
  • SourceAckBy (GUID) - Original acknowledging user (for federated alarms)
  • SourceAckByString (string) - Original acknowledging username

Investigation:

  • InvestigatedBy (GUID) - User who investigated the alarm
  • InvestigatedTime (DateTime) - When alarm was investigated

Context and location:

  • DynamicContent (string) - Serialized XML containing the context message and alarm attributes. Parse the <Context> element to extract the plain-text context string. Use GetActiveAlarms() instead if you need the context as a plain string (returned in the DynamicContext field).
  • DynamicContextBy (GUID) - User who set dynamic context
  • DynamicContextByString (string) - Username who set context
  • SourceDynamicContextBy (GUID) - Original context setter (federated)
  • SourceDynamicContextByString (string) - Original context setter username
  • Latitude (double) - Geographic latitude (if available)
  • Longitude (double) - Geographic longitude (if available)

Forwarding information:

  • ForwardInformation (string) - JSON-encoded string containing forwarding details. Parse the string to access ForwardCount and Forwards array containing:
    • ForwardedBy (GUID) - User who forwarded
    • ForwardedByString (string) - Forwarding username
    • ForwardedTo (GUID array) - Recipients
    • ForwardedToString (string array) - Recipient usernames
    • ForwardedTime (DateTime) - When forwarded

Other fields:

  • ExternalInstanceID (int) - External system instance ID
  • OfflinePeriod (int) - Offline period type

GetActiveAlarms() method (Legacy)

Legacy endpoint for backward compatibility. Returns fewer fields than /activealarms.

Get active alarms:

GET /alarm?q=GetActiveAlarms()

Response (JSON with Accept: text/json):

{
  "Rsp": {
    "Status": "Ok",
    "Result": [
      {
        "InstanceID": 42,
        "Alarm": "c319de11-3fb9-4c42-b4ee-1745c7287799",
        "TriggerEntity": "00000000-0000-0000-0000-000000000003",
        "TriggerEvent": 1,
        "TriggerTime": "2025-11-15T11:04:36.000Z",
        "AckedTime": "0001-01-01T00:00:00Z",
        "AckedBy": "00000000-0000-0000-0000-000000000000",
        "CreationTime": "2025-11-15T11:04:35.000Z",
        "OfflinePeriod": 0,
        "AckReason": 28673,
        "ExternalInstanceID": -1,
        "InvestigatedBy": "00000000-0000-0000-0000-000000000000",
        "InvestigatedTime": "0001-01-01T00:00:00Z",
        "State": 1,
        "HasSourceCondition": false,
        "Priority": 1,
        "DynamicContext": "Server breach"
      }
    ]
  }
}

Differences from /activealarms:

  • Uses Alarm instead of Guid
  • Uses AckedTime instead of AckTime
  • Uses AckedBy instead of AckBy
  • Missing fields: TriggerEventSubType, Latitude, Longitude, all *String fields, ForwardInformation

Recommendation: Use /activealarms for new integrations as it provides more comprehensive alarm data.

Editing alarm context

Modify the context message of an existing alarm instance.

Edit alarm context:

GET /alarm?q=EditAlarmContext({instance-id},{alarm-guid},Updated context message)

Parameters:

  • instance-id (int) - Alarm instance ID
  • alarm-guid (GUID) - Alarm entity GUID
  • Context message (string) - New context text

Example:

GET /alarm?q=EditAlarmContext(42,{c319de11-3fb9-4c42-b4ee-1745c7287799},Investigation complete)

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {}
  }
}

Force acknowledging all alarms

Acknowledge all active alarms at once.

Force acknowledge all alarms:

GET /alarm?q=ForceAcknowledgeAllAlarms()

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {}
  }
}

Checking alarm status

Check if a specific alarm is currently active.

Check if alarm is active:

GET /alarm?q=IsActive({alarm-guid})

Parameters:

  • alarm-guid (GUID) - Alarm entity GUID

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {
      "IsActive": true
    }
  }
}

Returns True if alarm has active instances, False otherwise.

Clearing source conditions

Clear acknowledgement source conditions for alarms triggered with acknowledgement condition requirements.

Clear source condition:

GET /alarm?q=ClearSourceCondition({source-entity-guid},{acknowledgement-condition-id})

Parameters:

  • source-entity-guid (GUID) - Source entity GUID
  • acknowledgement-condition-id (int) - Acknowledgement condition ID

Response:

{
  "Rsp": {
    "Status": "Ok",
    "Result": {}
  }
}

Note

Required for alarms triggered with acknowledgement conditions before they can be acknowledged.

Alarm operation examples

Complete alarm workflow:

# 1. Trigger alarm
GET /alarm?q=TriggerAlarm({alarm-guid},{door-guid},DynamicAlarmContent(Door forced open){Priority=150})
# Returns: <alarminstanceid>42</alarminstanceid>

# 2. Forward to security team
GET /alarm?q=ForwardAlarm(42,{security-group-guid})

# 3. Mark as under investigation
GET /alarm?q=InvestigateAlarm(42,{alarm-guid})

# 4. Acknowledge when resolved
GET /alarm?q=AcknowledgeAlarm(42,{alarm-guid},Ack)

Raising system events

Raise a system event

Raise system events:

POST /events/RaiseEvent/{eventType}/{entityId}

Parameters:

  • {eventType} - Event type name (e.g., CameraMotion, AccessGranted)
  • {entityId} - GUID or Logical ID of the source entity

Example:

POST /events/RaiseEvent/CameraMotion/LogicalID(Camera,5)

Response:

{
  "Rsp": {
    "Status": "Ok"
  }
}

Note

Custom event timestamps cannot be specified when raising events.

EventType reference

For a complete list of all available system events with their IDs and descriptions, see the EventType Enumeration in the Web SDK Reference.

Discovering entity events

Get supported events for an entity

To determine which system events an entity can generate:

GET /entity?q=entity={entityId},SupportedEvents

Example response:

{
    "Rsp": {
        "Status": "Ok",
        "Result": {
            "SupportedEvents": [
                "CardholderAccessGranted",
                "CardholderAccessRefused",
                "CardholderInactive",
                "CardholderCredentialExpired",
                "CardholderDuressPinEntered",
                "CardholderDoubleBadgeOn",
                "CardholderDoubleBadgeOff"
            ]
        }
    }
}

Custom events

Custom events are user-defined events that can be created, managed, and raised through the Web SDK. Unlike system events, custom events can be renamed and deleted.

Create a custom event

POST /entity?q=entity=00000000-0000-0000-0000-000000000007,CustomEvents.Add({eventId},{name},{entityType})
  • {eventId}: Unique numeric ID for the custom event
  • {name}: Name of the custom event (URL encode if it contains spaces or special characters)
  • {entityType}: Entity type that can raise this custom event (e.g., Camera, Door, Cardholder)

Important

The eventId must be unique across all custom events. Duplicate names are allowed.

Example (simple name):

POST /entity?q=entity=00000000-0000-0000-0000-000000000007,CustomEvents.Add(12345,TemperatureAlert,Camera)

Example (name with spaces - URL encoded):

POST /entity?q=entity=00000000-0000-0000-0000-000000000007,CustomEvents.Add(12346,Temperature%20Alert%20High,Camera)

Note: "Temperature Alert High" is URL encoded as "Temperature%20Alert%20High"

Delete a custom event

POST /entity?q=entity=00000000-0000-0000-0000-000000000007,CustomEvents-{eventId}

Example:

POST /entity?q=entity=00000000-0000-0000-0000-000000000007,CustomEvents-12345

Retrieve all custom events

GET /entity?q=entity=00000000-0000-0000-0000-000000000007,CustomEvents

Example response:

{
    "Rsp": {
        "Status": "Ok",
        "Result": {
            "CustomEvents": [
                {
                    "Id": 12345,
                    "LocalCustomEvent": true,
                    "Name": "Temperature Alert",
                    "SourceEntityType": "Camera",
                    "Owner": "4e8bb3f7-0d41-4f4c-a430-0b6ee7478cbe"
                }
            ]
        }
    }
}

Get custom events supported by an entity

GET /entity?q=entity={entityId},SupportedCustomEvents

Example response:

{
    "Rsp": {
        "Status": "Ok",
        "Result": {
            "SupportedCustomEvents": [
                {
                    "Id": 12345,
                    "LocalCustomEvent": true,
                    "Name": "Temperature Alert",
                    "SourceEntityType": "Camera",
                    "Owner": "00000000-0000-0000-0000-000000000000"
                }
            ]
        }
    }
}

Raise a custom event

Without message:

POST /events/RaiseCustomEvent/{customEventId}/{entityId}/

Note

When raising a custom event without a message, a trailing slash is required after the entity ID. Without the trailing slash, the server returns HTTP 307 instead of processing the request.

With custom message:

POST /events/RaiseCustomEvent/{customEventId}/{entityId}/{message}

With hidden payload:

To attach hidden metadata that is not visible to operators in the Monitoring task, send a multipart form request with a payload form part:

POST /events/RaiseCustomEvent/{customEventId}/{entityId}/{message}
Content-Type: multipart/form-data; boundary=----FormBoundary

------FormBoundary
Content-Disposition: form-data; name="payload"; filename="payload"

{"orderId": "12345", "customerId": "67890"}
------FormBoundary--

Use the payload form part for machine-readable metadata that should travel with the event but should not appear in the visible Monitoring message.

Parameters:

  • {customEventId} - Custom event ID
  • {entityId} - GUID or Logical ID of the source entity
  • {message} - Visible message displayed in the Monitoring task (URL encode if it contains spaces)

Example:

POST /events/RaiseCustomEvent/12345/LogicalID(Camera,1)/Test%20message

Example with hidden payload using curl:

curl -X POST "https://SERVER:4590/WebSdk/events/RaiseCustomEvent/1000/ENTITY-GUID/Visible%20message" \
  -H "Authorization: Basic CREDENTIALS" \
  -F 'payload={"orderId": "12345"};filename=payload'

Response:

{
  "Rsp": {
    "Status": "Ok"
  }
}

Limitations

  • Custom Event Subscriptions: Subscribing to specific custom events only is not supported
  • Event Timestamps: Custom timestamps cannot be specified when raising events
  • Alarm Filtering: Individual alarm monitoring is not supported; all alarms are sent when monitoring is enabled
  • Custom Event Uniqueness: Custom event IDs must be unique across the system. Duplicate names are allowed.
⚠️ **GitHub.com Fallback** ⚠️