サポートされるドキュメントの形式の取得

リファレンス
サービス: Azure AI ドキュメント翻訳
API バージョン: v1.1

サポートされるドキュメント形式の取得メソッドでは、ドキュメント翻訳サービスでサポートされているドキュメント形式の一覧が返されます。 一覧には、共通ファイル拡張子と、アップロード API を使用している場合のコンテンツの種類が含まれます。

要求 URL

GET 要求の送信先は次のとおりです。

GET https://<NAME-OF-YOUR-RESOURCE>.cognitiveservices.azure.com/translator/text/batch/v1.1/documents/formats

カスタム ドメイン名を見つける方法について説明します。

重要

  • ドキュメント翻訳サービスへのすべての API 要求には、カスタム ドメイン エンドポイントが必要です
  • ドキュメント翻訳への HTTP 要求を行うために、Azure portal リソースの [キーとエンドポイント] ページで見つかるエンドポイントも、グローバル Translator エンドポイント api.cognitive.microsofttranslator.com も使用することはできません。

要求ヘッダー

要求ヘッダーを次に示します。

ヘッダー 説明
Ocp-Apim-Subscription-Key 必要な要求ヘッダー

応答状態コード

要求によって返される可能性のある HTTP 状態コードを次に示します。

状態コード 説明
200 OK です。 サポートされているドキュメント ファイル形式の一覧を返します。
500 内部サーバー エラー。
その他の状態コード • 要求が多すぎます
• サーバーの一時的な利用不可

ファイル形式の応答

成功した fileFormatListResult の応答

成功した応答では、次の情報が返されます。

名前 種類 説明
value FileFormat [] FileFormat[] には一覧されている詳細が含まれています。
value.contentTypes string[] この形式がサポートされているコンテンツの種類。
value.defaultVersion string 何も指定されていない場合は既定のバージョンです。
value.fileExtensions string[] この形式がサポートされているファイル拡張子。
value.format string 形式の名前。
value.versions string [] サポートされているバージョン。

エラー応答

名前 種類 説明
code string 高レベルのエラー コードを含む列挙型。 使用可能な値: • InternalServerError
• InvalidArgument
• InvalidRequest
• RequestRateTooHigh
• ResourceNotFound
• ServiceUnavailable
•不正
message string 高レベルのエラー メッセージを取得します。
innerError InnerTranslationError Azure AI サービス API のガイドラインに準拠した新しい内部エラー形式。 このエラー メッセージには、必須プロパティ ErrorCode、message、および省略可能なプロパティ ターゲット、details(キー値ペア)、内部エラー (入れ子にできます) が含まれています。
innerError.code string コード エラー文字列を取得します。
innerError.message string 高レベルのエラー メッセージを取得します。
innerError.target string エラーのソースを取得します。 たとえば、無効なドキュメントの場合には documentsdocument id になります。

成功した応答の例

次の JSON オブジェクトは、成功時の応答の例です。

状態コード:200

{
    "value": [
        {
            "format": "PlainText",
            "fileExtensions": [
                ".txt"
            ],
            "contentTypes": [
                "text/plain"
            ],
            "versions": []
        },
        {
            "format": "OpenXmlWord",
            "fileExtensions": [
                ".docx"
            ],
            "contentTypes": [
                "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
            ],
            "versions": []
        },
        {
            "format": "OpenXmlPresentation",
            "fileExtensions": [
                ".pptx"
            ],
            "contentTypes": [
                "application/vnd.openxmlformats-officedocument.presentationml.presentation"
            ],
            "versions": []
        },
        {
            "format": "OpenXmlSpreadsheet",
            "fileExtensions": [
                ".xlsx"
            ],
            "contentTypes": [
                "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
            ],
            "versions": []
        },
        {
            "format": "OutlookMailMessage",
            "fileExtensions": [
                ".msg"
            ],
            "contentTypes": [
                "application/vnd.ms-outlook"
            ],
            "versions": []
        },
        {
            "format": "HtmlFile",
            "fileExtensions": [
                ".html",
                ".htm"
            ],
            "contentTypes": [
                "text/html"
            ],
            "versions": []
        },
        {
            "format": "PortableDocumentFormat",
            "fileExtensions": [
                ".pdf"
            ],
            "contentTypes": [
                "application/pdf"
            ],
            "versions": []
        },
        {
            "format": "XLIFF",
            "fileExtensions": [
                ".xlf"
            ],
            "contentTypes": [
                "application/xliff+xml"
            ],
            "versions": [
                "1.0",
                "1.1",
                "1.2"
            ]
        },
        {
            "format": "TSV",
            "fileExtensions": [
                ".tsv",
                ".tab"
            ],
            "contentTypes": [
                "text/tab-separated-values"
            ],
            "versions": []
        },
        {
            "format": "CSV",
            "fileExtensions": [
                ".csv"
            ],
            "contentTypes": [
                "text/csv"
            ],
            "versions": []
        },
        {
            "format": "RichTextFormat",
            "fileExtensions": [
                ".rtf"
            ],
            "contentTypes": [
                "application/rtf"
            ],
            "versions": []
        },
        {
            "format": "WordDocument",
            "fileExtensions": [
                ".doc"
            ],
            "contentTypes": [
                "application/msword"
            ],
            "versions": []
        },
        {
            "format": "PowerpointPresentation",
            "fileExtensions": [
                ".ppt"
            ],
            "contentTypes": [
                "application/vnd.ms-powerpoint"
            ],
            "versions": []
        },
        {
            "format": "ExcelSpreadsheet",
            "fileExtensions": [
                ".xls"
            ],
            "contentTypes": [
                "application/vnd.ms-excel"
            ],
            "versions": []
        },
        {
            "format": "OpenDocumentText",
            "fileExtensions": [
                ".odt"
            ],
            "contentTypes": [
                "application/vnd.oasis.opendocument.text"
            ],
            "versions": []
        },
        {
            "format": "OpenDocumentPresentation",
            "fileExtensions": [
                ".odp"
            ],
            "contentTypes": [
                "application/vnd.oasis.opendocument.presentation"
            ],
            "versions": []
        },
        {
            "format": "OpenDocumentSpreadsheet",
            "fileExtensions": [
                ".ods"
            ],
            "contentTypes": [
                "application/vnd.oasis.opendocument.spreadsheet"
            ],
            "versions": []
        },
        {
            "format": "Markdown",
            "fileExtensions": [
                ".markdown",
                ".mdown",
                ".mkdn",
                ".md",
                ".mkd",
                ".mdwn",
                ".mdtxt",
                ".mdtext",
                ".rmd"
            ],
            "contentTypes": [
                "text/markdown",
                "text/x-markdown",
                "text/plain"
            ],
            "versions": []
        },
        {
            "format": "Mhtml",
            "fileExtensions": [
                ".mhtml",
                ".mht"
            ],
            "contentTypes": [
                "message/rfc822",
                "application/x-mimearchive",
                "multipart/related"
            ],
            "versions": []
        }
    ]
}

エラー応答の例

次の JSON オブジェクトは、エラー応答の例です。 他のエラー コードのスキーマも同じです。

状態コード: 500

{
  "error": {
    "code": "InternalServerError",
    "message": "Internal Server Error",
    "innerError": {
      "code": "InternalServerError",
      "message": "Unexpected internal server error has occurred"
    }
  }
}

次のステップ

クイックスタートに従って、ドキュメント翻訳とクライアント ライブラリの使用について学習します。