Queries videos in IoT Platform.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes QueryRecord

The operation that you want to perform. Set the value to QueryRecord.

BeginTime Integer Yes 1508200012

The beginning of the time range to query. The value is a 10-digit timestamp in milliseconds.

EndTime Integer Yes 1582420940

The end of the time range to query. The value is a 10-digit timestamp in milliseconds.

ProductKey String No a1BwAGV****

The ProductKey of the product to which the IP camera belongs.

You can view the information about all products within the current account on the Products page of the IoT Platform console or by calling the QueryProductList operation.

Notice If you specify this parameter, you must also specify the DeviceName parameter.
DeviceName String No camera1

The DeviceName of the IP camera.

You can view the DeviceName of the IP camera on the Devices page of the IoT Platform console.

Notice If you specify this parameter, you must also specify the ProductKey parameter.
IotId String No C47T6xwp6ms4bNlkHRWCg4****

The ID of the IP camera. IoT Platform allocates an ID to each IP camera to uniquely identify the IP camera. You can call the QueryDeviceDetail operation of IoT Platform to query the ID of the IP camera.

Notice If you specify this parameter, you do not need to specify the ProductKey or DeviceName parameter. The IotId parameter specifies a GUID of the IP camera, which corresponds to a combination of the ProductKey and DeviceName parameters. If you specify both the IotId parameter and the combination of the ProductKey and DeviceName parameters, the IotId parameter takes precedence.
StreamType Integer No 1

The type of the stream. Valid values:

  • 0: major stream. This is the default value.
  • 1: minor stream.
RecordType Integer No 1

The type of the video. Valid values:

  • 0: video that is captured in continuous recording.
  • 1: video that is captured in intelligent alert event-triggered recording.
  • 2: video that is captured in manually triggered recording. This is the default value.

If this parameter is left empty, all video types are queried.

CurrentPage Integer No 1

The number of the page to return. Pages start from page 1. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page. Default value: 10. A maximum of 50 entries can be returned on each page.

NeedSnapshot Boolean No true

Specifies whether to return thumbnails.

  • true: Thumbnails are returned.
  • false Thumbnails are not returned. This is the default value.
IotInstanceId String No iot-060a****

The ID of the instance. You can view the instance ID on the Overview page in the IoT Platform console.

Notice
  • If your instance has an ID, you must configure this parameter. If you do not set this parameter, the call fails.
  • If your instance has no Overview page or ID, you do not need to set this parameter.

For more information, see Overview.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this operation. For more information, see Common request parameters.

Response parameters

Parameter Type Example Description
Code String 200

The response code.

  • 200: The call was successful.
  • Other codes: The call failed. For more information about error codes, see Error codes.
Data Struct

The query result.

List Array of List

The returned videos.

BeginTime String 2018-09-10 00:00:00

The time when the video recording started.

EndTime String 2018-09-10 00:00:30

The time when the video recording ended.

FileName String file1

The name of the video file.

FileSize Integer 204800

The size of the video file. Unit: bytes.

RecordType Integer 1

The type of the video. Valid values:

  • 0: video that is captured in continuous recording.
  • 1: video that is captured in intelligent alert event-triggered recording.
  • 2: video that is captured in manually triggered recording.
SnapshotUrl String https://lin****/****2Cq_90

The URL of the thumbnail.

StreamType Integer 1

The type of the stream. Valid values:

  • 0: major stream.
  • 1: minor stream.
VideoFrameNumber Integer 1352

The number of frames in the video.

Page Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

ErrorMessage String tenant auth error.

The error message returned if the call failed.

RequestId String 06DC77A0-4622-42DB-9EE0-25FIOHS82JK1

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

  • true: The call was successful.
  • false: The call failed.

Examples

Sample requests

http(s)://linkvisual.cn-shanghai.aliyuncs.com/?Action=QueryRecord
&BeginTime=1508200012
&EndTime=1582420940
&IotId=C47T6xwp6ms4bNlkHRWCg4****
&RecordType=3
&CurrentPage=1
&PageSize=10
&NeedSnapshot=true
&IotInstanceId=iot-060a****
&<Common request parameters>

Sample success responses

XML format

<QueryRecordResponse>
  <RequestId>06DC77A0-4622-42DB-9EE0-25FIOHS82JK1</RequestId>
  <Data>
        <PageSize>10</PageSize>
        <Page>1</Page>
        <List>
              <StreamType>1</StreamType>
              <VideoFrameNumber>1352</VideoFrameNumber>
              <RecordType>1</RecordType>
              <EndTime>2018-09-10 00:00:30</EndTime>
              <SnapshotUrl>https://lin****/****2Cq_90</SnapshotUrl>
              <FileName>file1</FileName>
              <BeginTime>2018-09-10 00:00:00</BeginTime>
              <FileSize>204800</FileSize>
        </List>
  </Data>
  <Code>200</Code>
  <Success>true</Success>
</QueryRecordResponse>

JSON format

{
    "RequestId": "06DC77A0-4622-42DB-9EE0-25FIOHS82JK1",
    "Data": {
        "PageSize": 10,
        "Page": 1,
        "List": [
            {
                "StreamType": 1,
                "VideoFrameNumber": 1352,
                "RecordType": 1,
                "EndTime": "2018-09-10 00:00:30",
                "SnapshotUrl": "https://lin****/****2Cq_90",
                "FileName": "file1",
                "BeginTime": "2018-09-10 00:00:00",
                "FileSize": 204800
            }
        ]
    },
    "Code": "200",
    "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.