CreateUploadVideo
ApsaraVideo VOD provides an upload address and credential for secure and authorized uploads. Call this operation to obtain the upload address and credential, create a media ID (returned as VideoId), and set basic information for the media file.
Operation description
-
Before you use this operation, make sure you understand the billing methods and pricing of ApsaraVideo VOD. Uploading a media file incurs media storage fees. For more information, see Media storage billing. If you have enabled storage and transfer acceleration, you are also charged for upload acceleration. For more information, see Storage and transfer acceleration billing. Storage fees are calculated after the file is successfully uploaded. Acceleration fees are charged for uploads after the feature is enabled. Calling this operation alone does not incur any charges.
-
Obtaining an upload address and credential is the first step for every upload to ApsaraVideo VOD. The service supports various upload methods, each with different requirements for obtaining the address and credential. For more information, see Upload address and credential.
-
This operation only obtains the upload address, credential, and basic media information. It does not upload the media file itself. For a complete example of how to upload a media file by using an API, see Upload a media file by using the ApsaraVideo VOD API.
-
You can call this operation to obtain the upload address and credential for both video and audio files. For more information, see Upload address and credential.
-
If the upload credential expires (the default validity period is 3,000 seconds), call the RefreshUploadVideo operation to obtain a new one.
-
After the upload is complete, you can configure a callback to receive an event notification or call the GetMezzanineInfo operation to check the file status and verify that the upload was successful.
-
Use the returned
VideoIdfor media asset lifecycle management or media processing.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vod:CreateUploadVideo |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| CoverURL |
string |
No |
The URL of the custom video cover. |
https://example.aliyundoc.com/image/D22F553TEST****.jpeg |
| Description |
string |
No |
The description of the media file that is displayed in ApsaraVideo VOD after the upload is complete.
|
UploadTest |
| FileName |
string |
Yes |
The path of the source media file to upload.
|
D:\video_01.mp4 |
| FileSize |
integer |
No |
The size of the source media file, in bytes. |
123 |
| Title |
string |
Yes |
The title of the media file that is displayed in ApsaraVideo VOD after the upload is complete.
|
UploadTest |
| CateId |
integer |
No |
The category ID. You can obtain the category ID in one of the following ways:
|
100036**** |
| Tags |
string |
No |
The tags of the media file.
|
tag1,tag2 |
| UserData |
string |
No |
Custom settings in a JSON string format. This parameter lets you configure features such as message callbacks and upload acceleration. For more information, see UserData. Note
|
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"*****","test":"www"}} |
| TemplateGroupId |
string |
No |
The ID of the transcoding template group. You can obtain the ID in one of the following ways:
Note
|
405477f9e214d19ea2c7c854**** |
| WorkflowId |
string |
No |
The workflow ID. To view the workflow ID, log on to the ApsaraVideo VOD console and choose Settings > Media Processing Settings > Workflow Management. Note
|
613efff3887ec34af685714cc461**** |
| StorageLocation |
string |
No |
The storage location. To view the storage location, log on to the ApsaraVideo VOD console and choose Settings > Media Asset Management > Storage Management. Note
If you do not specify this parameter, the media file is uploaded to the default storage location. If no default storage location is specified, the file is uploaded to the first storage location in the list. If you specify this parameter, the file is uploaded to the specified storage location. |
out-****.oss-cn-shanghai.aliyuncs.com |
| AppId |
string |
No |
The application ID. Default value: app-1000000. For more information, see Multi-application. |
app-1000000 |
| ReferenceId |
string |
No |
A custom ID. It can contain only lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_). The ID must be 6 to 64 characters in length and must be unique for each user. |
123-123 |
| EnableFirstFrameCover |
boolean |
No |
||
| GenerateThumbnail |
boolean |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
25818875-5F78-4AF6-04D5-D7393642**** |
| UploadAddress |
string |
The upload address. Note
The upload address returned by this operation is Base64-encoded. You must Base64-decode the address before you use it to upload a media file. This parsing is required only when using an OSS SDK or an OSS API to upload files. |
eyJTZWN1cml0a2VuIjoiQ0FJU3p3TjF**** |
| VideoId |
string |
The ID of the media file. Use this ID as a request parameter for operations such as media asset management, media processing, and media moderation. |
93ab850b4f6f54b6e91d24d81d44**** |
| UploadAuth |
string |
The upload credential. Note
The upload credential returned by this operation is Base64-encoded. You must Base64-decode the credential before you use it to upload a media file. This parsing is required only when using an OSS SDK or an OSS API to upload files. |
eyJFbmRwb2ludCI6Imm**** |
Examples
Success response
JSON format
{
"RequestId": "25818875-5F78-4AF6-04D5-D7393642****",
"UploadAddress": "eyJTZWN1cml0a2VuIjoiQ0FJU3p3TjF****",
"VideoId": "93ab850b4f6f54b6e91d24d81d44****",
"UploadAuth": "eyJFbmRwb2ludCI6Imm****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.