查询录像列表
最近更新时间:2026-03-19 18:16:28
天翼云智能视图服务API
1.查询录像列表
接口功能介绍
本接口用于查询设备录制于云端的录像文件列表,PlayUrl可用于点播该文件。
接口约束
无
URI
GET /devices/{DeviceId}/records
路径参数
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|---|
| DeviceId | 是 | String | 设备ID。 | 719340484461969408 |
Query参数
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|---|
| OutNetwork | 否 | String | 播放网络类型,默认internet。取值:internet:互联网;vpn:视频专网。 | internet | |
| RecordSource | 否 | String | 录像来源。取值:cloud:默认云端;local:设备侧录像(仅国标设备支持)。 | cloud | |
| RecordType | 是 | Integer | 根据录制类型查询,取值:-1:所有录制类型;1:全天录制(按需计费);2:循环定时录制(按需计费);3:指定时间录制(按需计费);5:手动录制(按需计费);6:全天录制(资源包计费)。 | 1 | |
| StartTime | 是 | String | 根据开始时间查询,小于结束时间,格式:yyyy-mm-dd HH:MM:SS。 | 2023-05-06 00:00:00 | |
| EndTime | 是 | String | 根据结束时间查询,大于开始时间,格式:yyyy-mm-dd HH:MM:SS。 | 2023-05-07 00:00:00 | |
| SortBy | 否 | String | 选择按一个字段排序。取值:StartTime:开始时间。 | StartTime | |
| SortDirection | 否 | String | 排序方式,默认升序。取值:asc(升序),desc(降序)。 | asc | |
| PageNum | 否 | Integer | 第几个分页,默认为1。该字段仅在查询云端录像时有效。 | 1 | |
| PageSize | 否 | Integer | 分页大小,默认为20,取值范围为1~1000。该字段仅在查询云端录像时有效。 | 50 |
请求参数
请求头header参数
| 参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|---|
| Authorization | 是 | String | 认证信息。 | CT-HMAC-SHA256 Credential=FQ01GA2RR9IJFM1PWIPR/2023-07-18/vss, SignedHeaders=content-type;host;timestamp, Signature=c6e72dffcfb2d25d276e119781e1deb6656d966702191b2bd862d1691e39394f | |
| Content-Type | 是 | String | 互联网媒体类型。 | application/json;charset=utf-8 | |
| Host | 是 | String | 主机。 | vssapi.ctyun.cn | |
| Version | 是 | String | 版本。 | 2021-11-25 | |
| Timestamp | 是 | String | 时间戳。 | 1689643309 |
请求体body参数
无
响应参数
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| statusCode | Integer | 响应状态码。 | 200 | |
| error | String | 错误码,执行成功时,不返回该字段。 | VSS_0001 | |
| message | String | 响应信息。 | 请求成功 | |
| requestId | String | 请求ID。 | 362d4e78556b47129182d0881fade86b | |
| returnObj | Object | 响应数据,执行失败时,不返回该字段。 | returnObj |
表 returnObj
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| DeviceId | String | 设备ID。 | 719340484461969408 | |
| Records | Array of Objects | 录制文件列表。 | Record | |
| PageNum | Integer | 第几个分页。 | 1 | |
| PageSize | Integer | 分页大小。 | 10 | |
| TotalPage | Integer | 分页总数。 | 1 | |
| TotalNum | Integer | 录制文件总数。 | 10 | |
| RequestId | String | 请求ID。 | b537b9e84f8c4adfb46bfd95df26d14b |
表 Record
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| RecordId | String | 录制文件Id,该录制文件的唯一性标识。 | 725052043643404288 | |
| FileFormat | String | 录制文件格式。取值:m3u8,hls,mp4,ps。 | hls | |
| FileDuration | Integer | 录制文件时长,单位秒。 | 1812 | |
| FileSize | Integer | 录制文件大小,单位字节。 | 39125432 | |
| CoverUrl | String | 封面Url。 | http://example.ctyun.cn/example | |
| StartTime | String | 录制文件开始时间。 | 2023-05-06 08:42:49 | |
| EndTime | String | 录制文件结束时间。 | 2023-05-06 09:13:01 | |
| Audio | Object | 音频属性信息。 | Audio | |
| Video | Object | 视频属性信息。 | Video | |
| PlayUrl | Object | 录制文件点播Url。 | PlayUrl |
表 Audio
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| Codec | String | 编码格式,取值:g711a,aac,opus,mp3。 | aac |
表 Video
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| Codec | String | 编码格式,取值:h264,h265。 | h265 |
表 PlayUrl
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| HlsUrl | String | hls播放url。FileFormat值为hls时,该字段有效。 | http://example.ctyun.cn/example | |
| PsUrl | String | ps播放url。FileFormat值为ps时,该字段有效。 | http://example.ctyun.cn/example |
请求示例
请求url
GET '/devices/719340484461969408/records?EndTime=2023-05-06+10%3A00%3A00&RecordType=-1&StartTime=2023-05-06+08%3A00%3A00'
请求头header
{
"Authorization": "CT-HMAC-SHA256 Credential=FVAQ9J9SQXS3P37SXDPT/2023-05-06/vss, SignedHeaders=content-type;host;timestamp, Signature=b30e6014ba6f769711780fdc912d4783167c4c1a1b87803b081e2ec8478eeb8e",
"Content-Type": "application/json;charset=utf-8",
"Host": "vssapi.ctyun.cn",
"Version": "2021-11-25",
"Timestamp": "1683354940"
}
请求体body
无
响应示例
{
"statusCode": 200,
"message": "请求成功",
"requestId": "b537b9e84f8c4adfb46bfd95df26d14b",
"returnObj": {
"DeviceId": "719340484461969408",
"PageNum": 1,
"PageSize": 5,
"TotalPage": 5,
"TotalNum": 25,
"Records": [
{
"RecordId": "725052043643404288",
"FileFormat": "hls",
"Audio": {
"Codec": "aac"
},
"Video": {
"Codec": "h265"
},
"PlayUrl": {
"HlsUrl": "http://example.ctyun.cn/example",
"PsUrl": ""
},
"StartTime": "2023-05-06 08:42:49",
"EndTime": "2023-05-06 09:13:01",
"FileDuration": "1812",
"CoverUrl": "http://example.ctyun.cn/example",
"FileSize": "39125432"
},
{
"RecordId": "725059053030031360",
"FileFormat": "hls",
"Audio": {
"Codec": ""
},
"Video": {
"Codec": "h265"
},
"PlayUrl": {
"HlsUrl": "http://example.ctyun.cn/example",
"PsUrl": ""
},
"StartTime": "2023-05-06 09:13:02",
"EndTime": "2023-05-06 09:26:38",
"FileDuration": "816",
"CoverUrl": "http://example.ctyun.cn/example",
"FileSize": "17653764"
},
{
"RecordId": "725059499706630144",
"FileFormat": "hls",
"Audio": {
"Codec": ""
},
"Video": {
"Codec": "h265"
},
"PlayUrl": {
"HlsUrl": "http://example.ctyun.cn/example",
"PsUrl": ""
},
"StartTime": "2023-05-06 09:27:05",
"EndTime": "2023-05-06 09:27:30",
"FileDuration": "25",
"CoverUrl": "http://example.ctyun.cn/example",
"FileSize": "529220"
},
{
"RecordId": "725062145406484480",
"FileFormat": "hls",
"Audio": {
"Codec": ""
},
"Video": {
"Codec": "h265"
},
"PlayUrl": {
"HlsUrl": "http://example.ctyun.cn/example",
"PsUrl": ""
},
"StartTime": "2023-05-06 09:31:32",
"EndTime": "2023-05-06 09:32:36",
"FileDuration": "64",
"CoverUrl": "http://example.ctyun.cn/example",
"FileSize": "1373528"
},
{
"RecordId": "725064722386862080",
"FileFormat": "hls",
"Audio": {
"Codec": ""
},
"Video": {
"Codec": "h265"
},
"PlayUrl": {
"HlsUrl": "http://example.ctyun.cn/example",
"PsUrl": ""
},
"StartTime": "2023-05-06 09:36:32",
"EndTime": "2023-05-06 09:37:36",
"FileDuration": "64",
"CoverUrl": "http://example.ctyun.cn/example",
"FileSize": "1366760"
}
],
"RequestId": "b537b9e84f8c4adfb46bfd95df26d14b",
"RecordType": 0
}
}
状态码
请参考状态码说明。
错误码
请参考错误码说明。
本页目录: