Creates a time template.

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 CreateTimeTemplate

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

AllDay Integer Yes 0

Specifies whether to continuously record videos 24/7.

  • 1: The system continuously records videos 24/7.
  • 0: does not continuously record videos 24/7. If you set this parameter to 0, you must configure the TimeSections.N.DayOfWeek, TimeSections.N.Begin, and TimeSections.N.End parameters.
Name String Yes example

The name of the time template.

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

TimeSections.N.DayOfWeek Integer No. 0

The day of each week for video recording. Valid values: 0 to 6, indicating Sunday to Saturday.

TimeSections.N.Begin Integer No. 20000

The time when video recording starts every day. Valid values: 0 to 86399. Unit: seconds.

TimeSections.N.End Integer No. 60000

The time when video recording ends every day. Valid values: 1 to 86399. Unit: seconds.

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

Examples

Example 1: Continuously record videos during a specific period of time every week. For example, continuously record videos from 08:00 on Saturday to 17:00 on Sunday every week.


    http(s)://linkvisual.cn-shanghai.aliyuncs.com/?Action=CreateTimeTemplate
    &Name=example
    &AllDay=0
    &TimeSections=[{"DayOfWeek":6, "Begin":28800, "End":86399}, {"DayOfWeek":0,"Begin":0, "End":61200}]
    &<Common request parameters>
    

Example 2: Continuously record videos 24/7.


    http(s)://linkvisual.cn-shanghai.aliyuncs.com/?Action=CreateTimeTemplate
    &Name=example
    &AllDay=1
    &<Common request parameters>
    

Example 3: Record videos during specified periods of time on a specific day of each week. For example, record videos from 08:00 to 11:00 and 13:00 to 18:00 every Monday.


    http(s)://linkvisual.cn-shanghai.aliyuncs.com/?Action=CreateTimeTemplate
    &Name=example
    &AllDay=0
    &TimeSections=[{"DayOfWeek":1, "Begin":28800, "End":39600}, {"DayOfWeek":1, "Begin":46800, "End":64800}]
    &<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 38c94f874f2e4ce3b4b6da36****5213

The ID of the time template.

ErrorMessage String tenant auth error

The error message returned if the call fails.

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=CreateTimeTemplate
&Name=example
&AllDay=0
&TimeSections=[{“DayOfWeek”:0, “Begin”:20000, “End”:60000}, {“DayOfWeek”:3, “Begin”:30000, “End”:70000},{“DayOfWeek”:3, “Begin”:80000, “End”:86000}]
&<Common request parameters>

Sample success responses

XML format

<CreateTimeTemplateResponse>
  <RequestId>AD8BAA6B-1197-48DC-A42B-F5986ADF9BFE</RequestId>
  <Data>38c94f874f2e4ce3b4b6da3****65213</Data>
  <Code>200</Code>
  <Success>true</Success>
</CreateTimeTemplateResponse>

JSON format

{
  "RequestId": "AD8BAA6B-1197-48DC-A42B-F5986ADF9BFE",
  "Data": "38c94f874f2e4ce3b4b6da36****5213",
  "Code": "200",
  "Success": true
}

Error codes

For a list of error codes, see Service error codes.