API Tugasan Terjemahan
Dapatkan terjemahan
Dapatkan teks asal dan terjemahan yang sepadan dalam format JSON
- Alamat lengkap
- https://otranslator.com/api/v1/translation/queryTexts
- Pengesahan
- Perlu memasukkan API Key dalam pengepala permintaan Authorization
- Content-Type
- application/json
- Format salah
- { "error": "Invalid API key." }
Perkara Perhatian
API ini mengembalikan teks berstruktur dalam cache terjemahan, sesuai untuk semakan terjemahan, pemprosesan sekunder atau penyegerakan ke sistem perniagaan.
Jika tugas belum menjana cache teks, texts dan revisedTexts akan mengembalikan objek kosong.
Contoh
1curl -X POST 'https://otranslator.com/api/v1/translation/queryTexts' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]"
6}'Parameter Permintaan
| Parameter | Jenis | Lalai | Keterangan | Contoh |
|---|---|---|---|---|
| *taskId | String | - | ID tugas penterjemahan | - |
Respons
| Parameter | Jenis | Lalai | Keterangan | Contoh |
|---|---|---|---|---|
| taskId | String | - | ID tugas penterjemahan | - |
| texts | JSON | - | JSON yang sepadan dengan teks asal dan terjemahan | - |
| revisedTexts | JSON | - | Teks asal dan terjemahan yang telah disemak semula | - |
Ralat Biasa
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.