Delete a Plan
Delete the Plan
Delete a Plan
DELETE
https://api.dyntube.com/v1/plans?id={planId}
Query Parameters
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);
Last updated