Obtains an upload URL and an upload credential for an auxiliary media asset such as a watermark image, subtitle file, or material and generates the media ID. ApsaraVideo VOD issues upload URLs and credentials to perform authorization and ensure security. This prevents unauthorized users from uploading media files. ApsaraVideo VOD generates media IDs together with upload URLs and credentials. Media IDs are used in lifecycle management and media processing.
Operation description
- Make sure that you understand the billing method and prices of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see Billing of media asset storage. If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see Billing of acceleration traffic.
- You can call this operation only to obtain the upload URLs and credentials for media files and create media assets in ApsaraVideo VOD. You cannot call this operation to upload media files. For more information about how to upload media files by calling API operations, see Upload media files by calling API operations.
- If the upload credential expires after 3,000 seconds, you can call the CreateUploadAttachedMedia operation again to obtain a new upload URL and a new upload credential.
- You can configure a callback to receive an AttachedMediaUploadComplete event notification to determine whether the upload is successful.
- You must obtain a URL and a credential before you upload a media file to ApsaraVideo VOD. ApsaraVideo VOD supports multiple upload methods. Each method has different requirements on upload URLs and credentials. For more information, see Upload URLs and credentials.
Debugging
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 | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Title | string | No | The title of the auxiliary media asset. The following rules apply:
| testTitle |
BusinessType | string | Yes | The type of the auxiliary media asset. Valid values:
| watermark |
MediaExt | string | Yes | The file name extension of the auxiliary media asset.
| png |
FileName | string | No | The source file URL of the auxiliary media asset. Note
The file name extension is optional. If the file name extension that you specified for this parameter is different from the value of MediaExt, the value of MediaExt takes effect.
| 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 address. Perform the following operations to obtain the storage address: Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Management > Storage. On the Storage page, view the storage address. Note
If you leave this parameter empty, the auxiliary media asset is uploaded to the default storage address. If you specify this parameter, the auxiliary media asset is uploaded to the specified storage address.
| 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. For example, you can specify callback configurations and upload acceleration configurations. The value must be a JSON string. For more information, see Request parameters. Note
| {"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
CateIds | string | No | The ID of the category. Separate multiple IDs with commas (,). You can specify up to five IDs. You can use one of the following methods to obtain the ID:
| 1298****,0813**** |
AppId | string | No | The ID of the application. Default value: app-1000000. If you have activated the multi-application service, specify the ID of the application to add the watermark template in the specified application. 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.
Change history
Change time | Summary of changes | Operation |
---|