Usuń projekt
curl --request DELETE \
--url https://api.voicecheap.ai/v1/translate/{projectId} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.voicecheap.ai/v1/translate/{projectId}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.voicecheap.ai/v1/translate/{projectId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voicecheap.ai/v1/translate/{projectId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.voicecheap.ai/v1/translate/{projectId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.voicecheap.ai/v1/translate/{projectId}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicecheap.ai/v1/translate/{projectId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"projectId": "<string>"
}Tłumaczenie
Usuń projekt
Trwałe usuwanie projektu tłumaczeniowego
Usuń projekt
curl --request DELETE \
--url https://api.voicecheap.ai/v1/translate/{projectId} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.voicecheap.ai/v1/translate/{projectId}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.voicecheap.ai/v1/translate/{projectId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voicecheap.ai/v1/translate/{projectId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.voicecheap.ai/v1/translate/{projectId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.voicecheap.ai/v1/translate/{projectId}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicecheap.ai/v1/translate/{projectId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"projectId": "<string>"
}Usuń projekt
Trwale usuwa projekt tłumaczeniowy oraz powiązane z nim zasoby. To czyszczenie usuwa również wszelkie zapisane przykładowe pliki podglądu klonowania głosu, które zostały wygenerowane dla projektu. Jeśli niektóre wewnętrzne wygenerowane pliki lub rekordy segmentów zostały już usunięte przed zakończeniem usuwania, czyszczenie jest kontynuowane w trybie najlepszych starań i nadal finalizuje usuwanie projektu.Ta operacja jest nieodwracalna. Projekt, prace, wygenerowane zasoby multimedialne oraz zapisane przykładowe pliki podglądu głosu zostaną usunięte.
Żądanie
Nagłówki
string
wymagane
Twój klucz API VoiceCheap. Uzyskaj go z app.voicecheap.ai/page-api.
Parametry ścieżki
string
wymagane
Unikalny identyfikator projektu tłumaczeniowego do usunięcia.
Odpowiedź
boolean
wymagane
Wskazuje, że operacja usuwania zakończyła się pomyślnie.
string
wymagane
Czytelny dla człowieka komunikat potwierdzający.
string
wymagane
ID usuniętego projektu.
Przykłady
curl -X DELETE "https://api.voicecheap.ai/v1/translate/abc123-def456-ghi789" \
-H "x-api-key: vc_your-api-key"
interface DeleteProjectResponse {
success: true;
message: string;
projectId: string;
}
async function deleteProject(projectId: string): Promise<DeleteProjectResponse> {
const response = await fetch(
`https://api.voicecheap.ai/v1/translate/${projectId}`,
{
method: 'DELETE',
headers: {
'x-api-key': 'vc_your-api-key',
},
},
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.message || 'Failed to delete project');
}
return response.json();
}
// Usage
deleteProject('abc123-def456-ghi789')
.then((result) => console.log('Deleted:', result.projectId))
.catch((error) => console.error('Error:', error));
import requests
project_id = 'abc123-def456-ghi789'
headers = {'x-api-key': 'vc_your-api-key'}
response = requests.delete(
f'https://api.voicecheap.ai/v1/translate/{project_id}',
headers=headers
)
if not response.ok:
error = response.json()
raise Exception(error.get('message', 'Failed to delete project'))
result = response.json()
print(f"Deleted: {result['projectId']}")
<?php
$apiKey = 'vc_your-api-key';
$projectId = 'abc123-def456-ghi789';
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voicecheap.ai/v1/translate/{$projectId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
"x-api-key: {$apiKey}"
]
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
if (!isset($result['success'])) {
$message = $result['message'] ?? 'Failed to delete project';
throw new Exception($message);
}
echo "Deleted: " . $result['projectId'];
Błędy
| Status | Kod | Opis |
|---|---|---|
| 401 | INVALID_API_KEY | Podany klucz API jest nieprawidłowy |
| 403 | FORBIDDEN | Nie masz uprawnień do usunięcia tego projektu |
| 404 | PROJECT_NOT_FOUND | Określony projekt nie istnieje |
| 429 | RATE_LIMIT_EXCEEDED | Zbyt wiele żądań (limit: 10 żądań na minutę) |
| 500 | INTERNAL_ERROR | Nieoczekiwany błąd serwera |
Czy ta strona była pomocna?

