The UploadMediaByURL API uploads audio or video files from source URLs. It supports batch uploads and is ideal for uploading files from a public URL instead of a local server or device.
Operation description
Description
-
If a callback is configured, the service sends an event notification when the URL upload is complete. You can query the upload status by calling the API to retrieve URL upload information.
-
After you successfully submit an upload job, the system creates an asynchronous task in the cloud and queues it for execution. After the upload is complete, you can use the URL and media ID from the event notification (message callback) to update your records.
Limitations
-
This API supports uploading files to VOD storage only and does not support uploading to your own Object Storage Service (OSS) buckets. To use your own OSS storage, you must first pull the files to a local device, upload them to OSS by using the OSS SDK, and then call the RegisterMediaInfo API to register the OSS object with the media asset library.
-
This API is currently available only in the China (Shanghai), China (Beijing), and China (Shenzhen) regions.
-
This API supports uploading audio and video files only.
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 source URL of the media file.
|
https://diffurl.mp4 |
| AppId |
string |
No |
The application ID. |
app-1000000 |
| UserData |
string |
No |
Custom settings, provided as a JSON string. This parameter supports configurations such as message callbacks. |
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
| UploadTargetConfig |
string |
No |
The destination storage location.
|
{"StorageType":"oss","StorageLocation":"outin-***.oss-cn-shanghai.aliyuncs.com"} |
| MediaMetaData |
string |
No |
The metadata of the media file, provided as a JSON string.
|
[{"SourceURL":"https://example.aliyundoc.com/video01.mp4","Title":"urlUploadTest"}] |
| PostProcessConfig |
string |
No |
Specifies post-upload processing actions for media files of type The only supported value for |
{"ProcessType": "Workflow","ProcessID":"b72a06c6beeb4dcdb898feef067b1***"} |
| EntityId |
string |
No |
The entity ID. You can call the CreateEntity API to create an entity and define a custom dynamic metadata schema. |
d67281da3c8743b8823ad12976187*** |
UploadMetadata
| Parameter | Type | Required | Description |
| SourceURL | String | Yes | The source URL of the media file to upload. |
| Title | String | Yes | The title of the media file. Maximum length: 128 bytes. Must be UTF-8 encoded. |
| FileSize | String | No | The size of the file. |
| Description | String | No | The description of the media file. Maximum length: 1,024 bytes. Must be UTF-8 encoded. |
| CoverURL | String | No | The URL of the custom video cover. |
| CateId | String | No | The category ID. |
| Tags | String | No | The tags of the media file. You can specify up to 16 tags, each up to 32 bytes in length. Separate multiple tags with a comma (,). The tags must be UTF-8 encoded. |
| WorkflowId | String | No | The workflow ID. |
| FileExtension | String | No | The file extension of the media file. |
| DynamicMetaData | String | No | Dynamic metadata. Example: {"Uploader": "xxx"}. |
| EntityId | String | No | The entity ID. |
-
The
WorkflowIdparameter triggers an asynchronous task. After submission, the service queues the job for asynchronous execution, so it does not complete immediately. -
Parameters in
UploadMetadata, such asTitle,Description, andTags, cannot contain emojis. -
li data-t-idx="277">
When you submit a batch of jobs, the service sends a separate notification for each
SourceURL. -
For batch submissions, each SourceURL receives a separate notification.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned result. |
||
| RequestId |
string |
The request ID. |
****83B7-7F87-4792-BFE9-63CD2137**** |
| UploadJobs |
array<object> |
An array of upload jobs. |
|
|
object |
The upload job details. |
||
| JobId |
string |
The upload job ID. |
20ce1e05dba64576b96e9683879f0*** |
| SourceURL |
string |
The source URL corresponding to the upload job. |
http://example****.mp4 |
| MediaId |
string |
The media 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.