Delete captions & posters file
caution
This is a potentially destructive API. Files deleted using this API are removed almost-immediately from our servers. When implementing this API, it is recommended to test with a new trial account and verify that there is no incorrect code and only the desired files are getting deleted.
Use the file listing API to get the correct id of the file.
Use this API to delete captions or posters from videos when over-writing or adding new captions.
Requestβ
- Method:
DELETE
- URL:
https://dev.vdocipher.com/api/videos/{videoId}/files/{id}
- Nodejs
const fs = require('fs');
const rp = require('request-promise-native');
const authHeader = {
authorization: `Apisecret ${process.env.apisecret}`,
};
const deleteFile = async (videoId, fileId) => {
const result = await rp({
url: `https://dev.vdocipher.com/api/videos/${videoId}/files/${fileId}`,
method: 'DELETE',
headers: authHeader,
json: true,
});
console.log(result);
};
// replace with real values
const videoId = '_____';
const fileToDelete = 1000;
deleteFile(videoId, fileToDelete)
.then(console.log)
.catch((e) => {
if (!e.statusCode) {
throw e;
}
console.error(e.message);
});
Responseβ
Successβ
- Content-type:
application/json
{
"message": "Deleted"
}