Skip to main content
Skip table of contents

How to Create or Trigger an Event

Creating events

In most cases, cameras are generating events themselves, but sometimes it is needed to create an event on the backend. For example, custom events can only be created by the backend.

To create an event, you need to specify the camera, type of event (it must be supported), and the event time. Also, it is possible to add metadata if needed. For example:

CODE
curl -X POST "https://web.skyvr.videoexpertsgroup.com:443/api/v2/storage/events/" 
     -H "accept: application/json" 
     -H "Content-Type: application/json" 
     -H "Authorization: Acc ACCESS_TOKEN" -d "{ \"camid\": 237863, \"name\": \"custom_event\", \"time\": \"2021-09-23T16:30:00\", \"meta\": { \"tag1\": \"value1\" }}"

Response:

CODE
{
  "camid": 237863,
  "id": 33794128,
  "meta": {
    "tag1": "value1"
  },
  "name": "custom_event",
  "time": "2021-09-23T16:30:00"
}

Triggering events

Some types of events can be triggered ("can_be_triggered": true in capabilities) which means that the backend sending the command to the camera and the camera generates the event itself.

To trigger an event, you need to specify the camera, type of event, and the event time. Also, it is possible to add metadata if needed. For example:

CODE
curl -X POST "https://web.skyvr.videoexpertsgroup.com:443/api/v2/cameras/240977/event_processing/events/audio_event/trigger/" 
     -H "accept: application/json" -H "Content-Type: application/json" 
     -H "Authorization: Acc ACCESS_TOKEN" -d "{ \"time\": \"2021-09-23T19:15:00\", \"meta\": { \"tag1\": \"value1\" }}"
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.