Get attachment info
Active safety currently mainly refers to the driving behavior (DMS), Advanced assisted driving (ADAS), blind area monitoring (BSD) these three categories, when the terminal triggers the active safety alarm, upload the attachment to the server
For the alarm reported in real time, the interface for obtaining attachment information cannot be called immediately, because the attachment may not be uploaded yet. During the upload process, the server will push the upload status through websocket, such as: the total number of the current alarm uploaded attachments and the status information of the attachments that have been uploaded. See the specific message definition in websocket pushAttachment upload status information
For the historical alarm, you can directly call the interface to obtain attachment information, attachment upload is generally within 10 seconds can be completed, affected by the network status
API info
Url: /web_api/v1/media/get_attachment_info
Method: GET
Content-Type:x-www-form-urlencoded
Request parameter
field | type | required | desc |
---|---|---|---|
alarmID | string | Yes | Alarm ID, which corresponds to the alarmID in the alarm information |
Response Data (type:array(object))
field | type | desc |
---|---|---|
totalSize | integer | File size, in bytes |
fileName | string | filename |
fileUrl | string | Access to file urls that can be opened directly in the browser without a Token |
Example
Request example
http://localhost:8080/web_api/v1/media/get_attachment_info?alarmID=123456
http://localhost:8080/web_api/v1/media/get_attachment_info?alarmID=123456
Response example
{
"hdr": {
"code": 200,
"message": "success"
},
"data": [{
"totalSize": 102400, //100K
"fileName": "test.jpg",
"fileUrl": "http://localhost:8080/test.jpg"
},{
"totalSize": 102400, //100K
"fileName": "test1.mp4",
"fileUrl": "http://localhost:8080/test1.mp4"
}]
}
{
"hdr": {
"code": 200,
"message": "success"
},
"data": [{
"totalSize": 102400, //100K
"fileName": "test.jpg",
"fileUrl": "http://localhost:8080/test.jpg"
},{
"totalSize": 102400, //100K
"fileName": "test1.mp4",
"fileUrl": "http://localhost:8080/test1.mp4"
}]
}