Queries the intelligent alert events of an IP camera.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | QueryDeviceEvent |
The operation that you want to perform. Set the value to QueryDeviceEvent. |
BeginTime | Long | Yes | 1539507310000 |
The beginning of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds. |
EndTime | Long | Yes | 1539607310000 |
The end of the time range to query. Specify the time in the UNIX timestamp format. Unit: 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 | zLZyi6aOLyOSHa9hsPyD00**** |
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.
|
EventType | Integer | No | 0 |
The type of the alert event.
You can view all alert event types on the Define Feature tab of the Product Details page in the IoT Platform console. For more information, see View alert event types. |
CurrentPage | Integer | No | 1 |
The number of the page to return. Pages start from page 1. |
PageSize | Integer | No | 10 |
The number of entries to return on each page. Valid values: 1 to 50. Default value: 10. |
IotInstanceId | String | No | iot-cn-n6w1y**** |
The ID of the instance. You can view the instance ID on the Overview page in the IoT Platform console. Notice
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.
|
Data | Struct |
The query result. |
|
List | Array of List |
The returned alert events. |
|
EventData | String | null |
The additional information about the alert event. |
EventDesc | String | Motion detection |
The description of the alert event. |
EventId | String | ae6b74f1dc7d****85d32c210185967f_16080****9471 |
The ID of the alert event. |
EventPicId | String | aEtMSm9****ORTFxcGpTbDZ****6eTk0 |
The ID of the image associated with the alert event. |
EventTime | String | 2020-12-15 20:40:49 |
The time when the alert event occurred. |
EventType | Integer | 1 |
The type of the alert event. |
Page | Integer | 1 |
The page number of the returned page. |
PageCount | Integer | 1 |
The total number of pages returned. |
PageSize | Integer | 10 |
The number of entries returned per page. |
Total | Integer | 2 |
The total number of entries returned. |
ErrorMessage | String | request forbidden |
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.
|
Examples
Sample requests
http(s)://linkvisual.cn-shanghai.aliyuncs.com/?Action=QueryDeviceEvent
&BeginTime=1539507310000
&EndTime=1539607310000
&IotId=zLZyi6aOLyOSHa9hsPyD00****
&<Common request parameters>
Sample success responses
XML
format
<QueryDeviceEventResponse>
<RequestId>1FCB5660-020D-40A5-9313-F4F4F493A41F</RequestId>
<Data>
<PageSize>10</PageSize>
<PageCount>1</PageCount>
<Total>2</Total>
<Page>1</Page>
<List>
<EventDesc>Motion detection</EventDesc>
<EventType>1</EventType>
<EventTime>2020-12-15 20:40:49</EventTime>
<EventId>ae6b74f1dc7d40218****85967f_1608****471</EventId>
<EventPicId>aEtMSm9****ORTFxcGpTbDZ****6eTk0</EventPicId>
<EventData>{}</EventData>
</List>
<List>
<EventDesc>Motion detection</EventDesc>
<EventType>1</EventType>
<EventTime>2020-12-15 20:40:29</EventTime>
<EventId>5650d1cdc****8504520e037b2c_16****9466</EventId>
<EventPicId>adsvtMSm9****ORTFkjfdmskDZ****6eTk0</EventPicId>
<EventData>{}</EventData>
</List>
<Code>200</Code>
<Success>true</Success>
</Data>
</QueryDeviceEventResponse>
JSON
format
{
"RequestId": "1FCB5660-020D-40A5-9313-F4F4F493A41F",
"Data": {
"PageSize": 10,
"PageCount": 1,
"Total": 2,
"Page": 1,
"List": [
{
"EventDesc": "Motion detection",
"EventType": 1,
"EventTime": "2020-12-15 20:40:49",
"EventId": "ae6b74f1dc7d****d32c210****7f_1608036049471",
"EventPicId": "aEtMSm9****ORTFxcGpTbDZ****6eTk0",
"EventData": "{}"
},
{
"EventDesc": "Motion detection",
"EventType": 1,
"EventTime": "2020-12-15 20:40:29",
"EventId": "5650d1cdc01f41e****0e037****036029466",
"EventPicId": "adsvtMSm9****ORTFkjfdmskDZ****6eTk0",
"EventData": "{}"
}],
"Code": "200",
"Success": true
}
}
Error codes
For a list of error codes, visit the API Error Center.