All Products
Search
Document Center

Intelligent Media Services:AddTemplate

Last Updated:Dec 16, 2024

Creates a template.

Operation description

  • For more information about how to use a regular template, see Create and use a regular template.
  • For more information about how to use an advanced template, see Create and use advanced templates.
  • After an advanced template is created, it enters the Processing state. In this case, the template is unavailable. The template can be used only when it is in the Available state. The time required for template processing varies based on the size of the template file. Generally, it ranges from 10 seconds to 5 minutes.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ice:AddTemplate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringNo

The name of the custom template.

TypestringNo

The template type. Valid values:

  • Timeline: a regular template created based on the timeline of a video editing project, in which multiple materials are arranged in sequence across multiple layers. It can be used to convert text and images into videos, create photo albums, add opening and closing parts, and apply the default watermark.
  • VETemplate: an advanced template created using effects of Adobe After Effects (AE). It can be used to produce complex animations and advanced media effects.
Timeline
ConfigstringNo
  • The template configurations. The Config object of a regular template is encapsulated based on the Timeline object of an online editing project. The Config object of a custom template provides more flexible features. If you have special requirements, we recommend that you understand the structure of a Config object and configure a custom template. For more information, see Config object of a regular template.
  • For more information about Config object examples, see Basic template configurations.
CoverUrlstringNo

The URL of the template thumbnail.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/cover.jpg
PreviewMediastringNo

The ID of the template preview video.

****01bf24bf41c78b2754cb3187****
StatusstringNo

The template state. Valid values:

  • Available: The template is available.
  • Created: The template is created but not ready for use.
  • Uploading: The video is being uploaded.
  • Processing: The advanced template is being processed.
  • UploadFailed: Failed to upload the video.
  • ProcessFailed: Failed to process the advanced template.
Available
SourcestringNo

The source from which the template is created. Valid values:

  • OpenAPI
  • AliyunConsole
  • WebSDK
OpenAPI
RelatedMediaidsstringNo

The IDs of the materials associated with the template for use by the regular template editor.

{"video":["1805a0c6ca544fb395a06ca683619655"]}

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

****2876-6263-4B75-8F2C-CD0F7FCF****
Templateobject

The template information.

TemplateIdstring

The template ID.

****01bf24bf41c78b2754cb3187****
Namestring

The template name.

Typestring

The template type.

Valid values:

  • Timeline: regular template.
  • VETemplate: advanced template.
Timeline
Configstring

The template configurations.

CoverUrlstring

The URL of the template thumbnail.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/cover.jpg
PreviewMediastring

The ID of the preview video.

****01bf24bf41c78b2754cb3187****
Statusstring

The template state.

Valid values:

  • UploadFailed: Failed to upload the video.
  • ProcessFailed: Failed to process the advanced template.
  • Available: The template is available.
  • Uploading: The video is being uploaded.
  • Created: The template is created but not ready for use.
  • Processing: The advanced template is being processed.
Available
CreateSourcestring

The source from which the template was created.

Valid values:

  • AliyunConsole
  • WebSDK
  • OpenAPI
OpenAPI
ModifiedSourcestring

The source from which the template was modified.

Valid values:

  • AliyunConsole
  • WebSDK
  • OpenAPI
OpenAPI

Examples

Sample success responses

JSONformat

{
  "RequestId": "****2876-6263-4B75-8F2C-CD0F7FCF****",
  "Template": {
    "TemplateId": "****01bf24bf41c78b2754cb3187****",
    "Name": "",
    "Type": "Timeline",
    "Config": "",
    "CoverUrl": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/cover.jpg",
    "PreviewMedia": "****01bf24bf41c78b2754cb3187****",
    "Status": "Available",
    "CreateSource": "OpenAPI",
    "ModifiedSource": "OpenAPI"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-11-23The internal configuration of the API is changed, but the call is not affectedView Change Details