Delete Custom Vocabulary

📖 Delete Custom Vocabulary

Delete your existing custom vocabulary for a specific language. This action is irreversible.


⚠️ Warning: This action cannot be undone. Once deleted, you will need to recreate your custom vocabulary using the Set Custom Vocabulary endpoint.

import requests

url = "https://api.tor.app/developer/custom_vocabulary"
api_key = "your_api_key"  # Replace with your actual API key

params = {
    "language": "en"  # Supported: en, es, fr, de, it, pt
}

headers = {
    "Authorization": f"Bearer {api_key}"
}

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

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Failed:", response.status_code, response.text)
const axios = require('axios');

const apiKey = 'your_api_key'; // Replace with your actual API key
const url = 'https://api.tor.app/developer/custom_vocabulary';

const params = {
    language: 'en' // Supported: en, es, fr, de, it, pt
};

const headers = {
    'Authorization': `Bearer ${apiKey}`
};

axios.delete(url, { params, headers })
    .then(response => {
        console.log('Success:', response.data);
    })
    .catch(error => {
        console.error('Failed:', error.response ? error.response.data : error.message);
    });
import okhttp3.*;
import org.json.JSONObject;

public class DeleteCustomVocabulary {
    private static final String API_KEY = "your_api_key";

    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient();
        String url = "https://api.tor.app/developer/custom_vocabulary?language=en";

        Request request = new Request.Builder()
            .url(url)
            .delete()
            .addHeader("Authorization", "Bearer " + API_KEY)
            .build();

        try (Response response = client.newCall(request).execute()) {
            if (response.isSuccessful()) {
                System.out.println("Success: " + response.body().string());
            } else {
                System.out.println("Failed: " + response.body().string());
            }
        }
    }
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

public class DeleteCustomVocabulary
{
    private static readonly string apiKey = "your_api_key";

    public static async Task Main()
    {
        var client = new HttpClient();
        var url = "https://api.tor.app/developer/custom_vocabulary?language=en";

        client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");

        var response = await client.DeleteAsync(url);
        var responseContent = await response.Content.ReadAsStringAsync();

        if (response.IsSuccessStatusCode)
        {
            Console.WriteLine("Success: " + responseContent);
        }
        else
        {
            Console.WriteLine("Failed: " + responseContent);
        }
    }
}
package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

const apiKey = "your_api_key"

func main() {
	url := "https://api.tor.app/developer/custom_vocabulary?language=en"

	req, _ := http.NewRequest("DELETE", url, nil)
	req.Header.Set("Authorization", "Bearer "+apiKey)

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)

	if resp.StatusCode == 200 {
		fmt.Println("Success:", string(body))
	} else {
		fmt.Println("Failed:", string(body))
	}
}
<?php
$apiKey = "your_api_key";
$url = "https://api.tor.app/developer/custom_vocabulary?language=en";

$headers = [
    "Authorization: Bearer $apiKey"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    echo "Success: " . $response . "\n";
} else {
    echo "Failed: " . $response . "\n";
}
?>
require 'net/http'
require 'json'
require 'uri'

api_key = "your_api_key"
url = URI("https://api.tor.app/developer/custom_vocabulary?language=en")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = "Bearer #{api_key}"

response = http.request(request)

if response.code.to_i == 200
  puts "Success: #{response.body}"
else
  puts "Failed: #{response.body}"
end
import okhttp3.*

fun main() {
    val apiKey = "your_api_key"
    val url = "https://api.tor.app/developer/custom_vocabulary?language=en"

    val client = OkHttpClient()

    val request = Request.Builder()
        .url(url)
        .delete()
        .addHeader("Authorization", "Bearer $apiKey")
        .build()

    client.newCall(request).execute().use { response ->
        if (response.isSuccessful) {
            println("Success: ${response.body()?.string()}")
        } else {
            println("Failed: ${response.body()?.string()}")
        }
    }
}
import Foundation

let apiKey = "your_api_key"
let url = URL(string: "https://api.tor.app/developer/custom_vocabulary?language=en")!

var request = URLRequest(url: url)
request.httpMethod = "DELETE"
request.addValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let httpResponse = response as? HTTPURLResponse {
        if let data = data, let responseString = String(data: data, encoding: .utf8) {
            if httpResponse.statusCode == 200 {
                print("Success: \(responseString)")
            } else {
                print("Failed: \(responseString)")
            }
        }
    }
}
task.resume()

RunLoop.main.run()
import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  const apiKey = 'your_api_key';
  final url = Uri.parse('https://api.tor.app/developer/custom_vocabulary?language=en');

  final response = await http.delete(
    url,
    headers: {
      'Authorization': 'Bearer $apiKey'
    },
  );

  if (response.statusCode == 200) {
    print('Success: ${response.body}');
  } else {
    print('Failed: ${response.body}');
  }
}

Query Parameters


ParameterTypeRequiredDescription
languagestringNoLanguage code. Supported: en, es, fr, de, it, pt. Default: en

Response


200 OK - Custom Vocabulary Deleted Successfully
{
    "message": "Custom vocabulary deleted successfully",
    "language": "en"
}

404 Not Found - Custom Vocabulary Not Found
{
    "message": "Custom vocabulary not found",
    "language": "en"
}

400 Bad Request - Language Not Supported
{
    "message": "Language not supported. Supported languages: en, es, fr, de, it, pt"
}

401 Unauthorized
{
    "message": "Unauthorized"
}

500 Internal Server Error
{
    "message": "Error deleting custom vocabulary"
}