リファレンス
機能: Azure Translator → ドキュメント翻訳
API バージョン: 2024-05-01
HTTP メソッド: GET
このメソッドは、ドキュメント変換機能でサポートされているドキュメント形式の一覧を返します。 アップロード API を使用している場合は、一覧に共通のファイル拡張子とコンテンツ タイプが含まれます。
要求 URL
重要
ドキュメント変換機能に対するすべての API 要求には、Azure portal のリソース概要ページにあるカスタム ドメイン エンドポイントが必要です。
curl -i -X GET "{document-translation-endpoint}/translator/document/formats?api-version={date}&type=document"
要求ヘッダー
要求ヘッダーを次に示します。
| ヘッダー | 説明 |
|---|---|
| Ocp-Apim-Subscription-Key | 必要な要求ヘッダー |
応答状態コード
要求によって返される可能性のある HTTP 状態コードを次に示します。
| 状態コード | 説明 |
|---|---|
| 200 | OK です。 サポートされているドキュメント ファイル形式の一覧を返します。 |
| 500 | 内部サーバー エラー。 |
| その他の状態コード | • 要求が多すぎます • サーバーの一時的な利用不可 |
ファイル形式の応答
成功した fileFormatListResult の応答
成功した応答では、次の情報が返されます。
| 名前 | タイプ | 説明 |
|---|---|---|
| 価値 | FileFormat [] | FileFormat[] には一覧されている詳細が含まれています。 |
| value.contentTypes | string[] | この形式がサポートされているコンテンツの種類。 |
| value.defaultVersion | 文字列 | 何も指定されていない場合は既定のバージョンです。 |
| value.fileExtensions | string[] | この形式がサポートされているファイル拡張子。 |
| value.format | 文字列 | 形式の名前。 |
| value.versions | string [] | サポートされているバージョン。 |
エラー応答
| 名前 | タイプ | 説明 |
|---|---|---|
| コード | 文字列 | 高レベルのエラー コードを含む列挙型。 受け入れ可能な値: • InternalServerError • InvalidArgument • InvalidRequest • RequestRateTooHigh • ResourceNotFound • ServiceUnavailable •不正 |
| メッセージ | 文字列 | 高レベルのエラー メッセージを取得します。 |
| innerError | InnerTranslationError | Foundry Tools API ガイドラインに準拠した新しい内部エラー形式。 このエラー メッセージには、必須プロパティ ErrorCode、message、および省略可能なプロパティ ターゲット、details(キー値ペア)、内部エラー (入れ子にできます) が含まれています。 |
| innerError.code | 文字列 | コード エラー文字列を取得します。 |
| innerError.message | 文字列 | 高レベルのエラー メッセージを取得します。 |
| innerError.target | 文字列 | エラーのソースを取得します。 たとえば、無効なドキュメントの場合には 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"
}
}
}
次のステップ
ドキュメント翻訳とクライアント ライブラリの使用の詳細については、クイック スタートに従ってください。