Obtains a URL and a credential for uploading an auxiliary media asset, such as a watermark, subtitle, or material.
Operation Description
- The process of obtaining upload URLs and credentials is a core process in ApsaraVideo VOD and is required for each upload operation. ApsaraVideo VOD provides multiple upload methods. You can upload auxiliary media assets by using server upload SDKs, client upload SDKs, URLs of auxiliary media assets, Object Storage Service (OSS) API, or native OSS SDKs. Each upload method has different requirements for obtaining upload URLs and credentials. For more information, see the "Usage notes" section of the Upload URLs and credentials topic.
- If the upload credential expires, you can call this operation to obtain a new upload URL and credential. The default validity period of an upload credential is 3,000 seconds.
- You can configure a callback to receive an AttachedMediaUploadComplete event notification to determine whether the upload is successful.
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vod:CreateUploadAttachedMedia | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Title | string | No | The title of the media asset. Take note of the following items:
| |
BusinessType | string | Yes | The type of the media asset. Valid values:
| watermark |
MediaExt | string | No | The file name extension. Valid values:
| png |
FileName | string | No | The name of the source file. | D:\test.png |
FileSize | string | No | The size of the auxiliary media asset. Unit: byte. | 123 |
Tags | string | No | The one or more tags of the auxiliary media asset. Take note of the following items:
| tag1,tag2 |
StorageLocation | string | No | The storage location. You can use one of the following methods to obtain the storage location: Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Management > Storage. On the Storage page, you can view the storage location. NoteIf this parameter is set to a specific value, the auxiliary media asset is uploaded to the specified storage location. | out-****.oss-cn-shanghai.aliyuncs.com |
Description | string | No | The description of the auxiliary media asset. Take note of the following items:
| uploadTest |
UserData | string | No | The custom configurations, including callback configurations and upload acceleration configurations. The value is a JSON string. For more information, see the "UserData: specifies the custom configurations for media upload" section of the Request parameters topic. Note | {"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
CateIds | string | No | The one or more category IDs of the auxiliary media asset. Separate multiple category IDs with commas (,). A maximum of five category IDs can be specified. You can use one of the following methods to obtain the category ID:
| 1298****,0813**** |
AppId | string | No | The ID of the application. Default value: app-1000000. For more information, see Overview. | app-**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"FileURL": "https://****.oss-cn-shanghai.aliyuncs.com/watermark/****.mov",
"RequestId": "73254DE5-F260-4720-D06856B63C01****",
"UploadAddress": "LWNuLXNoYW5naGFpLmFsaXl1b****",
"MediaId": "97dc17a5abc3668489b84ce9****",
"MediaURL": "http://example.aliyundoc.com/watermark/****.mov?auth_key=****",
"UploadAuth": "UzFnUjFxNkZ0NUIZTaklyNWJoQ00zdHF****"
}
Error codes
For a list of error codes, visit the Service error codes.