Obtains a URL and a credential for uploading an auxiliary media asset, such as a watermark, subtitle, or material.
Operation description
- Make sure that you understand the billing method and price 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 must obtain a URL and a credential before you upload an image to ApsaraVideo VOD. ApsaraVideo VOD provides multiple upload methods. You can upload auxiliary media assets by using SDKs for upload from servers, SDKs for upload from clients, URLs of auxiliary media assets, Object Storage Service (OSS) API, or 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.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Title | string | No | The title of the media asset. Take note of the following items:
| testTitle |
BusinessType | string | Yes | The type of the media asset. Valid values:
| watermark |
MediaExt | string | Yes | 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. Note
If 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. For example, you can specify callback configurations and upload acceleration configurations. The value must be 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.
Change history
Change time | Summary of changes | Operation |
---|