Querying Media Assets
Function
This API is used to query media assets. Each record in the list contains the brief information of a media asset.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
GET /v1.0/{project_id}/asset/list
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
asset_id |
No |
Array of strings |
Media asset ID. A maximum of 10 media assets can be queried at a time. |
|
status |
No |
Array of strings |
Media asset status. Multiple statuses can be queried at a time. The options include:
|
|
start_time |
No |
String |
Start time. The format is yyyymmddhhmmss. The value must be a UTC time, without reference to any time zone. |
|
end_time |
No |
String |
End time. The format is yyyymmddhhmmss. The value must be a UTC time, without reference to any time zone. |
|
category_id |
No |
Integer |
Category ID. |
|
tags |
No |
String |
Media asset tags. Each tag contains up to 24 characters and up to 16 tags are allowed. Use commas (,) to separate tags. All tags must be UTF-8 encoded. |
|
query_string |
No |
String |
String for fuzzy search in media asset titles and descriptions.
NOTE:
Fuzzy search is inefficient when the data volume is large. This field is not recommended when the number of media assets reaches millions.
|
|
media_type |
No |
Array of strings |
Audio/Video file formats. Up to 20 formats can be queried. The options include:
|
|
page |
No |
Integer |
Page number. Default value: 0 |
|
size |
No |
Integer |
Number of records on each page. Value range: 1 to 100 Default value: 10 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
User token. This parameter is mandatory when token authentication is used. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
|
Authorization |
No |
String |
Authentication information. This parameter is mandatory for AK/SK authentication. |
|
X-Sdk-Date |
No |
String |
Time when a request is sent. This parameter is mandatory for AK/SK authentication. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total |
Integer |
Total number of media assets.
NOTE:
Currently, statistics about up to 20,000 media files can be collected. To query the total number of media files, submit a service ticket.
|
|
assets |
Array of AssetSummary objects |
Media asset list. |
|
Parameter |
Type |
Description |
|---|---|---|
|
asset_id |
String |
Media asset ID assigned by VOD. It can only be queried but cannot be modified. |
|
title |
String |
Media asset title. The value is UTF-8 encoded and cannot exceed 128 characters. |
|
description |
String |
Media asset description. The value contains a maximum of 1,024 characters. |
|
duration |
Integer |
Media file duration. Unit: seconds |
|
duration_ms |
Long |
Video duration, in milliseconds. |
|
size |
Long |
Media file size. Unit: bytes |
|
original_url |
String |
Original streaming URL. |
|
category |
String |
Media asset category name. |
|
covers |
Array of CoverInfo objects |
Thumbnail information. |
|
create_time |
String |
Time when the media asset was created. The format is yyyymmddhhmmss. The value must be a UTC time, without reference to any time zone. |
|
asset_status |
String |
Media asset status. The options include:
|
|
transcode_status |
String |
Transcoding status. The options include:
|
|
thumbnail_status |
String |
Snapshot status. The options include:
|
|
review_status |
String |
Content review status. The options include:
|
|
exec_desc |
String |
Execution description of media file tasks Example:
|
|
media_type |
String |
Audio/Video file format. The options include:
|
|
Parameter |
Type |
Description |
|---|---|---|
|
cover_url |
String |
URL for downloading the thumbnail file. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Example Requests
This example queries media assets.
GET https://{endpoint}/v1.0/{project_id}/asset/list
Example Responses
Status code: 200
Returned when the request succeeded.
{
"total" : 1,
"assets" : [ {
"asset_id" : "67d1470893419bfcb9663103dd8a66ac",
"title" : "video.mp4",
"duration" : 60,
"duration_ms" : 60000,
"size" : 12881945,
"category" : "Other",
"covers" : [ {
"cover_url" : "https://355.cdn-vod.huaweicloud.com/asset/67d1470893419bfcb9663103dd8a66ac/cover/Cover0.jpg"
} ],
"create_time" : "20190625020756",
"asset_status" : "PUBLISHED",
"transcode_status" : "TRANSCODE_SUCCEED",
"thumbnail_status" : "UN_THUMBNAIL",
"review_status" : "UN_REVIEW",
"exec_desc" : "asset_exec_desc:Asset meta is\npublished;transcode_exec_desc:Transcode success;",
"media_type" : "MP4"
} ]
}
Status code: 400
Returned when the request failed.
{
"error_code" : "VOD.10053",
"error_msg" : "The request parameter is illegal, illegal field: {xx}."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Returned when the request succeeded. |
|
400 |
Returned when the request failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot