获取相册文件列表
1.接口描述
接口说明:获取相册文件列表,包括录制视频和截屏图片文件
请求方式:
- 固件版本 V2.6.0 及以上:POST [ip]/mwapi/V2.0/album/get-album-files-list
- 固件版本 V2.5.0 及以下:POST [ip]/mwapi/get-album-files-list
2.输入参数
参数名称 |
必选 |
类型 |
描述 |
type |
是 |
Int |
资源类型 0:所有文件 1:截屏图片 2:录制视频 |
3.输出参数
参数名称 |
类型 |
描述 |
result |
Int |
状态码 |
message |
String |
状态描述 |
info |
InfoData |
Info 对象 |
参数名称 |
类型 |
描述 |
items |
Array of MediaData |
媒体数据数组 |
pageIndex |
Int |
页码 |
totalCount |
Int |
媒体数据总数 |
参数名称 |
类型 |
描述 |
id |
Int |
文件ID |
type |
Int |
文件类型。1:截屏图片 2:录制视频 |
name |
String |
资源名称 |
md5 |
String |
文件md5值 |
filePath |
String |
文件相对路径,可通过http访问http://设备IP/相对路径 |
thumbPath |
String |
缩略图相对路径,可通过http访问http://设备IP/相对路径 |
createTime |
Int |
文件创建时间,相对1970-01-01时间戳 |
duration |
Int |
文件持续时间。仅视频有效,单位毫秒 |
size |
Int |
文件大小,单位 Byte |
4.示例
获取截屏文件列表
输入示例
{
"type":1
}
输出示例
{
"info": {
"items": [
{
"createTime": 1640055676,
"duration": 0,
"filePath": "album/2a83adf5-3e0d-4ad0-9af5-81d8fc0fea18.jpeg",
"id": 2,
"md5": "md5",
"name": "2021.12.21 11:01AM",
"size": 502784,
"thumbPath": "album/2a83adf5-3e0d-4ad0-9af5-81d8fc0fea18.thumb.jpeg",
"type": 1
},
{
"createTime": 1640055673,
"duration": 1849,
"filePath": "album/16241d75-12ea-4344-bf7f-bf683e9b850e.mp4",
"id": 1,
"md5": "md5",
"name": "2021.12.21 11:01AM",
"size": 1487872,
"thumbPath": "album/16241d75-12ea-4344-bf7f-bf683e9b850e.thumb.jpeg",
"type": 2
}
],
"pageIndex": 0,
"totalCount": 2
},
"message": "success",
"result": 0
}
5.错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
错误码 |
定义 |
说明 |
7 |
MW_STATUS_INVALID_ARG |
参数缺失 |