Translation Task API
Vertaling herzien
Dien revisie in voor vertaalde teksten in een taak, met optie om vertalingen opnieuw te genereren.
- Volledig adres
- https://shangyiai.com/api/v1/translation/updateTexts
- Authenticatie
- De API Key moet doorgegeven worden in de Authorization-verzoekheader
- Content-Type
- application/json
- Onjuist formaat
- { "error": "Invalid API key." }
Aandachtspunten
revisedTexts wordt naar de vertaalcache van de taak geschreven en wordt gebruikt voor het opslaan van handmatig herziene vertalingen.
Wanneer startTranslation true is, wordt de taakverwerking opnieuw getriggerd na het opslaan van de revisie.
Voorbeeld
1curl -X POST 'https://shangyiai.com/api/v1/translation/updateTexts' \
2--header 'Authorization: [yourSecretKey]' \
3--header 'Content-Type: application/json' \
4--data '{
5 "taskId": "[string]",
6 "revisedTexts": {
7 "key": "value"
8 }
9}'Verzoekparameters
| Parameters | Type | Standaard | Beschrijving | Voorbeeld |
|---|---|---|---|---|
| *taskId | String | - | Vertaalopdracht-ID | - |
| *revisedTexts | JSON | - | Herziene vertaling | - |
| startTranslation | Boolean | false | Of vertalingen opnieuw gegenereerd moeten worden | - |
Reactie
| Parameters | Type | Standaard | Beschrijving | Voorbeeld |
|---|---|---|---|---|
| success | Boolean | - | Is update succesvol | - |
Veelvoorkomende fouten
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.
409 Task is processing. Try again after it finishes.
revisedTexts cannot be updated while the task is processing.