Obtains a URL and a credential for uploading an auxiliary media asset, such as a watermark file or a subtitle file.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateUploadAttachedMedia |
The operation that you want to perform. Set the value to CreateUploadAttachedMedia. |
BusinessType | String | Yes | watermark |
The type of the media asset. Valid values:
|
Title | String | No | Test |
The title of the media asset. Rules:
|
MediaExt | String | No | png |
The file name extension. Valid values:
|
FileName | String | No | D:\test.png |
The name of the mezzanine file. |
FileSize | String | No | 123 |
The size of the file. Unit: byte. |
Tags | String | No | tag1,tag2 |
The tag of the file. Rules:
|
StorageLocation | String | No | outin-bfefbb90a47c******163e1c7426.oss-cn-shanghai.aliyuncs.com |
The storage location. If this parameter is set to a specific value, the auxiliary media asset is uploaded to the specified 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. |
Description | String | No | uploadTest |
The description of the media asset. Rules:
|
UserData | String | No | {"MessageCallback":{"CallbackURL":"http://test.test.com"},"Extend":{"localId":"xxx","test":"www"}} |
The custom configurations, including callback configurations and upload acceleration configurations. The value is a JSON string. For more information, see the "UserData" section of the Request parameters topic. Note
|
CateIds | String | No | 12984346,08130876 |
The ID of the category.
|
AppId | String | No | app-**** |
The ID of the application. Default value: app-1000000. For more information, see Overview. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
FileURL | String | https://sample.oss-cn-shanghai.aliyuncs.com/watermark/****.mov |
The Object Storage Service (OSS) URL of the file. The URL does not contain the information used for authentication. You can set the FileUrl parameter to this URL when you call the AddWatermark operation. |
MediaId | String | 97dc17a5a*****bc3668489b84ce9 |
The ID of the media asset. |
MediaURL | String | http://sample.com/watermark/****.mov?auth_key=**** |
The URL of the media asset. If a domain name for CDN is specified, a CDN URL is returned. Otherwise, an OSS URL is returned. |
RequestId | String | 73254DE5-F260-47*****20-D06856B63C01 |
The ID of the request. |
UploadAddress | String | LWNuLXNoYW5*****naGFpLmFsaXl1b |
The upload URL. |
UploadAuth | String | UzFnUjFxNkZ0NUI*****ZTaklyNWJoQ00zdHF |
The upload credential. |
- This operation does not upload auxiliary media assets. To upload an auxiliary media asset, you must obtain the upload URL and credential, decode the URL and credential by using the Base64 algorithm, and then use OSS SDKs to upload the auxiliary media asset to a specified bucket. This process is the same as that of uploading a video or an image.
- 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.
- If you enable the URL signing feature of ApsaraVideo VOD, you may be unable to access the returned URL of the media asset by using a browser and the HTTP status code 403 may be returned. You can disable the URL signing feature or generate an authentication signature.
- For more information, see Upload URLs and credentials.
Examples
Sample requests
https://vod.aliyuncs.com/?Action=CreateUploadAttachedMedia
&BusinessType=watermark
&<Common request parameters>
Sample success responses
XML
format
<CreateUploadAttachedMediaResponse>
<RequestId>73254DE5-F260-47*****20-D06856B63C01</RequestId>
<MediaId>97dc17a5a*****bc3668489b84ce9</MediaId>
<UploadAddress>LWNuLXNoYW5*****naGFpLmFsaXl1b</UploadAddress>
<UploadAuth>UzFnUjFxNkZ0NUI*****ZTaklyNWJoQ00zdHF</UploadAuth>
<FileURL>https://sample.oss-cn-shanghai.aliyuncs.com/watermark/****.mov</FileURL>
<MediaURL>http://sample.com/watermark/****.mov?auth_key=****</MediaURL>
</CreateUploadAttachedMediaResponse>
JSON
format
{
"RequestId": "73254DE5-F260-47*****20-D06856B63C01",
"MediaId": "97dc17a5a*****bc3668489b84ce9",
"UploadAddress": "LWNuLXNoYW5*****naGFpLmFsaXl1b",
"UploadAuth": "UzFnUjFxNkZ0NUI*****ZTaklyNWJoQ00zdHF",
"FileURL": "https://sample.oss-cn-shanghai.aliyuncs.com/watermark/****.mov",
"MediaURL": "http://sample.com/watermark/****.mov?auth_key=****"
}
Error codes
For a list of error codes, visit the API Error Center.
SDK examples
We recommend that you use a server SDK to call this operation. For more information about the sample code that is used to call this operation in various languages, see the following topics: