Space callback event parameters

Updated at:

You can set a callback URL for a specific space. When an event occurs in that space, a notification is sent to the URL.

Note
  • This document describes the data structure for space event callback parameters. It is not an API reference.

  • When a status is updated, a POST request with a JSON message body is sent to your server.

  • The user server confirms acceptance with a 200 response.

Device status event

Parameter

Type

Example value

Description

Event

String

device_status

The event type. Value:

  • device_status (device status event)

Time

Long

1697738818

The time when the event was sent. This is a UNIX timestamp.

GroupId

String

39478*****06084357

The space ID.

DeviceId

String

5374667*****687846

The device ID.

DeviceStatus

String

on

The device status. Valid values:

  • on (online)

  • off (offline)

  • failed (failed/locked)

  • new (unregistered)

GbId

String

340200000013201*****

The GB ID. This parameter applies only to GB spaces.

Stream status event

Parameter

Type

Example value

Description

Event

String

stream_status

The event type. Value:

  • stream_status (event indicating device status)

Time

Long

1589336385

The time when the event was sent. This is a UNIX timestamp.

GroupId

String

203408*****3329773

The space ID.

DeviceId

String

511448*****3213176

The device ID.

DeviceStatus

String

on

The device status. Valid values:

  • on (online)

  • off (offline)

  • Failed / Locked

  • new (unregistered)

GbId

String

371621029913270*****

The GB ID. This parameter applies only to GB spaces.

StreamId

String

530386*****7373001

The stream ID.

StreamName

String

TestStream

The stream name.

StreamStatus

String

on

The stream status. Valid values:

  • on (online)

  • off (offline)

GB device alarm event

Parameter

Type

Example value

Description

Event

String

device_alarm

The event type. Value:

  • device_alarm (device alarm event)

Time

Long

1697739221

The time when the event was sent. This is a UNIX timestamp.

GroupId

String

311351*****5774159

The space ID.

DeviceId

String

311379*****7326085

The device ID.

DeviceStatus

String

on

The device status. Valid values:

  • on (online)

  • off (offline)

  • failed (failed/locked)

  • new (unregistered)

GbId

String

440300009921700*****

The GB ID. This parameter applies only to GB spaces.

Alarm

String

5

The alarm type. Valid values:

  • 5 (video)

  • 7 (other)

SubAlarm

Int

1

The alarm subtype. Valid values:

  • 1 (manual video)

  • 2 (motion detection)

  • 3 (unattended object detection)

  • 4 (object removal detection)

  • 5 (tripwire detection)

  • 6 (intrusion detection)

  • 7 (wrong-way detection)

  • 8 (loitering detection)

  • 9 (traffic statistics)

  • 10 (density detection)

  • 11 (video anomaly detection)

  • 12 (fast motion)

Priority

String

1

The alert level. Valid values:

  • 1 (level 1)

  • 2 (level 2)

  • 3 (level 3)

  • 4 (level 4)

StartTime

Int

1697739220000

The time of the alarm. This is a UNIX timestamp in milliseconds.

Request example

POST http://<callback_hostname>/<callback_path>
{
    "Event":"device_status",
    "DeviceId":"5374667*****687846",
    "DeviceStatus":"on",
    "Time":1470040811,
    "GBId":"340200000013201*****",
    "GroupId":"3947806*****084357"
}