翻譯任務 API
刪除翻譯任務
POST/v1/translation/delete
透過ID刪除翻譯任務。
- 完整地址
- https://otranslator.com/api/v1/translation/delete
- 認證
- 需要在 Authorization 請求頭中傳入 API Key
- Content-Type
- application/json
- 錯誤格式
- { "error": "Invalid API key." }
注意事項
刪除後任務會被標記為已刪除,並會調用翻譯服務清理任務相關資源。
範例
curl
1curl -X POST 'https://otranslator.com/api/v1/translation/delete' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]"
6}'請求參數
| 參數 | 類型 | 預設 | 描述 | 範例 |
|---|---|---|---|---|
| *taskId | String | - | 翻譯任務ID | - |
響應
| 參數 | 類型 | 預設 | 描述 | 範例 |
|---|---|---|---|---|
| success | Boolean | - | 是否刪除成功 | - |
常見錯誤
401 Missing API key.
The Authorization request header is required.
401 Invalid API key.
The API key does not exist, has been deleted, or is no longer valid.
400 Missing required parameter: taskId.
Provide the taskId returned by the create translation task API.
404 Task not found.
The task does not exist, has been deleted, does not belong to the current API account, or was not created through the API.