Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
  • Concepts
    • Sub-accounts and policies
    • OAuth 2.0 authorization
    • Tokens
    • Devices
    • Device capability model
    • Cloud live (HLS) notes
    • Device messages
    • Media security
    • Glossary
    • Cloud live
    • Cloud storage packages
    • Resource pool quota
  • Guides
  • Device capabilities & events
  • API reference
  • SDK and tools
  • Solutions
  • Platform and support
On this page
Callback
Related

Device messages

Device messages

Devices under your app generate motion alarms, online/offline status, and smart events. The Open Platform POSTs those messages to a callback URL on your backend. Your backend can forward them to your own application.

The overseas platform does not provide message-channel pull. Do not integrate with consumer groups or pullMessages.

Callback

Use setMessageCallback to set the callback URL and list the categories you want in callbackFlag, separated by commas.

callbackFlagWhat you receive
alarmDevice alarms
deviceStatusDevice online and offline
numberstatPeople-counting data
faceAnalysisFace analytics
capabilityEventStandard capability events. msgType is the eventId. The callback JSON body includes deviceId and outputData

Legacy alarm and deviceStatus payloads still use did, cid, and a string msgType. Types are in Event message types (legacy msgType table); legacy payload formats are in Event message format (legacy payload copy).

Your callback must return an HTTP 2xx success response (200 is typical). If the platform repeatedly fails to get a valid response, it stops pushing to that URL. Setup steps are in Receive device messages.

Related

  • Receive device messages
  • Push configuration
  • Event message types
  • Event message format
  • Receive alarm messages
  • setMessageCallback
  • getMessageCallback
Cloud live (HLS) notes
Media security