This operation retrieves an upload address and upload credential for audio, video, image, and auxiliary media assets, and creates the corresponding media asset.
Operation description
Overview
-
Obtaining an upload address and upload credential is a prerequisite for all uploads in Intelligent Media Service.
-
If an upload credential expires (the default validity is 3,000 seconds), call the
RefreshUploadMediaoperation to get a new one. -
After an upload is complete, you can confirm its success by either configuring a callback for event notifications or calling the
GetMediaInfooperation to check the media asset's status. -
Use the returned
MediaIdfor media asset lifecycle management or media processing.
Limitations
-
This operation supports uploads only to VOD storage, not to your own Object Storage Service (OSS) buckets. If you use your own OSS buckets, first upload the files by using the OSS SDK, and then call the RegisterMediaInfo operation to register the OSS files in your media library.
-
This operation is available only in the China (Shanghai), China (Beijing), and China (Shenzhen) regions.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ice:CreateUploadMedia |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AppId |
string |
No |
The application ID. The default value is |
app-1000000 |
| EntityId |
string |
No |
The ID of the entity. You can call the |
9e177cac2fb44f8b8c67b199fcc7bffd |
| FileInfo |
string |
No |
The file information, provided as a JSON string containing the following fields:
|
{\"Type\":\"video\",\"Name\":\"test\",\"Size\":108078336,\"Ext\":\"mp4\"} |
| UserData |
string |
No |
A JSON string for custom settings, such as configuring a message callback. |
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"*****","test":"www"}} |
| UploadTargetConfig |
string |
No |
The destination storage configuration, provided as a JSON string.
|
{\"StorageType\":\"oss\",\"StorageLocation\":\"outin-***.oss-cn-shanghai.aliyuncs.com\"} |
| MediaMetaData |
string |
No |
The media asset metadata, provided as a JSON string.
|
{\"Title\": \"UploadTest\", \"Description\": \"UploadImageTest\", \"Tags\": \"tag1,tag2\",\"BusinessType\":\"cover\"} |
| PostProcessConfig |
string |
No |
The post-processing configuration for Set Note
|
{\"ProcessType\":\"Workflow\",\"ProcessID\":\"74ba870f1a4873a3ba238e0bf6fa9***\"} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The ID of the request. |
4E84BE44-58A7-****-****-FBEBEA16EF94 |
| MediaId |
string |
The ID of the media asset. |
****20b48fb04483915d4f2cd8ac**** |
| MediaURL |
string |
The URL of the media asset. Note
This will be a CDN URL if a CDN domain is configured, or an OSS URL otherwise. If you receive a 403 error when accessing this URL in a browser, it is likely because URL authentication is enabled for the VOD domain. To resolve this, either disable URL authentication or generate a signed URL for access. |
https://xxq-live-playback.oss-cn-shanghai.aliyuncs.com/capture/5d96d2b4-111b-4e5d-a0e5-20f44405bb55.mp4 |
| FileURL |
string |
The OSS URL of the file, without authentication parameters. |
http://outin-***.oss-cn-north-2-gov-1.aliyuncs.com/sv/40360f05-181f63c3110-0004-cd8e-27f-de3c9.mp4 |
| UploadAddress |
string |
The upload address. Note
The returned upload address is Base64-encoded and must be decoded before use. You only need to manually decode this address if you are using a native OSS SDK or an OSS API to perform the upload. |
eyJTZWN1cml0a2VuIjoiQ0FJU3p3TjF**** |
| UploadAuth |
string |
The upload credential. Note
The returned upload credential is Base64-encoded and must be decoded before use. You only need to manually decode this credential if you are using a native OSS SDK or an OSS API to perform the upload. |
eyJFbmRwb2ludCI6Imm**** |
Examples
Success response
JSON format
{
"RequestId": "4E84BE44-58A7-****-****-FBEBEA16EF94",
"MediaId": "****20b48fb04483915d4f2cd8ac****",
"MediaURL": "https://xxq-live-playback.oss-cn-shanghai.aliyuncs.com/capture/5d96d2b4-111b-4e5d-a0e5-20f44405bb55.mp4",
"FileURL": "http://outin-***.oss-cn-north-2-gov-1.aliyuncs.com/sv/40360f05-181f63c3110-0004-cd8e-27f-de3c9.mp4",
"UploadAddress": "eyJTZWN1cml0a2VuIjoiQ0FJU3p3TjF****",
"UploadAuth": "eyJFbmRwb2ludCI6Imm****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.