Event Message Format Definition for IP Camera App Development - Imou Open Platform
Event message format definition
The format of the general alarm message of the device is as follows
{
"id":2447736561,//[Long][Not Null] alarm message id, corresponding to the alarmId returned by the "query user alarm information" interface
"appId": "lcdxxxxxxxxx",//[String] developer appid,
"did":"TESTQWERXXXX",//[String][Not Null] device serial number
"cid":0,//[Integer][Not Null] device channel number
"msgType":"videoMotion",//[String][Not Null] device alarm type
"time":1475052555,//[long][Not Null] alarm time
"cname":"TESTQWERXXXX",//[String][Not Null] channel name
"remark":"",//[String][Nullable] Remark
"token":"f2dc8c09eeae4b5bad6abf522c93d825", //[String][Nullable] cloud recording token,
"desc": {//[Null] optional, remarks
}
}
Remarks:
Only the device with the platForm of 4 triggers the alarm message will bring the "token" field
The desc field stores different fields in different message types
msgType=beOpenedDoor when opening the door lock
"desc": {
//[String] the name of the unlock key
"name": "Administrator Fingerprint",
//[String] the unique id of the secret key"keyId": "0",
//[String] unlock key type
"type": "fingerPrint"
}
The format of the device online and offline messages pushed by easy4ip Open Platform is as follows
{
"id": -1,//[int][Not Null] uses the alarm message format, and the alarm id is set to -1
"did":"TESTQWERXXXX",//[String][Not Null] device serial number
"cid":0,//[int][Not Null] device channel number, when cid is -1, it means the device goes online and offline
"msgType":"online",//[String][Not Null] online and offline type (online: online offline: offline)
"time":1475052555,//[long][Not Null] alarm time
"cname":"TESTQWERXXXX"//[String][Not Null] channel name
}
The format of the device gateway accessory message is as follows
{
"msgType":"",//[String][Not Null] Device gateway accessory alarm type
"deviceId":"TESTQWERXXXX",//[String][Not Null] gateway id
"accessoriesId":"TESTQWERXXXX",//[String][Not Null] accessory id
"time":"20201024T120000Z",//[String][Not Null] UTC time when the alarm was generated, in yyyyMMddTHHmmssZ format
"localTime": "[String] the local time of the device where the alarm is generated, in yyyyMMddTHHmmss format",
"channels":"0",//[Integer][Null] optional, accessory alarm, local linkage video channel ID data
"subType":"mute",//[String][Null] optional, alarm subtype
"desc":{//[Null] optional, remarks
}
}
Remarks: When msgType is earlyWraning, earlyWraningEnd, alarmOccurs, alarmEnd:
"desc": {
//[String] leakage current: leakageCurrent, current overload: currentOverload, overtemperature: excessiveTemp, abnormal temperature: tempVariation, smoke alarm: smokeAlarm, gas alarm: gasAlarm, emergency button: urgencyButton
"type":"leakageCurrent"
}
The format of the face detection push message is as follows
{
"appId": "lcdxxxxxxxxx",//[String] developer appid
"msgType": "aiFaceDetect",//[String] Push type
"deviceId": "TESTQWERXXXX",//[String] device id
"channelId":"0", //[String]channel id"
"localTime":"20190912123355", //[String] the local time of the device where the alarm is generated, in yyyyMMddTHHmmss format"
"time":"20190912123355" ,//[String] UTC time when the alarm was generated, in yyyyMMddTHHmmssZ format"
"token":"f2dc8c09eeae4b5bad6abf522c93d825",//[String][Nullable] cloud recording token
"picUrlArray":
[
"Address of the first picture", "Address of the second picture" // Picture address, String type, the first big picture, the second small picture
],//Note: The maximum storage time of image data on the easy4ip Open Platform is one day. After the developer receives the push message, please save it to the developer server as soon as possible
"desc":[
{
"sex":"Man",//[optional][String] gender, Man: male; Woman: female
"age":"24", //[optional][String] age
"race":25, //[optional][int]race
"eye":1, //[optional][int]eye status
"mouth":1, //[optional][int]mouth status
"mask":1, //[Optional][int] Mask status
"beard":0, //[optional][int]beard status
"attractive":0, //[optional][int] charm value
"nation":1, //[optional][int] nation
"feature": //[optional]
[
"Anger", "Laugh" // Facial expression type, String type
]
}]
}
The format of the push message after acquaintance face comparison is as follows
{
"appId": "lcdxxxxxxxxx",//[String] developer appid
"msgType": "aiAFaceCompa",//aiAFaceCompa
"deviceId":"", //[String] device id
"channelId": "",//[String] channel id
"localTime": "",//[String] The local time of the device when the alarm is generated, in yyyyMMddTHHmmss format
"time": "20192512120012",//[String] UTC time when the alarm was generated, in yyyyMMddTHHmmssZ format
"picUrlArray":[
"Address of the first picture", "Address of the second picture" // Picture address, String type, the first big picture, the second small picture
],//Note: The maximum storage time of image data on the easy4ip Open Platform is one day. After the developer receives the push message, please save it to the developer server as soon as possible
"desc":
{
"snapFace":// capture face information
{
"sex":"Man",//[optional][String] gender, Man: male; Woman: female
"age":"23",//[optional][String] age
"feature":[//[optional]
"Anger", "Laugh" // Facial expression type, String type
],
"race":1,//[optional][int]race
"eye":2,//[optional][int]eye status
"mouth":1,//[optional][int]mouth state
"mask":1,//[Optional][int] Mask status
"beard":1,//[optional][int]beard status
"attractive":1,//[optional][int] attractive value
"nation":1//[optional][int] nation
},
"candidates":[// Candidate information
{
"groupId":"13123213213",//[String] Library Id
"personId":"132132132132",//[String]person Id
"similarity":"30"//[optional][String] acquaintance degree, normalized to 0~100
}],
"Passerby": {
"UID": "12312321321",//[Optional][String] Unique identifier for passersby
"GroupID": "12313213",//[Optional][String] ID of passerby library
"GroupName" :"adsd"//[Optional][String] Name of passerby library
}
}
}
The format of the push message after the face comparison of the stranger is as follows
{
"appId": "lcdxxxxxxxxx",//[String] developer appid
"msgType": "aiSFaceCompa",//aiAFaceCompa
"deviceId":"", //[String] device id
"channelId": "",//[String] channel id
"localTime": "",//[String] The local time of the device when the alarm is generated, in yyyyMMddTHHmmss format
"time": "20192512120012",//[String] UTC time when the alarm was generated, in yyyyMMddTHHmmssZ format
"picUrlArray":[
"Address of the first picture", "Address of the second picture" // Picture address, String type, the first big picture, the second small picture
],//Note: The maximum storage time of image data on the easy4ip Open Platform is one day. After the developer receives the push message, please save it to the developer server as soon as possible
"desc":
{
"snapFace":// capture face information
{
"sex":"Man",//[optional][String] gender, Man: male; Woman: female
"age":"23",//[optional][String] age
"feature":[//[optional]
"Anger", "Laugh" // Facial expression type, String type
],
"race":1,//[optional][int]race
"eye":2,//[optional][int]eye status
"mouth":1,//[optional][int]mouth state
"mask":1,//[Optional][int] Mask status
"beard":1,//[optional][int]beard status
"attractive":1,//[optional][int] attractive value
"nation":1,//[optional][int] nation
},
"Passerby": {
"UID": "12312321321",//[Optional][String] Unique identifier for passersby
"GroupID": "12313213",//[Optional][String] ID of passerby library
"GroupName" :"adsd",//[Optional][String] Name of passerby library
}
}
}
The message format of the traffic statistics push is as follows
{
"msgType": "numberstat",//Message type
"appId": "lcdxxxxxxxxx",//[String] developer appid,
"deviceId": "TESTQWERXXXX", //[String] device serial number,
"detail": [
{
"channelId": "12",//[String] channel id,
"action": "1",//[String] The type mark of entry, exit and stay. 0: in, 1: out, 2: stay,
"beginTime": "20190523111256",//[String] record start time, device time, format such as: yyyyMMddTHHmmss,
"beginUtcTime": "20190523111256Z",//[String] start time of recording, UTC time, format such as: yyyyMMddTHHmmssZ,
"endTime": "20190523111256",//[String] the end time of the record, the device time, in the format: yyyyMMddTHHmmss,
"endUtcTime": "20190523111256Z",//[String] the end time of the record, UTC time, format such as: yyyyMMddTHHmmssZ,
"number": 12//[Int] The total number of people detected in this time period
}]
}
The message format of the hot data push is as follows
{
"msgType": "heatmap",//[String] push type,
"channelId": "0",//channel number
"localBeginTime": "20031215T144307",//[String] start time, device time, format such as: yyyyMMddTHHmmss,
"localEndTime": "20031215T144307",//[String] end time, device time, format such as: yyyyMMddTHHmmss,
"utcBeginTime": "20031215T144307Z",//[String] start time, UTC time, format such as: yyyyMMddTHHmmssZ,
"utcEndTime": "20031215T144307Z",//[String] end time, UTC time, format such as: yyyyMMddTHHmmssZ,
"desc": {
"width": "200",
"height": "100",
"heatData": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"min": "1" ,//[String], optional (new field), minimum popularity
"max": "188",//[String], optional (new field), minimum popularity
"average":"156"// [String], optional (new field), minimum popularity
}
}
The format of the device sharing notification message is as follows
{
"appId":"lcdxxxxxxxxx",//[String] developer appid,
"msgType":"deviceShare",//[String] push type,deviceShare,
"msgDeviceId":"TESTQWERXXXX",//[String] device serial number,
"msgChannelId":1,//[Int] device channel number,
"time":123455456546//[Long] Unix timestamp when the sharing event occurred
}
Device binding device notification message format is as follows
{
"appId":"lcdxxxxxxxxx",//[String] developer appid,
"msgType":"bindDevice",//[String] push type,bindDevice,
"msgDeviceId":"TESTQWERXXXX",//[String] device serial number,
"time":123455456546//[Long] Unix timestamp of the binding event
}
Device unbinding device notification message format is as follows
{
"appId":"lcdxxxxxxxxx",//[String] developer appid,
"msgType":"unbindDevice",//[String] push type,unbindDevice,
"msgDeviceId":"TESTQWERXXXX",//[String] device serial number,
"time":123455456546//[Long] Unix timestamp of the unbinding event
}
User transfer device notification message format is as follows
{
"appId":"lcdxxxxxxxxx",//[String] developer appid,
"msgType":"receiver transferDeviceTo",//initiator transferDeviceFrom, receiver transferDeviceTo,
"msgDeviceIds":"TESTQWERXXXX",//[String] device serial number, separated by commas
"time":123455456546//[Long] Unix timestamp of the device transfer event
}
Delete device sharing notification message format is as follows
{
"appId":"lcdxxxxxxxxx",//[String] developer appid,
"msgType":"deviceShareCancel",//[String] push type,deviceShareCancel,
"msgDeviceId":"TESTQWERXXXX",//[String] device serial number,
"msgChannelId":1,//[Int] device channel number,
"time":123455456546//[Long] The Unix timestamp of the delete device sharing event
}
The format of the authorization data change push notification message is as follows
{
"appId":"lcdxxxxxxxxx",//[String] developer appid,
"msgType":"deviceAuthorizationChanged",//[String] push type,deviceAuthorizationChanged,
"time":"20120206030513",//[Long]The Unix timestamp when the device sharing event occurred,
"msgChannelList":[{
"deviceId":"Device serial number",
"channelId":"channel number"
}]
}
After unbinding/transferring the device, the message format to notify the shared party is as follows
{
"appId":"lcdxxxxxxxxx",//[String] developer appid,
"msgType":"deviceDeletedSharedCancel",//Push type, deviceDeletedSharedCancel
"msgDeviceIds":["xxxxxxxxxx","xxxxxxxxxx",...]//[[String] device serial number array]
"time":123455456546//[Long] Unix timestamp of the device transfer event
}
