You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Home > DW Product Help > Software Applications > DW Spectrum > API > DW Spectrum - Enable or Disable Analytic Rules via Server API
DW Spectrum - Enable or Disable Analytic Rules via Server API
print icon

Enable/Disable Analytic Rules Using Server API

-----------------------------------

Affected Roles: Administrator, Power Users

Related Digital Watchdog VMS Apps: DW Spectrum

Last Edit: June 19, 2025

-----------------------------------

 

Analytic Event Rules

Sometimes users want to enable or disable an Analytic Event Rule via a camera input signal, I/O module, or soft trigger. For example, users may want to have an Analytics Event Rule be active only when an alarm is armed, soft trigger is pressed, or input from a camera is received. This can be accomplished through an API request.

If you already have the desired Analytics Event Rule set up, skip ahead to the next section.

 

Create Event Rules to Enable or Disable an Analytics Event

  1. Visit https://<server_ip>:<server_port>/ec2/getEventRules with a web browser.
  2. Find and copy the parameters of the Event Rule you would like to control.
    For example:

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "eventType": "undefinedEvent",
  "eventResourceIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "eventCondition": "string",
  "eventState": "inactive",
  "actionType": "undefinedAction",
  "actionResourceIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "actionParams": "string",
  "aggregationPeriod": 0,
  "disabled": false,
  "comment": "string",
  "schedule": "string",
  "system": true
}

 

  1. Create an Event Rule with your preferred event trigger (soft trigger, Input Signal on Camera, or I/O module).
  2. In the Action section, configure the following:
    1. Do: select “Do HTTP Request”.
    2. HTTP URL: enter “https://<server_ip>:<port>/ec2/saveEventRule”.
    3. HTTP Content: enter the body of the API POST request (the parameters from Step 2). Change the value of the “disabled” parameters to false.

Example:

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "eventType": "undefinedEvent",
  "eventResourceIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "eventCondition": "string",
  "eventState": "inactive",
  "actionType": "undefinedAction",
  "actionResourceIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "actionParams": "string",
  "aggregationPeriod": 0,
  "disabled": false,
  "comment": "string",
  "schedule": "string",
  "system": true
}

 

  1. Open the Content type dropdown and select “application/json”.
  2. Open the Request type dropdown and select “POST”.
  3. Enter the login and password then apply the changes.
  4. Create an Event Rule to disable Event Rule A. Set it to be triggered via Soft Trigger, Input Signal on Camera, or I/O module.
  5. Repeat Step 4. Change the value of the “disabled” parameter in the HTTP Content field to true.

Example:

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "eventType": "undefinedEvent",
  "eventResourceIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "eventCondition": "string",
  "eventState": "inactive",
  "actionType": "undefinedAction",
  "actionResourceIds": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "actionParams": "string",
  "aggregationPeriod": 0,
  "disabled":
true,
  "comment": "string",
  "schedule": "string",
  "system": true
}

 

  1. Repeat Steps 5-7 and apply changes.

 

 

 

______________________________________________________________________________

For More Information or Technical Support

DW Technical Support: https://www.digital-watchdog.com/contact-tech-support/

DW Sales: [email protected] | www.digital-watchdog.com

Rev: 06/25                              Copyright © DW. All rights reserved. Specifications and pricing subject to change without notice.                            

scroll to top icon