Retrieves the upload URL and upload credential for uploading an image to ApsaraVideo VOD, and creates image information. ApsaraVideo VOD issues upload URLs and credentials to ensure authorization and security, prevent malicious uploads, and supports automatic creation of an image ID (ImageId) for management. You can invoke this operation to obtain the upload URL and credential and create image information.
Operation description
Before using this operation, make sure that you understand the billing methods and pricing of ApsaraVideo VOD. Uploading media files to ApsaraVideo VOD incurs storage fees. For more information, see Media asset storage billing. If you have enabled storage and transfer acceleration, uploading media files to ApsaraVideo VOD also incurs upload acceleration fees. For more information, see Storage and transfer acceleration billing.
This operation only retrieves the upload URL and credential and creates basic media asset information. It does not upload files. For a complete example of uploading files by calling API operations, see Upload media files by using the ApsaraVideo VOD API.
Refreshing the upload URL and credential is not supported for image uploads. If the image upload credential expires (the default validity period is 3000 seconds), call this operation again to obtain a new upload URL and credential.
You can configure callbacks to receive event notifications for image upload completion to determine whether the upload is successful.
Retrieving the upload URL and credential is a core operation of ApsaraVideo VOD and is required for every upload. ApsaraVideo VOD provides multiple upload methods, each with different requirements for retrieving the upload URL and credential. For more information, see Upload URLs and credentials.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vod:CreateUploadImage |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Title |
string |
No |
The title of the image. Rules:
|
mytitle |
| ImageType |
string |
Yes |
The type of the image. Valid values:
Note
The ApsaraVideo VOD console supports viewing and managing only images of the default type. |
default |
| ImageExt |
string |
No |
The file name extension of the image source file to upload. Valid values:
|
png |
| OriginalFileName |
string |
No |
The address of the image source file to upload. Note
The file name extension is optional. If a file name extension is included here and is different from the value specified in |
D:\picture_01 |
| Tags |
string |
No |
The tags of the image. Rules:
|
Test |
| StorageLocation |
string |
No |
The storage address. You can obtain the storage address by using the following method: Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Management > Storage to view the storage address. Note
If you do not specify this parameter, the image is uploaded to the default storage address. If you specify this parameter, the image is uploaded to the specified storage address. |
outin-****..oss-cn-shanghai.aliyuncs.com |
| CateId |
integer |
No |
The category ID. You can obtain the category ID by using the following methods:
|
100036**** |
| UserData |
string |
No |
The custom settings in a JSON string. The settings support message callbacks, upload acceleration, and other configurations. For more information, see UserData. Note
|
{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
| Description |
string |
No |
The description of the image.
|
Image upload test |
| AppId |
string |
No |
The application ID. Default value: app-1000000. If you have activated the multi-application service, specify the application ID to upload the image to the specified application. For more information, see Multi-application. |
app-1000000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| FileURL |
string |
The OSS URL of the image file (without authentication). When you add an image watermark template, this URL can be used as the |
http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png |
| RequestId |
string |
The request ID. |
25818875-5F78-AEF6-D7393642**** |
| UploadAddress |
string |
The upload URL. Note
The upload URL returned by this operation is a Base64-encoded value. When you use an SDK or API to upload media assets, decode the value in Base64 before use. Only uploads by using the OSS native SDK or OSS API require you to parse UploadAddress. |
eyJTZWN1cmuIjoiQ0FJU3p3TjF**** |
| ImageURL |
string |
The access URL of the image. Note
If the returned ImageURL is inaccessible in a browser (403 error), URL authentication is enabled for your VOD domain name. Disable URL authentication or generate a signed URL. |
http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png |
| ImageId |
string |
The image ID. This ID can be used as a request parameter for operations such as GetImageInfo, GetImageInfos, UpdateImageInfos, and DeleteImage. |
93ab850b4f6f46e91d24d81d4**** |
| UploadAuth |
string |
The upload credential. Note
The upload credential returned by this operation is a Base64-encoded value. When you use an SDK or API to upload media assets, decode the value in Base64 before use. Only uploads by using the OSS native SDK or OSS API require you to parse UploadAuth. |
eyJFbmmRCI6Im**** |
Examples
Success response
JSON format
{
"FileURL": "http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png",
"RequestId": "25818875-5F78-AEF6-D7393642****",
"UploadAddress": "eyJTZWN1cmuIjoiQ0FJU3p3TjF****",
"ImageURL": "http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png",
"ImageId": "93ab850b4f6f46e91d24d81d4****",
"UploadAuth": "eyJFbmmRCI6Im****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.