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 the Plan
  • Delete a Plan
  • Code Samples
  • C#
  • Node.js
  • Python
  • PHP
  1. Reference
  2. Subscriptions

Delete a Plan

Delete the Plan

Delete a Plan

DELETE https://api.dyntube.com/v1/plans?id={planId}

Query Parameters

Name
Type
Description

id

String

Plan Id

storePlanType

String

plan type of the store

Code Samples

C#

using System;
using System.Net.Http;

class Program
{
    static async System.Threading.Tasks.Task Main(string[] args)
    {
        string planId = "your_plan_id";
        string url = $"https://api.dyntube.com/v1/plans?id={planId}";

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

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

Node.js

const https = require('https');

const planId = 'your_plan_id';
const url = `https://api.dyntube.com/v1/plans?id=${planId}`;

const options = {
    method: 'DELETE'
};

const req = https.request(url, options, (res) => {
    if (res.statusCode === 204) {
        console.log('Plan deleted successfully.');
    } else {
        console.log(`Failed to delete plan. Status code: ${res.statusCode}`);
    }
});

req.end();

Python

import requests

plan_id = "your_plan_id"
url = f"https://api.dyntube.com/v1/plans?id={plan_id}"

response = requests.delete(url)

if response.status_code == 204:
    print("Plan deleted successfully.")
else:
    print(f"Failed to delete plan. Status code: {response.status_code}")

PHP

<?php

$planId = 'your_plan_id';
$url = "https://api.dyntube.com/v1/plans?id=$planId";

$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);
$httpCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);

if ($httpCode === 204) {
    echo 'Plan deleted successfully.';
} else {
    echo "Failed to delete plan. Status code: $httpCode";
}

curl_close($ch);

PreviousGet Member's PlansNextAnalytics

Last updated 6 months ago