# Generic Event (default)

Navigation: Working with Nx Witness > Events Rules > Tracked Events > # Generic Event (default) |

Occurs when the server receives an HTTP request from an external system such as an alarm system, access control device, or monitoring system. This is a default event.

Nx Witness allows third-party systems and devices to send an HTTP string known as a "createEvent" API call. The CreateEvent request must follow the proper format in order to be read by the server, and t he event fields in the rule must match the corresponding fields in the HTTP request to be acted upon. Full server API documentation can be accessed on any installed server from http://<serveripaddress>:<servernetworkport>/static/api.xml. See "Using a Server's Web Interface".

Note: V alues in the event field are case-sensitive, and an empty string functions as a wildcard, where any value is considered a match.

Basic Parameters

Each request contains the following fields:

•Source

•Caption

•Description

•Metadata – Used to pass a device identifier that will specify devices the event is limited to (cameras, I/O modules, etc). To obtain the device identifier:

Open the device context menu and click Device Settings. In the Advanced tab, the device identifier will be displayed as Camera/Device Id. The d evice identifier sho uld be passed in the following format: {"cameraRefs":["<id>"]}. In HTML encoding it will look like this: {%22cameraRefs%22:[%22<id>%22]}.

IMPORTANT: It is necessary to specify a device if the generic event is linked to a notification, and the "Force Acknowledgment" option is required. In this case once the notification is acknowledged, the Bookmark will be created and linked to the specified device. See "Show Notifications" for details.

•Occurs – This is an optional field for the "State". If there is no "State" field in the HTTP request, the event is considered instant. If specified, the event is considered continuous and the rule requires a State=Active (Start) or State=Inactive (Stop) attribute. If a Generic Event containing State=Active is received, the resulting action will continue until the server receives a Generic Event with the same parameters that contains State=Inactive.

Note: If a continuous action such as "device recording" or "repeat sound" is bound to an instant Generic Event (one without a State field), the rule will not work. (See "Configuring Event Rules" for more information about continuous and instant events.)

Example

http://127.0.0.1:7001/api/createEvent?source=%22 Door%22&caption=%22 Knock%20 Knock%22&description=%22 Visitor!%22&metadata={%22cameraRefs%22:[%22066fbf9c-2e11-a501-6e15-dfb0fb97c7cb%22]} This HTTP request:

•Sends data to a server at IP Address 127.0.0.1 and Port 7001,

•Source –"Door"

•Caption – "Knock Knock"

•Description – "Visitor!"

•State – not used, so instant

•Device Identifier – 066fbf9c-2e11-a501-6e15-dfb0fb97c7cb.

Remember, fields in the Generic Event must match the corresponding HTTP request and are case-sensitive. For instance, for an event configured as Source "foo", Caption "bar", and Description "" (empty):

An HTTP request with the following data WILL trigger a Generic Event: | An HTTP request with the following data will NOT trigger Generic Event:
Source – "foo12345" (contains "foo") | Source – "Foo12345" (contains "Foo" instead of "foo")
Caption – "bartender" (contains "bar") | Caption – "batender" (does not contain "bar")
Description – (empty string means all values match) | Description – "Lorem ipsum dolor sit amet" (empty string means all values match).

Advanced Parameters

Event Scheduling

Why Event may work incorrectly

HTTP request is not correctly written. Refer to the server API.

Request is filtered out. Try clearing all fields (Source, Caption, Description) and trigger the HTTP request again.

HTTP request is bound to a continuous type of action but does not contain the "State" field.

A device is not specified yet the event is linked to a notification and the "Force Acknowledgment" option is set.

Global notification for this event is disabled.