Immediately triggers an IP camera to start recording and upload video files to IoT Platform.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | TriggerRecord |
The operation that you want to perform. Set the value to TriggerRecord. |
| RecordDuration | Integer | Yes | 60 |
The recording duration, including the prerecording duration. Unit: seconds. Valid values: 10 to 7200. Note A single video file can be up to 30 minutes in length. If the recording duration is
longer than 30 minutes, the recorded video is automatically split into multiple video
files.
|
| 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 | zLZyi6aOLyOSHa****yD000100 |
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 | 0 |
The type of the stream. Valid values:
|
| PreRecordDuration | Integer | No | 5 |
The prerecording duration. Unit: seconds. Valid values: 0 to 10. Note The prerecording duration can be greater than 0 only when the IP camera has the prerecording
feature. Otherwise, the prerecording duration is 0.
|
| IotInstanceId | String | No | iot-cn-n6w1y5****0t |
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 | String | fc82774fa749485bad7d719f9670**** |
The ID of the video file that is generated after the video recorded by the IP camera is uploaded. |
| 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.
|
Examples
Sample requests
http(s)://linkvisual.cn-shanghai.aliyuncs.com/?Action=TriggerRecord
&IotId=zLZyi6aOLyOSHa****yD000100
&IotInstanceId=iot-cn-n6w1y5****0t
&RecordDuration=60
&<Common request parameters>Sample success responses
XML format
<TriggerRecordResponse>
<RequestId>06DC77A0-4622-42DB-9EE0-25FIOHS82JK1</RequestId>
<Data>fc82774fa749485bad7d719f9670****</Data>
<Code>200</Code>
<Success>true</Success>
</TriggerRecordResponse>JSON format
{
"RequestId": "06DC77A0-4622-42DB-9EE0-25FIOHS82JK1",
"Data": "fc82774fa749485bad7d719f9670****",
"Code": "200",
"Success": true
}Error codes
For a list of error codes, visit the API Error Center.