DynTube API
  • Welcome!
  • Key Concepts
  • Quick Start
  • Reference
    • Videos
      • Video Upload via File (Server Side)
      • Video Upload via URL (server side)
      • HTML-Form Client Side Video Uploads
      • Get Video Status
      • Get Videos
      • Get Video
      • Update Video
      • Delete Video
      • Download Original Video
      • Get Video for Mobile App/Custom Player
      • Update Video Image
      • Add Video Captions/Chapters/Subtitles
      • Delete Video Captions/Subtitles/Chapters
      • Create Expirable Links
      • Get Collected Emails
      • Setting Up Webhooks
      • Copy call-to-action (CTA) to Videos
      • Token Authentication
    • Projects
      • Create Project
      • Update a Project
      • Get Projects
      • Get a Project
      • Delete a Project
      • Set default CTA for Project
    • Live Streaming
      • Create a Live Stream
      • Update a Live Stream
      • Get Live Streams
      • Get a Live Stream
      • Count Live Streams
      • Live Streams Limit
      • Get Live Streaming Recording
      • Delete a Live Stream
      • Service and Regions for live streams
    • Channels
      • Get Channels
      • Get Channel
      • Delete Channel
    • Subscriptions
      • Create a Plan
      • Create a Member
      • Attach Plan To Member
      • Get Plans
      • Get Members
      • Get Member's Plans
      • Delete a Plan
    • Analytics
      • Use your User Ids in Analytics
      • Get Video Analytics
    • Javascript Events Methods
      • Plain Javascript Events & Methods
      • Control the Player using React
      • Control the Player in Vue.js
    • Developer Resources
      • How to embed DynTube player in Next.Js
      • How to embed the video player in React
      • How to play DynTube videos in React Native
      • ExoPlayer app to play HLS videos
      • How to embed videos & channels dynamically
      • How to Import Vimeo Videos into DynTube
Powered by GitBook
On this page
  • Delete a single project
  • This endpoint will delete a single project and all of its videos.
  • Code Samples
  • C#
  • Node.js
  • Python
  • PHP
  1. Reference
  2. Projects

Delete a Project

Delete a single project

Please use this endpoint carefully. Please note that all videos inside a project will be deleted permanently when a project is deleted.

This endpoint will delete a single project and all of its videos.

DELETE https://api.dyntube.com/v1/projects/{project-id}

Path Parameters

Name
Type
Description

id

String

Project id

{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
    "title": "Not Found",
    "status": 404,
    "traceId": "00-fc3d66e5001efa41d7ce56-c691caa6cf06b649-00"
}

Code Samples

C#

// This code sends an HTTP DELETE request to delete a project from DynTube.
// Please use this endpoint carefully. Please note that all videos inside a project
// will be deleted permanently when a project is deleted.

using System;
using System.Net.Http;

class Program
{
    static async System.Threading.Tasks.Task Main(string[] args)
    {
        string projectId = "your_project_id";
        string url = $"https://api.dyntube.com/v1/projects/{projectId}";

        using (var httpClient = new HttpClient())
        {
            var response = await httpClient.DeleteAsync(url);

            if (response.IsSuccessStatusCode)
            {
                Console.WriteLine("Project deleted successfully.");
            }
            else
            {
                Console.WriteLine($"Failed to delete project. Status code: {response.StatusCode}");
            }
        }
    }
}

Node.js

const axios = require('axios');

// This code sends an HTTP DELETE request to delete a project from DynTube.
// Please use this endpoint carefully. Please note that all videos inside a project
// will be deleted permanently when a project is deleted.

async function deleteProject(projectId) {
  const url = `https://api.dyntube.com/v1/projects/${projectId}`;

  try {
    const response = await axios.delete(url);

    if (response.status === 200) {
      console.log('Project deleted successfully.');
    } else {
      console.log(`Failed to delete project. Status code: ${response.status}`);
    }
  } catch (error) {
    console.error(`Error deleting project: ${error.message}`);
  }
}

deleteProject('your_project_id');

Python

import requests

# This code sends an HTTP DELETE request to delete a project from DynTube.
# Please use this endpoint carefully. Please note that all videos inside a project
# will be deleted permanently when a project is deleted.

project_id = "your_project_id"
url = f"https://api.dyntube.com/v1/projects/{project_id}"

response = requests.delete(url)

if response.status_code == 200:
    print("Project deleted successfully.")
else:
    print(f"Failed to delete project. Status code: {response.status_code}")

PHP

<?php

// This code sends an HTTP DELETE request to delete a project from DynTube.
// Please use this endpoint carefully. Please note that all videos inside a project
// will be deleted permanently when a project is deleted.

$projectId = 'your_project_id';
$url = "https://api.dyntube.com/v1/projects/{$projectId}";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($http_code == 200) {
    echo "Project deleted successfully.";
} else {
    echo "Failed to delete project. Status code: {$http_code}";
}

curl_close($ch);

?>

PreviousGet a ProjectNextSet default CTA for Project

Last updated 2 years ago