Skip to content

Attachment information upload

When the alarm is triggered and the Device starts to upload the attachment, the server will push the attachment information to the client in real time, mainly including the number of files and other information. When the UI needs to display the upload status, this message can be processed, otherwise it can be ignored

websocket Header field information

Message method: Push

Message type: 8004

Push message definition

fieldtypedesc
hdrobjectHeaders, Table 1 in login :websocket headers
dataobjectAttachment information, definitions View current page Table 1

Table 1: Attachment information

fieldtypedesc
alarmCodestringAlarm ID, which corresponds to the alarmID in the alarm information
deviceNostringDevice number
fileInfoarrayFile information, definitions View current page Table 2

Table 2: File information

fieldtypedesc
totalSizeintegerFile size, bytes
fileNamestringfilename

Example

json
{
	"hdr": {
		"code": 200,
		"message": "",
		"msgType": 8004,
		"reqSN": 1,
		"respSN": 0
	},
	"data": {
        "alarmCode":"15552123545556",
        "deviceNo":"1300000001",
        "fileInfo":[{
            "totalSize":102400,
            "fileName":"test.jpg"
        },{
            "totalSize":102400,
            "fileName":"test1.mp4"
        }]
	}
}
{
	"hdr": {
		"code": 200,
		"message": "",
		"msgType": 8004,
		"reqSN": 1,
		"respSN": 0
	},
	"data": {
        "alarmCode":"15552123545556",
        "deviceNo":"1300000001",
        "fileInfo":[{
            "totalSize":102400,
            "fileName":"test.jpg"
        },{
            "totalSize":102400,
            "fileName":"test1.mp4"
        }]
	}
}

Attachment upload completion notice

When the Device uploads an attachment, the server will push a completion message to the client. If there are multiple attachments, the message includes the corresponding file information for status display. If the UI has no status display requirement, it can be ignored

websocket Header field information

Message method: Push

Message type: 8005

Push message definition

fieldtypedesc
hdrobjectHeaders, Table 1 in login :websocket headers
dataobjectComplete file information, defined View current page Table 3

Table 3: Completed file information

fieldtypedesc
alarmCodestringAlarm ID, which corresponds to the alarmID in the alarm information
deviceNostringDevice number
fileNamestringFile name

Example

json
{
	"hdr": {
		"code": 200,
		"message": "",
		"msgType": 8004,
		"reqSN": 1,
		"respSN": 0
	},
	"data": {
        "alarmCode":"15552123545556",
        "deviceNo":"1300000001",
        "fileInfo":[{
            "totalSize":102400,
            "fileName":"test.jpg"
        },{
            "totalSize":102400,
            "fileName":"test1.mp4"
        }]
	}
}
{
	"hdr": {
		"code": 200,
		"message": "",
		"msgType": 8004,
		"reqSN": 1,
		"respSN": 0
	},
	"data": {
        "alarmCode":"15552123545556",
        "deviceNo":"1300000001",
        "fileInfo":[{
            "totalSize":102400,
            "fileName":"test.jpg"
        },{
            "totalSize":102400,
            "fileName":"test1.mp4"
        }]
	}
}