Queries a URL and a credential for uploading an image.
Operation description
- Make sure that you understand the billing method and price of ApsaraVideo VOD before you call this operation. You are charged storage fees after you upload media files to ApsaraVideo VOD. For more information, see Billing of media asset storage. If you have activated the acceleration service, you are charged acceleration fees when you upload media files to ApsaraVideo VOD. For more information, see Billing of acceleration traffic.
- You must obtain a URL and a credential before you upload an image to ApsaraVideo VOD. ApsaraVideo VOD provides multiple upload methods. You can upload files by using server upload SDKs, client upload SDKs, URLs, Object Storage Service (OSS) API, or OSS SDKs. Each upload method has different requirements for obtaining upload URLs and credentials. For more information, see the "Usage notes" section of the Upload URLs and credentials topic.
- You cannot refresh the upload URL or credential when you upload images. If the image upload credential expires, you can call this operation to obtain a new upload URL and credential. By default, the validity period of an image upload credential is 3,000 seconds.
- You can call the CreateUploadAttachedMedia operation to upload image watermarks.
- You can configure a callback for ImageUploadComplete to receive notifications about the image upload status.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vod:CreateUploadImage | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Title | string | No | The title of the image. The following rules apply:
| mytitle |
ImageType | string | Yes | The type of the image. Valid values:
Note
You can manage only images of the default type in the ApsaraVideo VOD console.
| default |
ImageExt | string | No | The file name extension of the image. Valid values:
| png |
OriginalFileName | string | No | The name of the source file. Note
The name must contain a file name extension. The file name extension is not case-sensitive.
| D:\picture_01.png |
Tags | string | No | The tags of the image. The following rules apply:
| test |
StorageLocation | string | No | The storage address. Perform the following operations to obtain the storage address: Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Configuration Management > Media Management > Storage. On the Storage page, view the storage address. Note
If you specify a storage address, media files are uploaded to the specified address.
| outin-****..oss-cn-shanghai.aliyuncs.com |
CateId | long | No | The category ID of the image. You can use one of the following methods to obtain the category ID:
| 100036**** |
UserData | string | No | The custom configurations, including callback configurations and upload acceleration configurations. The value must be a JSON string. For more information, see the "UserData: specifies the custom configurations for media upload" section of the Request parameters topic. Note
| {"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}} |
Description | string | No | The description of the image.
| The description of the image |
AppId | string | No | The ID of the application. Default value: app-1000000. For more information, see Overview . | app-1000000 |
Response parameters
Examples
Sample success responses
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
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-10-27 | The request parameters of the API has changed | View Change Details |