Desteklenen belge biçimlerini al
Desteklenen belge biçimlerini al yöntemi, Belge Çevirisi hizmeti tarafından desteklenen belge biçimlerinin listesini döndürür. Liste, genel dosya uzantısını ve karşıya yükleme API'sini kullanıyorsanız içerik türünü içerir.
İstek URL’si
Şu GET isteklere istek gönderin:
GET https://<NAME-OF-YOUR-RESOURCE>.cognitiveservices.azure.com/translator/text/batch/v1.0/documents/formats
Özel etki alanı adınızı nasıl bula öğrenin.
Önemli
- Belge Çevirisi hizmetine yapılan tüm API istekleri için özel bir etki alanı uç noktası gerekir.
- Belge Çevirisi'ne HTTP istekleri Azure portal uç noktası veya genel çevirmen uç noktası— için kaynak anahtar ve uç nokta sayfanız üzerinde bulunan uç noktayı
api.cognitive.microsofttranslator.comkullanasınız.
İstek üst bilgileri
İstek üst bilgileri:
| Üst Bilgiler | Description |
|---|---|
| Ocp-Apim-Subscription-Key | Gerekli istek üst bilgisi |
Yanıt durum kodları
Aşağıdakiler, bir isteğin döndürtt olduğu olası HTTP durum kodlarıdır.
| Durum Kodu | Description |
|---|---|
| 200 | Tamam ögesini seçin. Desteklenen belge dosyası biçimlerinin listesini döndürür. |
| 500 | İç Sunucu Hatası. |
| Diğer Durum Kodları |
|
Dosya biçimi yanıtı
Başarılı fileFormatListResult yanıtı
Başarılı bir yanıtta aşağıdaki bilgiler döndürülür.
| Ad | Tür | Description |
|---|---|---|
| değer | FileFormat [] | FileFormat[] aşağıda listelenen ayrıntıları içerir. |
| value.contentTypes | string[] | Bu biçim için Desteklenen İçerik Türleri. |
| value.defaultVersion | string | Hiçbiri belirtilmezse varsayılan sürüm. |
| value.fileExtensions | string[] | Bu biçim için desteklenen dosya uzantısı. |
| value.format | string | Biçimin adı. |
| value.versions | string [] | Desteklenen sürüm. |
Hata yanıtı
| Ad | Tür | Description |
|---|---|---|
| kod | string | Üst düzey hata kodları içeren numaralar. Olası değerler:
|
| message | string | Üst düzey hata iletisi alır. |
| innerError | InnerTranslationError | Bilişsel Hizmetler API Yönergelerine uygun yeni İç Hata biçimi. Bu gerekli ErrorCode, ileti ve isteğe bağlı özellikler hedefi, ayrıntılar (anahtar değer çifti), iç hata (iç içe geçmiş olabilir) özelliklerini içerir. |
| innerError.code | string | Kod hata dizesini alır. |
| innerError.message | string | Üst düzey hata iletisi alır. |
| innerError.target | string | Hatanın kaynağını alır. Örneğin, geçersiz belge olması durumunda "belgeler" veya "belge kimliği" olabilir. |
Örnekler
Örnek başarılı yanıt
Aşağıda, başarılı bir yanıt örneği ve ardından ve bir örnek ve ardından ve bir örnek ve ardından ve daha sonra bir yanıt ve daha sonra ve daha fazla yanıt ve daha
Durum kodu: 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": []
}
]
}
Örnek hata yanıtı
Aşağıda, bir hata yanıtı örneği ve ardından ve bir örnek ve ardından ve bir hata yanıtı ve daha sonra ve daha sonra bir hata yanıtı ve daha sonra ve daha fazla Diğer hata kodlarının şeması aynıdır.
Durum kodu: 500
{
"error": {
"code": "InternalServerError",
"message": "Internal Server Error",
"innerError": {
"code": "InternalServerError",
"message": "Unexpected internal server error has occurred"
}
}
}
Sonraki adımlar
Belge Çevirisi ve istemci kitaplığını kullanma hakkında daha fazla bilgi edinmek için hızlı başlangıç sayfamızı izleyin.