API de tâche de traduction
Obtenir la traduction
Obtenez le texte source et la traduction correspondante extraits par le système, retournés au format JSON
- Adresse complète
- https://otranslator.com/api/v1/translation/queryTexts
- Authentification
- Il est nécessaire de transmettre la clé API dans l'en-tête de requête Authorization
- Content-Type
- application/json
- Format erroné
- { "error": "Invalid API key." }
Points à noter
Cette interface renvoie le texte structuré dans le cache de traduction, adapté à la révision de traduction, au traitement secondaire ou à la synchronisation avec le système métier.
Si la tâche n'a pas encore généré de cache textuel, texts et revisedTexts retourneront des objets vides.
Exemple
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}'Paramètres de requête
| Paramètres | Type | Par défaut | Description | Exemple |
|---|---|---|---|---|
| *taskId | String | - | ID de la tâche de traduction | - |
Réponse
| Paramètres | Type | Par défaut | Description | Exemple |
|---|---|---|---|---|
| taskId | String | - | ID de la tâche de traduction | - |
| texts | JSON | - | JSON correspondant au texte original et à la traduction | - |
| revisedTexts | JSON | - | Texte original et traduction révisés | - |
Erreurs courantes
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.