Delete Video Captions/Subtitles/Chapters

To update the video thumbnail

API URL

Please note that the API URL for video uploads is upload.dyntube.com and not api.dyntube.com.

To delete captions/subtitle file

DELETE https://upload.dyntube.com/v1/videos/captions/?videoId=AA&captionsId=BB

Request Body

Name
Type
Description

videoId*

String

id field of the video.

captionsId*

String

captionsId field of the video.captions.

 {
        "ok": true
 }

Code Samples

C#

using System;
using System.Net.Http;
using System.Net.Http.Headers;

class Program
{
    static void Main(string[] args)
    {
        string videoId = "AA";
        string captionsId = "BB";
        string bearerToken = "your_bearer_token";
        string url = $"https://upload.dyntube.com/v1/videos/captions/?videoId={videoId}&captionsId={captionsId}";

        using (var httpClient = new HttpClient())
        {
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);

            var response = httpClient.DeleteAsync(url).Result;

            if (response.StatusCode == System.Net.HttpStatusCode.OK)
            {
                Console.WriteLine("Captions deleted successfully.");
            }
            else
            {
                Console.WriteLine($"Error deleting captions. Status code: {response.StatusCode}");
            }
        }
    }
}

Node.js

const axios = require('axios');

const videoId = 'AA';
const captionsId = 'BB';
const bearerToken = 'your_bearer_token';
const url = `https://upload.dyntube.com/v1/videos/captions/?videoId=${videoId}&captionsId=${captionsId}`;

axios.delete(url, {
  headers: {
    Authorization: `Bearer ${bearerToken}`
  }
})
.then(response => {
  console.log('Captions deleted successfully.');
})
.catch(error => {
  console.error(`Error deleting captions. Status code: ${error.response.status}`);
});

Python

import requests

video_id = 'AA'
captions_id = 'BB'
bearer_token = 'your_bearer_token'
url = f'https://upload.dyntube.com/v1/videos/captions/?videoId={video_id}&captionsId={captions_id}'

headers = {'Authorization': f'Bearer {bearer_token}'}

response = requests.delete(url, headers=headers)

if response.status_code == 200:
    print('Captions deleted successfully.')
else:
    print(f'Error deleting captions. Status code: {response.status_code}')

PHP

<?php

$videoId = 'AA';
$captionsId = 'BB';
$bearerToken = 'your_bearer_token';
$url = "https://upload.dyntube.com/v1/videos/captions/?videoId={$videoId}&captionsId={$captionsId}";

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  "Authorization: Bearer {$bearerToken}"
));

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($httpCode == 200) {
  echo "Captions deleted successfully.\n";
} else {
  echo "Error deleting captions. Status code: {$httpCode}\n";
}

curl_close($ch);

Last updated