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.
| callbackFlag | What you receive |
|---|---|
| alarm | Device alarms |
| deviceStatus | Device online and offline |
| numberstat | People-counting data |
| faceAnalysis | Face analytics |
| capabilityEvent | Standard 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.
