Creates an intelligent alert event-triggered recording plan.

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 CreateEventRecordPlan

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

Name String Yes plan1

The name of the recording plan.

The name must be less than 48 characters in length, and can contain letters, digits, and the following special characters: - _ @ . :

RecordDuration Integer Yes 10

The recording duration, including the prerecording duration. Unit: seconds. Valid values: 10 to 60.

TemplateId String Yes fc82774fa749485bad7d719f9670****

The ID of the time template. You can call the QueryTimeTemplate operation to query the ID of the time template.

EventTypes String No 1

The type of the alert event.

  • To specify all types of alert events, set this parameter to 0.
  • To specify multiple types of alert events, specify the IDs of the types and separate them with commas (,). Example: 10001,10002.
    Note You can specify up to 10 types of alert events in a single request.

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.

PreRecordDuration Integer No 5

The prerecording duration. Unit: seconds. Default value: 0. The maximum prerecording duration is 10 seconds.

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 String fc82774fa749485bad7d719f9670****

The ID of the recording plan.

ErrorMessage String product is not active.

The error message returned if the call failed.

RequestId String a195f615-8c64-4cc6-af57-2f42c6cca15c

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=CreateEventRecordPlan
&Name=plan1
&RecordDuration=10
&TemplateId=fc82774fa749485bad7d719f9670****
&<Common request parameters>

Sample success responses

XML format

<CreateEventRecordPlanResponse>  
  <RequestId>a195f615-8c64-4cc6-af57-2f42c6cca15c</RequestId>
  <Data>fc82774fa749485bad7d719f9670****</Data>
  <Code>200</Code>
  <Success>true</Success>
</CreateEventRecordPlanResponse>

JSON format

{
    "RequestId": "a195f615-8c64-4cc6-af57-2f42c6cca15c",
    "Data": "fc82774fa749485bad7d719f9670****",
    "Code": "200",
    "Success": "true"
}

Error codes

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