Invokes the UploadMediaByURL operation to pull audio and video media files from source file URLs for upload. Batch uploads are supported. This operation is mainly applicable to scenarios where files are not stored on a local service or terminal and need to be uploaded through a URL that supports public network access.
Operation description
Operation description
If a callback is configured, you receive an event notification about the completion of URL-based video upload after the upload is complete. You can invoke the operation for obtaining URL upload information to query the upload status.
After an upload task is submitted successfully, an asynchronous task is generated in the cloud and queued for execution. After the upload is complete, you can associate the URL with the video ID based on the information returned in the event notification (message callback).
Limits
-
This operation supports uploading only to VOD storage, not to user-owned Object Storage Service (OSS) storage. If you use your own OSS storage, pull the file to a local device first, upload the file to OSS by using OSS SDK, and then invoke the RegisterMediaInfo operation to register the OSS file in the media asset library.
-
This operation is currently supported only in the China (Shanghai), China (Beijing), and China (Shenzhen) regions.
-
This operation supports uploading 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 media source file.
|
https://diffurl.mp4 |
| AppId |
string |
No |
The application ID. |
app-1000000 |
| UserData |
string |
No |
The custom settings. The value is a JSON string that supports settings such as message callbacks. |
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
| UploadTargetConfig |
string |
No |
The destination storage address.
|
{"StorageType":"oss","StorageLocation":"outin-***.oss-cn-shanghai.aliyuncs.com"} |
| MediaMetaData |
string |
No |
The metadata of the media file to be uploaded. The value is a JSON string.
|
[{"SourceURL":"https://example.aliyundoc.com/video01.mp4","Title":"urlUploadTest"}] |
| PostProcessConfig |
string |
No |
The post-upload processing action when Type is set to video or audio. Valid values of ProcessType: Workflow. |
{"ProcessType": "Workflow","ProcessID":"b72a06c6beeb4dcdb898feef067b1***"} |
| EntityId |
string |
No |
The entity ID. You can call the CreateEntity operation to create an entity and define a custom dynamic metadata structure. |
d67281da3c8743b8823ad12976187*** |
UploadMetadata
| Name | Type | Required | Description |
| SourceURL | String | Yes | The URL of the media source file to be uploaded. |
| Title | String | Yes | The media title. The title can be up to 128 bytes in length. UTF-8 encoded. |
| FileSize | String | No | The file size. |
| Description | String | No | The description. The description can be up to 1024 bytes in length. UTF-8 encoded. |
| CoverURL | String | No | The custom video thumbnail URL. |
| CateId | String | No | The category ID. |
| Tags | String | No | The tags. Each tag can be up to 32 bytes in length. A maximum of 16 tags are supported. Separate multiple tags with commas (,). UTF-8 encoded. |
| WorkflowId | String | No | The workflow ID. |
| FileExtension | String | No | The file name extension of the media file. |
| DynamicMetaData | String | No | The dynamic metadata. Example: "{"Uploader": "xxx"}". |
| EntityId | String | No | The entity ID. |
The WorkflowId parameter task is an asynchronous task. After submission, the task is not immediately completed and is queued for asynchronous execution in the background.
Parameters in UploadMetadata (such as Title, Description, and Tags) cannot contain emoji characters.
If a callback is configured, after the video upload is complete, you receive a URL-based video upload completion notification in addition to the upload and transcoding notifications.
When tasks are submitted in batches, each SourceURL has an independent notification.
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 multiple jobs. |
|
|
object |
The details of the upload task. |
||
| JobId |
string |
The upload task ID. |
20ce1e05dba64576b96e9683879f0*** |
| SourceURL |
string |
The source file URL of the upload task. |
http://example****.mp4 |
| MediaId |
string |
The media asset ID. |
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.