Updated on 2024-04-30 GMT+08:00

Queries media assets

Function

Queries media assets. Each record in the list contains the brief information of a media asset.

URI

GET /v1.0/{project_id}/asset/list

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

asset_id

No

Array

Media ID. A maximum of 10 media assets can be queried at a time.

status

No

Array

Media file status. Media files of different statuses are queried at a time.

Possible values are:

  • CREATING: The file is being uploaded.

  • FAILED: Upload failed.

  • CREATED: The file has been uploaded.

  • PUBLISHED: The file has been published.

  • TRANSCODING: The file is being transcoded.

  • TRANSCODE_SUCCEED: Transcoding succeeded.

  • TRANSCODE_FAILED: Transcoding failed.

  • THUMBNAILING: The snapshot is being captured.

  • THUMBNAIL_SUCCEED: The snapshot has been captured.

  • THUMBNAIL_FAILED: Snapshot capturing failed.

  • UN_REVIEW: The file has not been reviewed.

  • REVIEWING: The file is being reviewed.

  • REVIEW_SUSPICIOUS: The file failed the review and is to be manually reviewed.

  • REVIEW_PASSED: The file has been approved.

  • REVIEW_FAILED: The file failed the review.

  • REVIEW_BLOCKED: The file has been blocked.

start_time

No

String

Start time

The format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone.

end_time

No

String

End time

The format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone.

category_id

No

Integer

Category ID

tags

No

String

Media asset tag. Each tag contains up to 16 characters and up to 16 tags are allowed. Use commas (,) to separate tags. The values are UTF-8-encoded.

query_string

No

String

String for fuzzy search in the media asset title, description, and category

media_type

No

Array

Format of the audio/video file. Files of up to 20 different formats can be queried.

Possible values are:

  • Video file formats: MP4, TS, MOV, MXF, MPG, FLV, WMV, AVI, M4V, F4V, and MPEG

  • Audio file formats: MP3, OGG, WAV, WMA, APE, FLAC, AAC, AC3, MMF, AMR, M4A, M4R, WV, and MP2

page

No

Integer

Page number

Default value: 0

size

No

Integer

Number of records on each page

The value ranges from 1 to 100.

Default value: 10

Request Parameters

Table 3 Request header 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 a token.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory for AK/SK authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Total number of media files > 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

Table 5 AssetSummary

Parameter

Type

Description

asset_id

String

Media asset ID assigned by VOD. This parameter can only be queried but cannot be modified.

title

String

Media asset title. The value is UTF-8-encoded and contains a maximum of 128 characters.

description

String

Media asset description. The value contains a maximum of 1024 characters.

duration

Integer

Media file duration

Unit: second

size

Long

Media file size

Unit: byte

original_url

String

Original streaming URL

category

String

Media asset category name

covers

Array of CoverInfo objects

Cover information

create_time

String

Time when the media file was created

The format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone.

asset_status

String

Media file status

Possible values are:

  • CREATING: The file is being uploaded.

  • FAILED: Upload failed.

  • CREATED: The file has been uploaded.

  • PUBLISHED: The file has been published.

  • DELETED: The task has been deleted.

transcode_status

String

Transcoding status

Possible values are:

  • UN_TRANSCODE: The file is not transcoded.

  • WAITING_TRANSCODE: The file is to be transcoded.

  • TRANSCODING: The file is being transcoded.

  • TRANSCODE_SUCCEED: Transcoding succeeded.

  • TRANSCODE_FAILED: Transcoding failed.

thumbnail_status

String

Snapshot status

Possible values are:

  • UN_THUMBNAIL: No snapshot is captured.

  • THUMBNAILING: The snapshot is being captured.

  • THUMBNAIL_SUCCEED: The snapshot has been captured.

  • THUMBNAIL_FAILED: Snapshot capturing failed.

review_status

String

Content review status

Possible values are:

  • UN_REVIEW: The file has not been reviewed.

  • REVIEWING: The file is being reviewed. - REVIEW_SUSPICIOUS: The file needs to be manually reviewed.

  • REVIEW_PASSED: The file has been approved.

  • REVIEW_FAILED: The file is not approved.

  • REVIEW_BLOCKED: The file has been blocked.

exec_desc

String

Execution description of media file tasks

Example:

  • asset_exec_desc: upload success: execution description of file upload tasks

  • transcode_exec_desc: transcode success: execution description of transcoding tasks

  • thumbnail_exec_desc: thumbnail failed: execution description of snapshot capturing tasks

  • review_exec_desc: review pass: execution description of review tasks

media_type

String

Audio/Video file format

Possible values are:

  • Video file formats: MP4, TS, MOV, MXF, MPG, FLV, WMV, AVI, M4V, F4V, and MPEG

  • Audio file formats: MP3, OGG, WAV, WMA, APE, FLAC, AAC, AC3, MMF, AMR, M4A, M4R, WV, and MP2

Table 6 CoverInfo

Parameter

Type

Description

cover_url

String

URL for downloading the cover file

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error description

Example Requests

Queries media files.

GET https://{endpoint}/v1.0/{project_id}/asset/list

Example Responses

Status code: 200

The information is returned when the request succeeds.

{
  "total" : 1,
  "assets" : [ {
    "asset_id" : "67d1470893419bfcb9663103dd8a66ac",
    "title" : "video.mp4",
    "duration" : 60,
    "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

The information is returned when the request fails.

{
  "error_code" : "VOD.10053",
  "error_msg" : "The request parameter is illegal, illegal field: {xx}."
}

Status Codes

Status Code

Description

200

The information is returned when the request succeeds.

400

The information is returned when the request fails.

Error Codes

See Error Codes.