Share via


지원되는 문서 형식 가져오기

참조
서비스: Azure AI 문서 번역
API 버전: v1.1

지원되는 문서 형식 가져오기 메서드는 문서 번역 서비스에서 지원하는 문서 형식 목록을 반환합니다. 이 목록에는 공용 파일 확장명 및 업로드 API를 사용하는 경우 콘텐츠 형식이 포함되어 있습니다.

요청 URL

다음에 GET 요청을 보냅니다.

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

사용자 지정 do기본 이름을 찾는 방법을 알아봅니다.

Important

  • 문서 번역 서비스에 대한 모든 API 요청에는 사용자 지정 도메인 엔드포인트가 필요합니다.
  • Azure Portal 리소스 ‘키 및 엔드포인트’ 페이지에 있는 엔드포인트나 전역 번역기 엔드포인트(api.cognitive.microsofttranslator.com)를 사용하여 문서 번역에 대한 HTTP 요청을 수행할 수 없습니다.

요청 헤더

요청 헤더는 다음과 같습니다.

헤더 설명
Ocp-Apim-Subscription-Key 필수 요청 헤더

응답 상태 코드

요청을 반환하는 가능한 HTTP 상태 코드는 다음과 같습니다.

상태 코드 Description
200 OK. 지원되는 문서 파일 형식 목록을 반환합니다.
500 내부 서버 오류.
기타 상태 코드 • 요청이 너무 많음
• 서버를 일시적으로 사용할 수 없음

파일 형식 응답

fileFormatListResult 응답 성공

성공적인 응답에서 반환되는 정보는 다음과 같습니다.

이름 형식 설명
value FileFormat [] FileFormat[]에는 나열된 세부 정보가 포함되어 있습니다.
value.contentTypes string[] 이 형식에 대해 지원되는 콘텐츠 형식입니다.
value.defaultVersion string 지정되지 않은 경우 기본 버전입니다.
value.fileExtensions string[] 이 형식에 대해 지원되는 파일 확장명입니다.
value.format string 형식의 이름입니다.
value.versions string [] 지원되는 버전입니다.

오류 응답

이름 형식 설명
코드 string 상위 수준 오류 코드를 포함하는 열거형입니다. 가능한 값: • InternalServerError
• InvalidArgument
• InvalidRequest
• RequestRateTooHigh
• ResourceNotFound
• ServiceUnavailable
•무단
message string 상위 수준 오류 메시지를 가져옵니다.
innerError InnerTranslationError Azure AI 서비스 API 지침을 준수하는 새로운 내부 오류 형식입니다. 이 오류 메시지에는 필수 속성 ErrorCode, 메시지 및 선택적 속성 대상, details(키 값 쌍), 내부 오류(중첩될 수 있음)가 포함됩니다.
innerError.code string 코드 오류 문자열을 가져옵니다.
innerError.message string 상위 수준 오류 메시지를 가져옵니다.
innerError.target string 오류의 원인을 가져옵니다. 예를 들어 유효하지 않은 문서의 경우 documents 또는 document 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"
    }
  }
}

다음 단계

빠른 시작에 따라 문서 번역 및 클라이언트 라이브러리 사용에 대해 자세히 알아보세요.