Media Assets Management

Update time: 2022/07/21 07:52:31

This topic describes how to call APIs that are used to manage media assets such as videos and images, and provides sample codes. You can call the APIs to manage videos, sort video files, take screenshots, and use different thumbnails.

Video files that are stored in the VOD service are persisted without expiration time during the validity period of the service and can be played back or downloaded. If the VOD service expires, all files become inaccessible. However, the files will be stored for 35 days. To use the service, you must renew the service within 35 days. If you don’t renew the service after 35 days, all resources will be deleted.

Query the video information

Get information about a video file, such as the ID, name, URLs for different formats, URLs used to download videos in different formats, size in each video format, screenshot URLs, category ID and name, playback duration, and transcoding completion time.

URL

POST https://vcloud.163.com/app/vod/video/get

Request parameters

Parameter Type Required Description
vid Long Yes The ID of a video file.

Response parameters

Parameter Type Description
code Int The status code.
videoName String The name of a video file.
vid Long The ID of a video file.
status Int The status of the video. 10: initializing. 20: loading failure. 30: processing. 40: loaded. 50: blocked. 70: encrypted. 80: encryption failure.
description String The description of the video file.
completeTime Long The time consumed to complete transcoding.
duration Int Playback duration. Unit: seconds.
durationMsec Int Playback duration. Unit: milliseconds.
width String Video width. The default value is 0.
height String Video height. The default value is 0
typeId Int The ID of a category to which a video file belongs.
typeName String The category name of the video file.
snapshotUrl String The URL of the screenshot for a video thumbnail
origUrl String The original URL used to play back the video file.
downloadOrigUrl String The original URL address used to download the video file.
initialSize Long The size of the original video file. Unit: bytes.
sdMp4Url String The playback URL of an SD MP4 file.
downloadSdMp4Url String The download URL of an SD MP4 file.
sdMp4Size Int The size of an SD MP4 video file. Unit: bytes.
sdMp4Width String The width of an SD MP4 video file. The default value is 0.
sdMp4Height String The height of an SD MP4 video file. The default value is 0.
hdMp4Url String The playback URL of an HD MP4 file.
downloadHdMp4Url String The download URL of an HD MP4 file.
hdMp4Size Int The size of an HD MP4 file. Unit: bytes.
hdMp4Width String The width of an HD MP4 file. The default value is 0.
hdMp4Height String The height of an HD MP4 file. The default value is 0.
shdMp4Url String The playback URL of an SHD MP4 file.
downloadShdMp4Url String The download URL of an SHD MP4 file.
shdMp4Size Int The size of an SHD MP4 file. Unit: bytes.
shdMp4Width String The width of an SHD MP4 file. The default value is 0.
shdMp4Height String The height of an SHD MP4 file. The default value is 0.
sdFlvUrl String The playback URL of an SD FLV file.
downloadSdFlvUrl String The download URL of an SD FLV file.
sdFlvSize Int The size of an SD FLV file. Unit: bytes.
sdFlvWidth String The width of an SD FLV file. The default value is 0.
sdFlvHeight String The height of an SD FLV file. The default value is 0.
hdFlvUrl String The playback URL of an HD FLV file.
downloadHdFlvUrl String The download URL of an HD FLV file.
hdFlvSize Int The size of an HD FLV file. Unit: bytes.
hdFlvWidth String The width of an HD FLV file. The default value is 0.
hdFlvHeight String The height of an HD FLV file. The default value is 0.
shdFlvUrl String The playback URL of an SHD FLV file.
downloadShdFlvUrl String The download URL of an SHD FLV file.
shdFlvSize Int The size of an SHD FLV file. Unit: bytes.
shdFlvWidth String The width of an SHD FLV file. The default value is 0.
shdFlvHeight String The height of an SHD FLV file. The default value is 0.
sdHlsUrl String The playback URL of an SD HLS file.
downloadSdHlsUrl String The download URL of an SD HLS file.
sdHlsSize Int The size of an SD HLS file. Unit: bytes.
sdHlsWidth String The width of an SD HLS file. The default value is 0.
sdHlsHeight String The height of an SD HLS file. The default value is 0.
hdHlsUrl String The playback URL of an HD HLS file.
downloadHdHlsUrl String The download URL of an HD HLS file.
hdHlsSize Int The size of an HD HLS file. Unit: bytes.
hdHlsWidth String The width of an HD HLS file. The default value is 0.
hdHlsHeight String The height of an HD HLS file. The default value is 0.
shdHlsUrl String The playback URL of an SHD HLS file.
downloadShdHlsUrl String The download URL of an SHD HLS file.
shdHlsSize Int The size of an SHD HLS file. Unit: bytes.
shdHlsWidth String The width of an SHD HLS file. The default value is 0.
shdHlsHeight String The height of an SHD HLS file. The default value is 0.
createTime Long The time when a video file is uploaded. Unit: milliseconds.
updateTime Long The time when a video file is updated. Unit: milliseconds.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vid":32}' https://vcloud.163.com/app/vod/video/get

Sample response

{
  "ret": {
    "createTime": 1466578358729,
    "origUrl": "http://vodk32ywxdf.vod.126.net/vodk32ywxdf/44d30332-7402-4b2f-82c8-154dbb6b4e14.mp4",
    "downloadOrigUrl": "http://vodk32ywxdf.nosdn.127.net/44d30332-7402-4b2f-82c8-154dbb6b4e14.mp4?NOSAccessKeyId=ab1856bb39044591939d7b94e1b8e5ee&Expires=1498558005&download=watermark_test_1.mp4&Signature=%2BGu%2BvgiUP1rL4pbx%2B52GH4QCo%2FOHAtlhgzCzPV9f0vc%3D",
    "shdMp4Url": "http://vodk32ywxdf.vod.126.net/vodk32ywxdf/nos/mp4/2016/06/22/v32_shd.mp4",
    "sdMp4Size": 17906823,
    "videoName": "watermark_test_1",
    "downloadSdMp4Url": "http://vodk32ywxdf.nosdn.127.net/nos%2Fmp4%2F2016%2F06%2F22%2Fv32_sd.mp4?NOSAccessKeyId=ab1856bb39044591939d7b94e1b8e5ee&Expires=1498558006&download=%25E6%25A0%2587%25E6%25B8%2585_watermark_test_1.mp4&Signature=64FOWYzLciWyTe8hmLMRVCYRCsQLbEOWtNqcB9rUj18%3D",
    "description": null,
    "hdMp4Size": 25227850,
    "downloadSdFlvUrl": "http://vodk32ywxdf.nosdn.127.net/nos%2Fflv%2F2016%2F06%2F22%2Fv32_sd.flv?NOSAccessKeyId=ab1856bb39044591939d7b94e1b8e5ee&Expires=1498558006&download=%25E6%25A0%2587%25E6%25B8%2585_watermark_test_1.flv&Signature=pGmKYIjWq%2FZE9Gu8K1MZcuqQYG83cI2bnuiikLO8TCk%3D",
    "vid": 32,
    "shdMp4Size": 39874022,
    "sdFlvUrl": "http://vodk32ywxdf.vod.126.net/vodk32ywxdf/nos/flv/2016/06/22/v32_sd.flv",
    "sdFlvSize": 18013302,
    "hdMp4Url": "http://vodk32ywxdf.vod.126.net/vodk32ywxdf/nos/mp4/2016/06/22/v32_hd.mp4",
    "status": 40,
    "updateTime": 1466663164342,
    "sdMp4Url": "http://vodk32ywxdf.vod.126.net/vodk32ywxdf/nos/mp4/2016/06/22/v32_sd.mp4",
    "downloadHdMp4Url": "http://vodk32ywxdf.nosdn.127.net/nos%2Fmp4%2F2016%2F06%2F22%2Fv32_hd.mp4?NOSAccessKeyId=ab1856bb39044591939d7b94e1b8e5ee&Expires=1498558006&download=%25E9%25AB%2598%25E6%25B8%2585_watermark_test_1.mp4&Signature=kMUKJGcW8aSFauL2836pXA5UrEeowq2hLdpgMpjmr44%3D",
    "downloadShdMp4Url": "http://vodk32ywxdf.nosdn.127.net/nos%2Fmp4%2F2016%2F06%2F22%2Fv32_shd.mp4?NOSAccessKeyId=ab1856bb39044591939d7b94e1b8e5ee&Expires=1498558006&download=%25E8%25B6%2585%25E6%25B8%2585_watermark_test_1.mp4&Signature=ch30%2BtX20b54UeskhFZs37r55jkt2WIV87jlaZgKmPY%3D",
    "typeName": "Default type",
    "duration": 195,
    "snapshotUrl": "http://vodk32ywxdf.nosdn.127.net/6c4a9501-ee3c-4e00-9a5f-20f6616f0ad3.jpg",
    "initialSize": 15601202,
    "typeId": 38,
    "completeTime": 1466663164342
  },
  "code": 200
}

Query the information about video files

The API is used to get the list of information about video files and the data is returned in pagination. The information of a single video transcoding template includes the ID, template name, and format to which a video is transcoded using the transcoding template.

URL

POST https://vcloud.163.com/app/vod/video/list

Request parameters

Parameter Type Required Description
currentPage Int Yes The index of the pages on which the video files are displayed.
pageSize Int Yes The number of records displayedper page. Value range: 1 to 500. The value of currentPage multiplied by pageSize cannot exceed 5000.
beginTime Long Yes The start time of a query. Unit: milliseconds.
endTime Long Yes The end time of a query. Unit: milliseconds.
status Int Yes Filter video files by status (0: all status. 10: initial. 20: failure. 30: processing. 40: success. 50: blocked. 70: encrypted. 80: encryption failed).
type Int Yes Filter video files by type (0: all types)
sortStr String Optional Sort video files by the time when the video file is uploaded. The asc value indicates the ascending order while desc indicates the descending order. The default value is desc.

To avoid a large number of records per page breaks, we recommend that you select sortStr based on your needs. For example, if you want to delete video files that were uploaded for a quite long time, you can set sortStr=asc, and call the specific API to delete earlier video files.

Response parameters

Parameter Type Description
code Int The status code.
currentPage Int The current page number.
pageSize Int Number of records on a page.
pageNum Int The total number of pages.
totalRecords Int The number of types to sort the video files.
list List The list of video files.
list.videoName String The name of a video file.
list.status Int The status of a video file. 10: initial. 20: failure. 30: processing. 40: success. 50: blocked.
list.description String The video description.
list.completeTime Long The duration consumed to complete transcoding.
list.duration Int Playback duration. Unit: seconds.
list.durationMsec Int Playback duration. Unit: milliseconds.
list.typeId Int The ID of the type to which the video file belongs.
list.typeName String The name of the type to which the video file belongs.
list.snapshotUrl String The screenshot URL of a video thumbnail.
list.origUrl String The original URL used to play back the video file.
downloadOrigUrl String The original URL address used to download the video file.
list.initialSize Long The size of the original video file. Unit: bytes.
list.sdMp4Url String The playback URL of an SD MP4 file.
list.downloadSdMp4Url String The download URL of an SD MP4 file.
list.sdMp4Size Int The size of an SD MP4 video file. Unit: bytes.
list.hdMp4Url String The playback URL of an HD MP4 file.
list.downloadHdMp4Url String The download URL of an HD MP4 file.
list.hdMp4Size Int The size of an HD MP4 file. Unit: bytes.
list.shdMp4Url String The playback URL of an SHD MP4 file.
list.downloadShdMp4Url String The download URL of an SHD MP4 file.
list.shdMp4Size Int The size of an SHD MP4 file. Unit: bytes.
list.sdFlvUrl String The playback URL of an SD FLV file.
list.downloadSdFlvUrl String The download URL of an SD FLV file.
list.sdFlvSize Int The size of an SD FLV file. Unit: bytes.
list.hdFlvUrl String The playback URL of an HD FLV file.
list.downloadHdFlvUrl String The download URL of an HD FLV file.
list.hdFlvSize Int The size of an HD FLV file. Unit: bytes.
list.shdFlvUrl String The playback URL of an SHD FLV file.
list.downloadShdFlvUrl String The download URL of an SHD FLV file.
list.shdFlvSize Int The size of an SHD FLV file. Unit: bytes.
list.sdHlsUrl String The playback URL of an SD HLS file.
list.downloadSdHlsUrl String The download URL of an SD HLS file.
list.sdHlsSize Int The size of an SD HLS file. Unit: bytes.
list.hdHlsUrl String The playback URL of an HD HLS file.
list.downloadHdHlsUrl String The download URL of an HD HLS file.
list.hdHlsSize Int The size of an HD HLS file. Unit: bytes.
list.shdHlsUrl String The playback URL of an SHD HLS file.
list.downloadShdHlsUrl String The download URL of an SHD HLS file.
list.shdHlsSize Int The size of an SHD HLS file. Unit: bytes.
list.createTime Long The time when a video file is uploaded. Unit: milliseconds.
list.updateTime Long The time when a video file is updated. Unit: milliseconds.
list.vid Long The ID of a video file.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"currentPage":1,"pageSize":2,"status":0,"type":0}' https://vcloud.163.com/app/vod/video/list

Sample response

{
  "ret": {
    "pageSize": 2,
    "totalRecords": 28,
    "list": [
      {
        "typeName": "Default type",
        "createTime": 1467007983618,
        "duration": 0,
        "origUrl": "http://vodk32ywxdf.vod.126.net/vodk32ywxdf/02a32b58-39fa-4d04-aeca-d7defa7e8972.jpg",
        "downloadOrigUrl": "http://vodk32ywxdf.nosdn.127.net/02a32b58-39fa-4d04-aeca-d7defa7e8972.jpg?NOSAccessKeyId=ab1856bb39044591939d7b94e1b8e5ee&Expires=1498558273&download=qwqwqw.jpg&Signature=0b5yMclktt%2FpDBQIZU8bLB6suouXLMfGZhqECFDp8%2Bw%3D",
        "status": 40,
        "updateTime": 1467007983618,
        "description": null,
        "snapshotUrl": null,
        "initialSize": 6354,
        "videoName": "qwqwqw",
        "typeId": 38,
        "completeTime": null,
        "vid": 39
      },
      {
        "typeName": "Default type",
        "createTime": 1467007653656,
        "duration": 0,
        "origUrl": "http://vodk32ywxdf.vod.126.net/vodk32ywxdf/dcffdc0d-0735-41e1-8d30-d1d19450137f.jpg",
        "downloadOrigUrl": "http://vodk32ywxdf.nosdn.127.net/dcffdc0d-0735-41e1-8d30-d1d19450137f.jpg?NOSAccessKeyId=ab1856bb39044591939d7b94e1b8e5ee&Expires=1498558273&download=Chrysanthemum.jpg&Signature=oxa5%2F60xl8dmhtLoS21p97J%2BrnsRWFP12c30oA6Sh3o%3D",
        "status": 40,
        "updateTime": 1467007653656,
        "description": null,
        "snapshotUrl": null,
        "initialSize": 879394,
        "videoName": "Chrysanthemum",
        "typeId": 38,
        "completeTime": null,
        "vid": 38
      }
    ],
    "currentPage": 1,
    "pageNum": 14
  },
  "code": 200
}

Modify the video information

The API is used to manage the video files and modify information about video files. You can modify the file name, type ID, and description of a video file.

URL

POST https://vcloud.163.com/app/vod/video/edit

Request parameters

Parameter Type Required Description
vid Long Yes The ID of a video file.
videoName String Yes The name of the video.
typeId Int Yes The ID of a type to which a video file belongs.
description String Optional The video description.

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vid":20,"videoName":"for_love.mp4","typeId":20,"description":"The edited clip"}' https://vcloud.163.com/app/vod/video/edit

Sample response

{
  "ret": {},
  "code": 200
}

Delete a transcoded video output

The API is used to manage video files and delete an individual transcoded video output. The source video file is not allowed to be deleted.

URL

POST https://vcloud.163.com/app/vod/video/delete_single

Request parameters

Parameter Type Required Description
vid Long Yes The ID of a video file.
style Int Yes The transcoding destination format (1: SD MP4, 2: HD MP4, 3: SHD MP4.
4: SD FLV. 5: HD FLV. 6: SHD FLV.
7: SD HLS. 8: HD HLS. 9: SHD HLS).

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vid":32,"style":3}' https://vcloud.163.com/app/vod/video/delete_single

Sample response

{
  "ret": {},
  "code": 200
}

Delete a source video file

The API is used to manage video files and delete a specified source video file.

URL

POST https://vcloud.163.com/app/vod/video/videoDelete

Request parameters

Parameter Type Required Description
vid Long Yes The ID of a video file.

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vid":32}' https://vcloud.163.com/app/vod/video/videoDelete

Sample response

{
  "ret": {},
  "code": 200
}

Delete multiple video files

The API is used to delete multiple video files at a time.

URL

POST https://vcloud.163.com/app/vod/video/delete

Request parameters

Parameter Type Required Description
vids List Yes An array list that contains multiple video Ids. You can delete up to 50 video files at a time.

Response parameters

Parameter Type Description
code Int The error code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.
724 Some of the video files are deleted.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vids":[20]}' https://vcloud.163.com/app/vod/video/delete

Sample response

"Content-Type": "application/json; charset=utf-8"
{
	"code" : 200,
	"msg" : ""
}

Sample request 2

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vids":[20,21,23,24]}' https://vcloud.163.com/app/vod/video/delete

Sample response 2

"Content-Type": "application/json; charset=utf-8"
{
	"code" : 724,
	"ret" : {
		"failedVids" : [23,24]
	}
}

For more information about codes, see The code status references.

Block video files

The API is used to block specified video files. Only videos in a normal state can be blocked.

URL

POST https://vcloud.163.com/app/vod/video/videoDisable

Request parameters

Parameter Type Required Description
vid Long Yes The ID of a video file.

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vid":35}' https://vcloud.163.com/app/vod/video/videoDisable

Sample response

{
  "ret": {},
  "code": 200
}

Restore a video file

The API is used to restore a video file. Only blocked videos can be restored.

URL

POST https://vcloud.163.com/app/vod/video/videoRecover

Request parameters

Parameter Type Required Description
vid Long Yes The ID of a video file.

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vid":35}' https://vcloud.163.com/app/vod/video/videoRecover

Sample response

{
  "ret": {},
  "code": 200
}

Set expiration time

The API allows you to delete a video file if the file expires.

URL

POST https://vcloud.163.com/app/vod/expire/add

Request parameters

Parameter Type Required Description
vidSet List Yes An array list that contains multiple video IDs. You can delete up to 20 video files at a time.
expireTime Long Yes The absolute expiration time of the video file. Unit: seconds.

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vidSet":[20],"expireTime":1630555269}' https://vcloud.163.com/app/vod/expire/add

Sample response

{
  "ret": {},
  "code": 200
}

Create a video type

The API is used to create a new video type.

URL

POST https://vcloud.163.com/app/vod/type/create

Request parameters

Parameter Type Required Description
typeName String Yes The name of the video type.
parentTypeId Int Optional The ID of the parent type.
description String Optional The description of the video type.

Response parameters

Parameter Type Description
code Int The status code.
typeId Int The new type ID.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d'{"typeName":"movie","parentTypeId":0,"description":"Movie"}' https://vcloud.163.com/app/vod/type/create

Sample response

{
	"ret" : {
		"typeId" : 1
	},
	"code" : 200
}

Query the video type information

The API is used to get the type information of a video file, such as the ID, type description, number of types, and creation time of the type.

URL

POST https://vcloud.163.com/app/vod/type/get

Request parameters

Parameter Type Required Description
typeId Int Yes The ID of a type to which a video file belongs.

Response parameters

Parameter Type Description
code Int The status code.
typeId Int The ID of a video type.
typeName String The name of the video type.
parentTypeId Int The ID of the parent type.
desc String The description of a video type.
number Int The number of video files that belong to this type.
isDel Int Determines whether the video file is allowed to be deleted. The video files of the default type cannot be deleted. 1: allowed, 0: not allowed.
createTime Long The time when a video type is created. Unit: milliseconds.
childNum Int The number of child types.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"typeId":227}' https://vcloud.163.com/app/vod/type/get

Sample response

{
  "ret": {
    "typeName": "movie",
    "createTime": 1467006327149,
    "isDel": 1,
    "desc": "movie",
    "number": 0,
    "typeId": 227,
    "parentTypeId": 0,
    "childNum": 2
  },
  "code": 200
}

Query the video type information

URL

POST https://vcloud.163.com/app/vod/type/list

The API is used to get the list of video types and the data is returned in pagination. The type information of a video file includes the ID, type description, number of types, and creation time of the type.

Request parameters

Parameter Type Required Description
currentPage Int Yes The index of the pages on which the video types are displayed.
pageSize Int Yes Get the number of recordsper page. Value range: 1 to 500.

Response parameters

Parameter Type Description
code Int The status code.
currentPage Int The current page number.
pageSize Int Number of records on a page.
pageNum Int The total number of pages.
totalRecords Int Get the number of types in the list.
list List The list of video types.
list.typeId Int Video type ID.
list.typeName String The name of the video type.
list.parentTypeId Int The ID of the parent type.
list.desc String The description of a video type.
list.number Int The number of video files that belong to this type.
list.isDel Int Determines whether the video file is allowed to be deleted. The video files of the default type cannot be deleted. 1: allowed, 0: not allowed.
list.childNum Int The number of child types.
list.createTime Long The time when a video type is created. Unit: milliseconds.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"currentPage":1,"pageSize":2}' https://vcloud.163.com/app/vod/type/list

Sample response

{
  "ret": {
    "pageSize": 2,
    "totalRecords": 4,
    "list": [
      {
        "typeName": "Default type",
        "createTime": 1464229521940,
        "isDel": 0,
        "desc": "Default type",
        "number": 47,
        "typeId": 38,
        "childNum": 0
      },
      {
        "typeName": "Live streaming recording",
        "createTime": 1464229521940,
        "isDel": 0,
        "desc": "Live streaming recording",
        "number": 1,
        "typeId": 39,
        "childNum": 0
      }
    ],
    "currentPage": 1,
    "pageNum": 2
  },
  "code": 200
}

Query the video type information

The API is used to modify the type of a video file, such as the type name and description.

URL

POST https://vcloud.163.com/app/vod/type/update

Request parameters

Parameter Type Required Description
typeId Int Yes The ID of a type to which a video file belongs.
typeName String Yess The name of the video type.
description String Optional The description of the video type.

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"typeId":227, "typeName":"娱乐","description":"更改分类"}' https://vcloud.163.com/app/vod/type/update

Sample response

{
  "ret": {},
  "code": 200
}

Delete a video type

The API is used to delete a video type.

URL

POST https://vcloud.163.com/app/vod/type/typeDelete

Request parameters

Parameter Type Required Description
typeId Int Yes The ID of a type to which a video file belongs.

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"typeId":227}' https://vcloud.163.com/app/vod/type/typeDelete

Sample response

{
  "ret": {},
  "code": 200
}

Set a video type

The API is used to set a video type.

URL

POST https://vcloud.163.com/app/vod/type/set

Request parameters

Parameter Type Required Description
vid Long Yes The ID of a video file.
typeId Int Yes The ID of a type to which a video file belongs.

Response parameters

Parameter Type Description
code Int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

curl request example

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: 027338bf05cc4a65b5d98bc9d6af80b3" -H "Nonce: 1" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vid":12,"typeId":227}' https://vcloud.163.com/app/vod/type/set

Sample response

{
  "ret": {},
  "code": 200
}

Query uploaded images

The API is used to query the information about uploaded images, such as the upload interface, the image, and watermark files.

URL

POST https://vcloud.163.com/app/vod/image/list

Request parameters

Parameter Type Required Description
currentPage int Yes The current page number. The value is greater than or equal to 1.
pageSize int Yes Value range: 1 to 1000.

Response parameters

The ret schema

Parameter Type Description
totalRecords Long The number of all images.
pageSize Int The number of records on a page.
currentPage Int The current page number.
pageNum Int The total number of pages.
list JsonObject The returned image objects.

The list schema

Parameter Type Description
imageId Long The image ID.
objectKey String The object name.
width int The image width.
height int The image height.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.
724 Some of the video files are deleted.

Example

Sample request

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: xxxxxxxxxxxxxxxxx" -H "Nonce: et4b4r" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"currentPage":1,"pageSize":100}' https://vcloud.163.com/app/vod/image/list

Sample response

{
  "ret": {
    "pageSize": 2,
    "totalRecords": 8,
    "list": [
      {
        "imageId": 1,
        "objectKey": "key1",
        "width":1280,
        "height":720
      },
       {
        "imageId": 2,
        "objectKey": "key2",
        "width":640,
        "height":360
      }
    ],
    "currentPage": 1,
    "pageNum": 4
  },
  "code": 200
}

Query screenshots

Query the screenshots of a video file.

URL

POST https://vcloud.163.com/app/vod/snapshot/get

Request parameters

Parameter Type Required Description
vid long Yes The ID of a video file.

Response parameters

The ret schema

Parameter Type Description
list JsonObject The screenshot information

The list schema

Parameter Type Description
snapshotId long The screenshot ID
vid long The ID of a video file.
objectKey string Object name.
width int The image width.
height int The image height.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.

Example

Sample request

curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: xxxxxxxxxxxxxxxxx" -H "Nonce: ert24" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"vid":100003}' https://vcloud.163.com/app/vod/snapshot/get

Sample response

{
  "ret": {
    "list": [
      {
        "snapshotId": 1,
        "vid":100003,
        "objectKey": "key1",
        "width":1280,
        "height":720
      },
       {
        "snapshotId": 2,
        "vid":100003,
        "objectKey": "key2",
        "width":640,
        "height":360
      }
    ]
  },
  "code": 200
}
  

Delete images

The API is used to delete uploaded images, watermarks, all screenshots of a video file, or a screenshot with a specified ID.

URL

POST https://vcloud.163.com/app/vod/picture/delete

Request parameters

Parameter Type Required Description
deleteIdType string Yes image: uses the imageId.
video: uses the vid and all screenshots of the video file with this vid will be deleted.
snapshot: uses snapshotId
ids long array Yes Delete images with the specified IDs. Up to 100 images can be deleted.

Response parameters

No data return

Parameter Type Description
code int The status code.
msg String The error message.

Response status codes

Status code Description
200 The operation was successful.
400 The request message format is invalid. The message structure is invalid, or the message is incomplete.
700 An internal server error occurred. Try again later or send the complete error message to customer service for help.
710 Authorization failed. See the authentication section in the specified API reference.
711 Invalid request parameter. For more information, see the value of the msg parameter.
720 Access failed. The account has an insufficient balance.
721 The service has not been activated. You can activate the service on the product page.
722 The application to activate the service is under review. You can contact customer service for help.
723 The number of requests exceeds the upper limit.
724 Some of the video files are deleted.

Example

Sample request

// Delete screenshots
curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: xxxxxxxxxxxxxxxxxx" -H "Nonce: 1er11" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"sourceType":"video","ids":[10002,10004]}' https://vcloud.163.com/app/vod/picture/delete

// Delete images
curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: xxxxxxxxxxxxxxxxxx" -H "Nonce: 1er11" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"sourceType":"image","ids":[345]}' https://vcloud.163.com/app/vod/picture/delete

// Delete screenshots
curl -X POST -H "Content-Type: application/json;charset=utf-8" -H "AppKey: xxxxxxxxxxxxxxxxxx" -H "Nonce: 1er11" -H "CurTime: 1465723418" -H "CheckSum: 61bbfd88c51028a2a28b3628584e65a2abe7ae13" -d '{"sourceType":"snapshot","ids":[2345,567,8889]}' https://vcloud.163.com/app/vod/picture/delete

Sample response

{
  "ret": {},
  "code": 200
}
Was this page helpful?
Yes
No
  • Query the video information
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Query the information about video files
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Modify the video information
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Delete a transcoded video output
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Delete a source video file
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Delete multiple video files
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Sample request 2
  • Sample response 2
  • Block video files
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Restore a video file
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Set expiration time
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Create a video type
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Query the video type information
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Query the video type information
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Query the video type information
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Delete a video type
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Set a video type
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • curl request example
  • Sample response
  • Query uploaded images
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • Sample request
  • Sample response
  • Query screenshots
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • Sample request
  • Sample response
  • Delete images
  • URL
  • Request parameters
  • Response parameters
  • Response status codes
  • Example
  • Sample request
  • Sample response