Document Translation - Get Supported Document Formats
Returns a list of supported document formats
The list of supported document formats supported by the Document Translation service.
The list includes the common file extension, as well as the content-type if using the upload API.
GET {endpoint}/translator/text/batch/v1.0/documents/formats
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
endpoint
|
path | True |
string |
Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). |
Request Header
Name | Required | Type | Description |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
Provide your cognitive services subscription key here. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Returns the list of supported document file formats Headers Retry-After: integer |
|
429 Too Many Requests |
Too many requests |
|
500 Internal Server Error |
Internal Server Error |
|
Other Status Codes |
Server temporary unavailable |
Security
Ocp-Apim-Subscription-Key
Provide your cognitive services subscription key here.
Type:
apiKey
In:
header
Examples
Get Document Formats
Sample request
GET {endpoint}/translator/text/batch/v1.0/documents/formats
Sample response
{
"error": {
"code": "RequestRateTooHigh",
"message": "User's request rate is too high",
"innerError": {
"code": "RateTooHigh",
"message": "Request rate is too high"
}
}
}
{
"error": {
"code": "InternalServerError",
"message": "Internal Server Error",
"innerError": {
"code": "InternalServerError",
"message": "Unexpected internal server error has occurred"
}
}
}
{
"error": {
"code": "ServiceUnavailable",
"message": "Service is temporary unavailable",
"innerError": {
"code": "ServiceTemporaryUnavailable",
"message": "Service is currently unavailable. Please try again later"
}
}
}
retry-after: 30
ETag: 686897696a7c876b7e
{
"value": [
{
"format": "PlainText",
"fileExtensions": [
".txt"
],
"contentTypes": [
"text/plain"
]
},
{
"format": "PortableDocumentFormat",
"fileExtensions": [
".pdf"
],
"contentTypes": [
"application/pdf"
]
},
{
"format": "OpenXmlWord",
"fileExtensions": [
".docx"
],
"contentTypes": [
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
]
},
{
"format": "OpenXmlPresentation",
"fileExtensions": [
".pptx"
],
"contentTypes": [
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
]
},
{
"format": "OpenXmlSpreadsheet",
"fileExtensions": [
".xlsx"
],
"contentTypes": [
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
]
},
{
"format": "HtmlFile",
"fileExtensions": [
".html",
".htm"
],
"contentTypes": [
"text/html"
]
}
]
}
Definitions
Name | Description |
---|---|
File |
|
Inner |
New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow. This contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested). |
Supported |
Base type for List return in our api |
Translation |
This contains an outer error with error code, message, details, target and an inner error with more descriptive details. |
Translation |
Enums containing high level error codes. |
Translation |
Contains unified error information used for HTTP responses across any Cognitive Service. Instances can be created either through Microsoft.CloudAI.Containers.HttpStatusExceptionV2 or by returning it directly from a controller. |
FileFormat
Name | Type | Description |
---|---|---|
contentTypes |
string[] |
Supported Content-Types for this format |
defaultVersion |
string |
Default version if none is specified |
fileExtensions |
string[] |
Supported file extension for this format |
format |
string |
Name of the format |
versions |
string[] |
Supported Version |
InnerTranslationError
New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow. This contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested).
Name | Type | Description |
---|---|---|
code |
string |
Gets code error string. |
innerError |
New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow. This contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested). |
|
message |
string |
Gets high level error message. |
target |
string |
Gets the source of the error. For example it would be "documents" or "document id" in case of invalid document. |
SupportedFileFormats
Base type for List return in our api
Name | Type | Description |
---|---|---|
value |
list of objects |
TranslationError
This contains an outer error with error code, message, details, target and an inner error with more descriptive details.
Name | Type | Description |
---|---|---|
code |
Enums containing high level error codes. |
|
innerError |
New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow. This contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested). |
|
message |
string |
Gets high level error message. |
target |
string |
Gets the source of the error. For example it would be "documents" or "document id" in case of invalid document. |
TranslationErrorCode
Enums containing high level error codes.
Value | Description |
---|---|
InvalidRequest | |
InvalidArgument | |
InternalServerError | |
ServiceUnavailable | |
ResourceNotFound | |
Unauthorized | |
RequestRateTooHigh |
TranslationErrorResponse
Contains unified error information used for HTTP responses across any Cognitive Service. Instances can be created either through Microsoft.CloudAI.Containers.HttpStatusExceptionV2 or by returning it directly from a controller.
Name | Type | Description |
---|---|---|
error |
This contains an outer error with error code, message, details, target and an inner error with more descriptive details. |