All Products
Search
Document Center

ApsaraVideo VOD:CreateUploadImage

Last Updated:Jun 10, 2026

Mengembalikan URL unggah dan unggah kredensial untuk memastikan otorisasi dan keamanan, mencegah unggahan berbahaya, dan secara otomatis membuat ID image untuk manajemen. Mengambil URL unggah dan unggah kredensial untuk mengunggah file image serta menghasilkan ID image.

Deskripsi operasi

  • 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.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

vod:CreateUploadImage

create

*All Resource

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

Title

string

No

Judul image. Aturan berikut berlaku:

  • Judul dapat memiliki panjang hingga 128 karakter.

  • Nilai harus dienkode dalam UTF-8.

mytitle

ImageType

string

Yes

Tipe image. Nilai valid:

  • default: tipe image default.

  • cover: gambar mini.

Catatan

Anda hanya dapat mengelola image bertipe default di konsol ApsaraVideo VOD.

default

ImageExt

string

No

Ekstensi nama file image. Nilai valid:

  • png (default)

  • jpg

  • jpeg

  • gif.

png

OriginalFileName

string

No

Nama file sumber.

Catatan

Nama harus mengandung ekstensi nama file. Ekstensi nama file tidak peka huruf besar-kecil.

D:\picture_01.png

Tags

string

No

Tag image. Aturan berikut berlaku:

  • Setiap tag dapat memiliki panjang hingga 32 karakter.

  • Anda dapat menentukan maksimum 16 tag untuk sebuah image.

  • Pisahkan beberapa tag dengan koma (,).

  • Nilai harus dienkode dalam UTF-8.

test

StorageLocation

string

No

Alamat penyimpanan. Lakukan operasi berikut untuk mendapatkan alamat penyimpanan: Masuk ke Konsol ApsaraVideo VOD. Di panel navigasi sebelah kiri, pilih Configuration Management > Manajemen media > Storage. Di halaman Storage, lihat alamat penyimpanan.

Catatan

Jika Anda menentukan alamat penyimpanan, file media akan diunggah ke alamat yang ditentukan.

outin-****..oss-cn-shanghai.aliyuncs.com

CateId

integer

No

ID kategori image. Anda dapat menggunakan salah satu metode berikut untuk mendapatkan ID kategori:

  • Masuk ke Konsol ApsaraVideo VOD. Di panel navigasi sebelah kiri, pilih Configuration Management > Manajemen media > Categories. Di halaman Categories, Anda dapat melihat ID kategori image.

  • Dapatkan nilai CateId dari respons operasi AddCategory.

  • Dapatkan nilai CateId dari respons operasi GetCategories.

100036****

UserData

string

No

Konfigurasi kustom, termasuk konfigurasi callback dan konfigurasi akselerasi unggah. Nilai harus berupa string JSON. Untuk informasi lebih lanjut, lihat bagian "UserData: specifies the custom configurations for media upload" pada topik Parameter permintaan.

Catatan
  • Konfigurasi callback hanya berlaku setelah Anda menentukan URL callback HTTP dan memilih event callback tertentu di Konsol ApsaraVideo VOD. Untuk informasi lebih lanjut tentang cara mengonfigurasi pengaturan callback HTTP di Konsol ApsaraVideo VOD, lihat Konfigurasi pengaturan callback.

  • Jika Anda ingin mengaktifkan fitur akselerasi unggah, kirimkan Tiket. Untuk informasi lebih lanjut, lihat Ikhtisar. Untuk informasi lebih lanjut tentang cara mengirimkan Tiket, lihat Hubungi kami.

{"MessageCallback":{"CallbackURL":"http://example.aliyundoc.com"},"Extend":{"localId":"xxx","test":"www"}}

Description

string

No

Deskripsi image.

  • Deskripsi dapat memiliki panjang hingga 1.024 karakter.

  • Nilai harus dienkode dalam UTF-8.

The description of the image

AppId

string

No

ID aplikasi. Nilai default: app-1000000. Untuk informasi lebih lanjut, lihat Ikhtisar.

app-1000000

Elemen respons

Element

Type

Description

Example

object

The returned result.

FileURL

string

The OSS URL of the file. The URL does not contain the information used for URL signing. You can specify FileUrl when you call the AddWatermark operation.

http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png

RequestId

string

The ID of the request.

25818875-5F78-AEF6-D7393642****

UploadAddress

string

The upload URL.

Catatan

The returned upload URL is a Base64-encoded URL. You must decode the Base64-encoded URL before you use an SDK or call an API operation to upload auxiliary media assets. You need to parse UploadAddress only if you use the OSS SDK or call an OSS API operation to upload auxiliary media assets.

eyJTZWN1cmuIjoiQ0FJU3p3TjF****

ImageURL

string

The URL of the image.

Catatan

If the returned URL is inaccessible from a browser and the HTTP 403 status code is returned, the URL signing feature in ApsaraVideo VOD is enabled. To resolve this issue, you can disable the URL signing feature or generate a signed URL.

http://example.aliyundoc.com/cover/2017-34DB-4F4C-9373-003AA060****.png

ImageId

string

The ID of the image file.

93ab850b4f6f46e91d24d81d4****

UploadAuth

string

The upload credential.

Catatan

The returned upload credential is a Base64-encoded value. You must decode the Base64-encoded credential before you use an SDK or call an API operation to upload auxiliary media assets. You need to parse UploadAuth only if you use the OSS SDK or call an OSS API operation to upload auxiliary media assets.

eyJFbmmRCI6Im****

Contoh

Respons sukses

JSONformat

{
  "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****"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.