Eye4Cloud Open Platform Alarm Integration V1.0.2

Version History (Latest: V1.0.2 / 2026-01-12)
Version Update Date Change Description Author
V1.0.2 2026-01-12 Added some alarm types Yan Yonglong
V1.0.1 2025-09-10 Moved the authentication example code to the new "Sign Generation Examples" document
Added the unkonw alarm type
Added event messages for snapshots and recordings
Chen Lubin
V1.0.0 2025-09-09 Created documentation Chen Lubin

1. Scope

This document applies to all devices

2. Integration Notes

2.1 Preparation

2.1.1 Device ID Must Exist on the Eye4Cloud Open Platform

After delivering the device to the customer, make sure the device ID exists on the Eye4Cloud Open Platform. Otherwise, subsequent steps may be affected. Confirm that this step is complete with your sales or business contact. 

2.1.2 Secret: Internal Server-Side Secret

To ensure data authenticity, the Open Platform administrator provides appid and an internal server-side secret for access control and verification. The internal server-side secret must not be disclosed and must be stored on the server.

Never place the secret in frontend HTML, an app, or a mini program. A leaked secret may have serious consequences; reset it promptly or contact an administrator to reset it.

2.1.3 Event Names and ID Identifiers

Event Name Unique Identifier Description
Heartbeat ping Heartbeats are disabled by default on some devices.
Device Online online Device Online
Device Offline offline A result calculated from the heartbeat interval and not necessarily exact。
Fire Alarm fire
Human Detection person
Motion Detection move
Alarm Video alarm_video The video URL is generally sent after recording succeeds to
Snapshot succeeded get_image_success The snapshot download URL is placed in the message url field
Recording Succeeded record_video_success The video download URL is placed in the message url field
Unknown unknow Messages outside the protocols above are treated as unknown.
Smoke Alert smoke_alarm
Low Device Battery low_power_warning
Device Sleep sleep
Device Reset reset
Absence Detection leave_position_on_duty
Electric vehicle detection car_invasion
Create or Update Device device_upsert ["xxxx","ssss","www","33"]

3. Alarms and Events

3.1 Device Report Event Messages

3.1.1、Provide a Callback URL

https://example.com/DEMO_RESOURCE 

3.1.2 HTTP Method and Module Event Request Example

POST

CURL
curl -XPOST -H "Content-Type: application/json; charset=utf-8" "https://example.com/DEMO_RESOURCE" -d '{
    "did": "DEMO_DEVICE_001",
    "e": "person",
    "t": 18902981762,
    "sign": "",
    "eventID": "37dy12di980",
    "url": "https://example.com/DEMO_RESOURCE",
    "nonce": 
}'

3.1.3 Callback Example Field Description

Field Description Description
did Unique Device ID device_id and IMEI both identify the device; provide at least one
e Event alias See the "Event Names and ID Identifiers" table
t Alarm Time Timestamp when the server received the device alarm. Device time may be inaccurate, so this is not the device time.
sign Verification Field The platform obtains a string through an algorithm and compares it with this field. Matching values indicate that the data is reliable.
eventID Event ID
url Resource URL, usually an image or video The URL is generally valid for one hour and should be downloaded to the developer server promptly. Some models do not report images. Test the device before putting it into operation.
Sign Generation Notes:

See "Sign Generation Examples"

Parameters Value Description
DID Pass the Unique Device ID; pass DID When DID is provided, IMEI is not required.
IMEI Device IMEI, or an empty string
vpOpenID Pass the open id mentioned above
timestamp Alarm time; pass t Timestamp when the server received the device alarm. Device time may be inaccurate, so this is not the device time.
nonce Random string, 8-12 characters
data Pass "e=${Event alias}&alarmID=${alarmID}&cover=${cover}" e: use the alarm time 
alarmID: use the alarm ID 
cover: use the image URL; pass an empty string when unavailable
Internal server-side secret Pass the secret mentioned above, which is an internal server-side secret

4. Other APIs

4.1 Get Alarm Snapshot

When an alarm occurs, the image URL is generally sent to the developer server with the event message. Download and save it to your own server within one hour.

4.2 Get Alarm Video

After an alarm occurs, the video is sent to the developer server as soon as server-side recording is complete. Download it and save it to your own server within one hour.