Skip to main content

List all files of a video including captions and posters

Every video uploaded to VdoCipher starts with an original file. The original file is uploaded from the dashboard or through API. To play it across different browsers and platforms, we create a bunch of files associated with your video including auto-generated and uploaded posters and captions. This API is meant to show a list of these files and their different attributes.

This is the API equivalent of going to the files section in your dashboard through a video's edit icon. The same API is used to render that page also.

Request​

  • Method: GET
  • URL: https://dev.vdocipher.com/api/videos/{videoId}/files/
  • Input params: None
const fs = require('fs');
const rp = require('request-promise-native');

const authHeader = {
authorization: `Apisecret ${process.env.apisecret}`,
};

const listAllFiles = async (videoId) => {
const result = await rp({
url: `https://dev.vdocipher.com/api/videos/${videoId}/files/`,
method: 'GET',
headers: authHeader,
json: true,
});
console.log(result);
};

// replace with real value
const videoId = '____';
listAllFiles(videoId)
.then(console.log)
.catch((e) => {
if (!e.statusCode) {
throw e;
}
console.error(e.message);
});

Response​

Success​

  • Content-type: application/json

The response will be a JSON Array containing a one entry for each file type. Below are the keys present in each of the file objects

keytypedescription
idintegerunique id of this uploaded file
sizeintegersize in bytes
timestringISO8601 representation of upload time in UTC
enabledintegereither 0 or 1. Value will be 0 for posters which are not enabled. Uploading a new poster sets the enabled property to 0 for existing posters
formatenumvalue will be jpeg for posters and vtt for subtitles
heightnull | integervalid number only for the original file and posters,
widthnull | integervalid number only for the original file and posters,
bitratenull | integernull,
encryption_typeenumvalue will be original for original file
langstringISO-639-1 representation of language
isDownloadablebooleanwhether this file can be downloaded through API or dashboard[1]
isDeletablebooleanwhether this file can be deleted by the account owner[2]

[1]. isDownloadable property has no relation to the end-user's ability to download file. This is a system property and denotes the account-owner's (your) ability to download the file. Original file download is disabled by default for security reasons. Encrypted output files which are actually containers for a number of files can also NOT be downloaded.

[2]. isDeletable property also is a system property. Generated files can not be deleted by the account owner. If you have a need to delete any such files, please reach us at support. You can delete captions uploaded by you.

Sample Response​

[
{
"isDownloadable": true,
"isDeletable": true,
"id": 5805640,
"name": "Pl4kVC0y3l7mm.240.jpeg",
"size": 20604,
"time": "2019-09-26T12:18:50.000Z",
"enabled": 1,
"format": "jpeg",
"video_codec": null,
"audio_codec": null,
"height": 240,
"width": 576,
"bitrate": null,
"encryption_type": "poster",
"lang": null
},
{
"isDownloadable": false,
"isDeletable": true,
"id": 12090147,
"name": "Pl4kVC0y3l7mm.d5qfibytxg.vtt",
"size": 4774,
"time": "2021-04-04T09:22:05.000Z",
"enabled": 1,
"format": "vtt",
"video_codec": null,
"audio_codec": null,
"height": null,
"width": null,
"bitrate": null,
"encryption_type": "subtitle",
"lang": "en"
}
]