删除项目
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>"
}翻译
删除项目
永久删除翻译项目
删除项目
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>"
}删除项目
永久删除翻译项目及其关联资产。 此清理操作还会移除为该项目生成的任何已存储的语音克隆预览示例文件。 如果某些内部生成的文件或片段记录在删除完成前已被移除,清理工作将以尽力模式继续进行,并最终完成项目删除。此操作不可逆。项目、作品、生成的媒体资产以及存储的语音预览示例文件都将被删除。
请求
标头
string
必填
您的 VoiceCheap API 密钥。请从 app.voicecheap.ai/page-api 获取。
路径参数
string
必填
要删除的翻译项目的唯一标识符。
响应
boolean
必填
表示删除操作已成功完成。
string
必填
人类可读的确认消息。
string
必填
已删除项目的 ID。
示例
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'];
错误
| 状态 | 代码 | 描述 |
|---|---|---|
| 401 | INVALID_API_KEY | 提供的 API 密钥无效 |
| 403 | FORBIDDEN | 您没有权限删除此项目 |
| 404 | PROJECT_NOT_FOUND | 指定的项目不存在 |
| 429 | RATE_LIMIT_EXCEEDED | 请求过多(限制:每分钟 10 次请求) |
| 500 | INTERNAL_ERROR | 意外的服务器错误 |
此页面对您有帮助吗?

