Schritt 1. Reichen Sie die AI-Jobanfrage ein
Endpunkt: POST - /api/v1/content/translate
| Attribut |
Typ |
Obligatorisch |
Beschreibung |
| content |
String |
Ja |
Geben Sie den zu übersetzenden Inhalt an. |
| language |
String |
Nein |
Geben Sie die Sprache des Inhalts an, der übersetzt werden soll. Z.B. 'Deutsch' |
| voice_tone |
String |
Nein |
Geben Sie den Tonfall des Outputs an. Es können Adjektive wie lustig oder freudig sein oder sogar der Name eines berühmten Schriftstellers. |
| context |
String |
Nein |
Geben Sie zusätzlichen Kontext zum übersetzten Text an, wie z.B. Anwendungsbeispiele oder zusätzliche Erklärungen. |
ANFRAGEBEISPIEL:
{
"content": "La montée du niveau de la mer menace d'engloutir les Maldives où l'eau douce commence déjà à manquer, mais le nouveau président de l'archipel de l'océan Indien refuse toute relocalisation de sa population à l'étranger. Dans un entretien à l'AFP, le président Mohamed Muizzu, un ingénieur du génie civil de 45 ans, formé au Royaume-Uni, promet au contraire un ambitieux programme de réhabilitation des terres et de surélévation des îles, que critiquent des organisations environnementales.",
"language": "English",
"voice_tone": "neutral",
"context": null
}
ANTWORTBEISPIEL:
{
"status_url": "https://sharpapi.com/api/v1/content/translate/job/status/5de4887a-0dfd-49b6-8edb-9280e468c210",
"job_id": "5de4887a-0dfd-49b6-8edb-9280e468c210"
}
Schritt 2. Überwachen & Abrufen der AI-Job-Ergebnisse
Endpunkt: GET - /api/v1/content/translate/job/status/:uuid
Ein Endpunkt wird verwendet, um den Fortschritt des angeforderten API-Jobs zu überprüfen.
ERGEBNISBEISPIEL:
{
"data": {
"type": "api_job_result",
"id": "5de4887a-0dfd-49b6-8edb-9280e468c210",
"attributes": {
"status": "success",
"type": "content_translate",
"result": {
"content": "The rise in sea levels threatens to engulf the Maldives where fresh water is already starting to run out, but the new president of the Indian Ocean archipelago refuses any relocation of its population abroad. In an interview with AFP, President Mohamed Muizzu, a 45-year-old civil engineering graduate trained in the United Kingdom, instead promises an ambitious program of land rehabilitation and island elevation, which environmental organizations criticize.",
"to_language": "English",
"from_language": "French"
}
}
}
}