Uploads an audio or video file based on the URL of the source file. You can upload multiple media files at a time.
Operation description
-
If a callback is configured, you will receive an UploadByURLComplete event notification after the file is uploaded. You can query the upload status by calling the GetURLUploadInfos operation.
-
After a request is submitted, the upload job is queued as an asynchronous job in the cloud. You can query the status of the upload job based on information such as the URL and media asset ID that are returned in the event notification.
-
Upload media files that are not stored on a local server or device and must be uploaded by using URLs that are accessible over the Internet.
-
Upload media files only to ApsaraVideo VOD, but not to your own Object Storage Service (OSS) buckets. To upload a media file to an OSS bucket, pull the file to a local directory, use OSS SDK to upload the file to an OSS bucket, and then call the RegisterMediaInfo operation to register the file in the OSS bucket with the media asset library.
-
This operation is available only in the China (Shanghai), China (Beijing), and China (Shenzhen) regions.
-
Upload only audio and video files.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ice:UploadMediaByURL |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| UploadURLs |
string |
No |
The URL of the source file.
|
https://diffurl.mp4 |
| AppId |
string |
No |
The application ID. |
app-1000000 |
| UserData |
string |
No |
The user data. The value must be a JSON string. You can configure settings such as message callbacks. |
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
| UploadTargetConfig |
string |
No |
The destination storage address. Set StorageType to oss. Set StorageLocation to an address in ApsaraVideo VOD. You cannot set this field to an OSS URL. |
{"StorageType":"oss","StorageLocation":"outin-***.oss-cn-shanghai.aliyuncs.com"} |
| MediaMetaData |
string |
No |
The metadata of the media file that you want to upload. The value must be a JSON string.
|
[{"SourceURL":"https://example.aliyundoc.com/video01.mp4","Title":"urlUploadTest"}] |
| PostProcessConfig |
string |
No |
The postprocessing configurations. You can specify this parameter if Type is set to video or audio. Set ProcessType to Workflow. |
{"ProcessType": "Workflow","ProcessID":"b72a06c6beeb4dcdb898feef067b1***"} |
| EntityId |
string |
No |
The entity ID. You can call the CreateEntity operation to create an entity and specify a dynamic metadata structure. |
d67281da3c8743b8823ad12976187*** |
UploadMetadata
| Field | Type | Required | Description |
| SourceURL | String | Yes | The URL of the source file that you want to upload. |
| Title | String | Yes | The title of the media asset. The value can be up to 128 bytes in length. The value must be encoded in UTF-8. |
| FileSize | String | No | The file size. |
| Description | String | No | The description of the media asset. The value can be up to 1024 bytes in length. The value must be encoded in UTF-8. |
| CoverURL | String | No | The URL of the custom video thumbnail. |
| CateId | String | No | The category ID. |
| Tags | String | No | The tags that you want to add to the media asset. Each tag can be up to 32 bytes in length. You can set a maximum of 16 tags. Separate multiple tags with commas (,). The value is encoded in UTF-8. |
| WorkflowId | String | No | The workflow ID. |
| FileExtension | String | No | The file name extension. |
| DynamicMetaData | String | No | The dynamic metadata. Example: "{"Uploader": "xxx"}". |
| EntityId | String | No | The entity ID. |
Note* The values of fields, such as Title, Description, and Tags, in UploadMetadata cannot contain emojis.
-
If a callback is configured, you can receive an UploadByURLComplete event notification when the media file is uploaded. You can also receive the FileUploadComplete and StreamTranscodeComplete event notifications.
-
If you upload multiple media files at a time, an event notification is sent for each media file when the media file is uploaded.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
****83B7-7F87-4792-BFE9-63CD2137**** |
| UploadJobs |
array<object> |
The information about upload jobs. |
|
|
object |
The details of the upload job. |
||
| JobId |
string |
The ID of the upload job. |
20ce1e05dba64576b96e9683879f0*** |
| SourceURL |
string |
The URL of the source file that is uploaded in the upload job. |
http://example****.mp4 |
| MediaId |
string |
The ID of the media asset. |
f476988629f54a7b8a4ba90d1a6c7*** |
Examples
Success response
JSON format
{
"RequestId": "****83B7-7F87-4792-BFE9-63CD2137****",
"UploadJobs": [
{
"JobId": "20ce1e05dba64576b96e9683879f0***",
"SourceURL": "http://example****.mp4\n",
"MediaId": "f476988629f54a7b8a4ba90d1a6c7***"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.