Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
curl -X GET "https://web.skyvr.videoexpertsgroupvxgdemo.vxgdemo.cloud-vms.com:443/api/v2/cameras/237863/event_processing/events/" 
     -H "accept: application/json" 
     -H "Authorization: Acc ACCESS_TOKEN"

...

Code Block
{
  "meta": {
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null,
    "total_count": 3
  },
  "objects": [
    {
      "caps": {
        "can_be_triggered": false,
        "can_record": true,
        "can_snapshot": true,
        "is_periodic": false
      },
      "generate_images": false,
      "name": "motion",
      "notify": true,
      "receive": true,
      "record": true,
      "snapshot": true
    },
    {
      "caps": {
        "can_be_triggered": false,
        "can_record": false,
        "can_snapshot": false,
        "is_periodic": false
      },
      "generate_images": false,
      "name": "net",
      "notify": true,
      "receive": true
    },
    {
      "caps": {
        "can_be_triggered": false,
        "can_record": false,
        "can_snapshot": true,
        "is_periodic": true
      },
      "generate_images": false,
      "name": "snapshot",
      "notify": true,
      "period": 0,
      "receive": false,
      "snapshot": true
    }
  ]
}

Adding new types of events

It is possible to add new custom types of events using POST/cameras/{CAMID}/event_processing/events/ request.

...

Code Block
curl -X POST "https://web.vxgdemo.skyvrvxgdemo.videoexpertsgroupcloud-vms.com:443/api/v2/cameras/237863/event_processing/events/" 
     -H "accept: application/json" 
     -H "Content-Type: application/json" 
     -H "Authorization: Acc ACCESS_TOKEN" -d "{ \"name\": \"custom_event\", \"notify\": true}"

...

Code Block
{
  "caps": {
    "can_be_triggered": false,
    "can_record": false,
    "can_snapshot": false,
    "is_periodic": false
  },
  "custom": true,
  "name": "custom_event",
  "notify": true,
  "receive": false
}

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.

...

Code Block
curl -X POST "https://web.vxgdemo.skyvrvxgdemo.videoexpertsgroupcloud-vms.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\" }}"

...

Code Block
{
  "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.

...

Code Block
curl -X POST "https://web.vxgdemo.skyvrvxgdemo.videoexpertsgroupcloud-vms.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\" }}"