Partager via

Inconsistent Format Support Between /document/formats Endpoint and Translation APIs in Azure Translator

Arthur-Olivier Fortin 145 Points de réputation
2025-08-14T17:24:49.2933333+00:00

I'm experiencing a discrepancy between the formats returned by the Azure Translator /document/formats endpoint and the formats accepted by the synchronous and asynchronous translation APIs.

When I call:

GET https://{MY_SERVICE_NAME}.azure.com/translator/document/formats?api-version=2024-05-01&type=document

I receive the following response (excerpt):

{
  "value": [
    {
      "format": "PlainText",
      "fileExtensions": [".txt"],
      "contentTypes": ["text/plain"],
      "type": "Document"
    },
    ...
    {
      "format": "StreamJSONFile",
      "fileExtensions": [".json"],
      "contentTypes": ["application/json"],
      "type": "Document"
    }
  ]
}

However, when I try to use these formats with the synchronous or asynchronous translation APIs (also using API version 2024-05-01), I get the following errors:

Synchronous API error:

{
  "error": {
    "code": "InvalidRequest",
    "message": "The format parameter is not valid.",
    "target": "ContentType",
    "innerError": {
      "code": "InvalidFormat",
      "message": "The format parameter is not valid."
    }
  }
}

Asynchronous API error:

{
  "id": "XXX",
  "status": "Failed",
  "error": {
    "code": "ServiceUnavailable",
    "message": "0",
    "target": "Operation",
    "innerError": {
      "message": "0"
    }
  },
  "summary": {
    "total": 1,
    "failed": 1,
    "success": 0,
    "inProgress": 0,
    "notYetStarted": 0,
    "cancelled": 0,
    "totalCharacterCharged": 0
  }
}

The documentation refers to the 2024-05-01 version, so I believe I am using the correct and up-to-date API version.

Could you please clarify:

  • Which formats are actually supported for translation?
  • Why formats like StreamJSONFile are listed but not accepted?
  • Is there a mismatch between the documentation and the actual API behavior?
Azure
Azure

Plateforme et infrastructure de cloud computing pour la génération, le déploiement et la gestion d’applications et de services à travers un réseau mondial de centres de données gérés par Microsoft.


Votre réponse

Les réponses peuvent être marquées comme « Acceptées » par l’auteur de la question et « Recommandées » par les modérateurs, ce qui aide les utilisateurs à savoir que la réponse a résolu le problème de l’auteur.