PowerPlatformConnectors/certified-connectors/TranslatorV3/apiDefinition.swagger.json

1805 строки
60 KiB
JSON

{
"swagger": "2.0",
"info": {
"title": "Microsoft Translator V3",
"description": "Microsoft Azure Cognitive Services Translator lets you to translate text and documents over 100 languages using general or custom models.",
"x-ms-api-annotation": {
"status": "Preview"
},
"version": "3.0",
"contact": {
"name": "Microsoft Translator",
"url": "https://learn.microsoft.com/azure/cognitive-services/translator/translator-overview",
"email": "mtfb@microsoft.com"
}
},
"host": "translator-batch-test.cognitiveservices.azure.com",
"basePath": "/",
"schemes": [
"https"
],
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://learn.microsoft.com/azure/cognitive-services/translator/translator-overview"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://privacy.microsoft.com/"
},
{
"propertyName": "Categories",
"propertyValue": "AI;Business Intelligence"
}
],
"consumes": [],
"produces": [],
"paths": {
"/translator/text/v3.0/translate": {
"post": {
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/TranslationResults"
}
}
},
"400": {
"description": "Bad Request. Invalid request. Check input parameters.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "Unauthorized. Check your credentials.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"403": {
"description": "The request isn't authorized. Check the details of the error message. This status code often indicates that all free translations provided with a trial subscription have been used up.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"408": {
"description": "The request couldn't be fulfilled because a resource is missing.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"429": {
"description": "The server rejected the request because the client has exceeded request limits.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"503": {
"description": "Service is currently unavailable. Try again later.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"summary": "Translate text",
"description": "Translate specified source language text into the target language text.",
"operationId": "Translate",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "Content-Type",
"description": "Content type like application/json.",
"default": "application/json",
"in": "header",
"required": true,
"type": "string",
"x-ms-visibility": "internal"
},
{
"name": "api-version",
"description": "Version of the API requested by the client. Value must be 3.0.",
"default": "3.0",
"in": "query",
"required": true,
"type": "string",
"x-ms-visibility": "internal"
},
{
"name": "from",
"in": "query",
"required": true,
"description": "The source language code (example: 'en'). If the source language code isn't specified, automatic language detection is applied to determine the source language.",
"x-ms-summary": "Source language",
"default": "Auto-detect",
"x-ms-dynamic-values": {
"operationId": "GetTranslateSupportedSourceLanguages",
"value-path": "Code",
"value-title": "Name"
},
"type": "string"
},
{
"name": "to",
"in": "query",
"description": "The target language code (example: 'fr').",
"required": true,
"x-ms-summary": "Target language",
"x-ms-dynamic-values": {
"operationId": "GetTranslateSupportedLanguages",
"value-path": "Code",
"value-title": "Name"
},
"type": "string",
"x-ms-test-value": "en"
},
{
"name": "textType",
"in": "query",
"description": "Defines whether the text format being translated is plain text or HTML.",
"required": false,
"x-ms-summary": "Text type",
"x-ms-visibility": "advanced",
"default": "plain",
"type": "string",
"enum": [
"plain",
"html"
]
},
{
"name": "profanityAction",
"in": "query",
"description": "Specifies how profanities should be treated in translations.",
"required": false,
"x-ms-summary": "Profanity action",
"x-ms-visibility": "advanced",
"default": "NoAction",
"type": "string",
"enum": [
"NoAction",
"Marked",
"Deleted"
]
},
{
"name": "profanityMarker",
"in": "query",
"description": "Specifies how profanities should be marked in translations.",
"required": false,
"x-ms-summary": "Profanity marker",
"x-ms-visibility": "advanced",
"default": "Asterisk",
"type": "string",
"enum": [
"Asterisk",
"Tag"
]
},
{
"name": "includeSentenceLength",
"in": "query",
"description": "Specifies whether to include sentence boundaries for the input text and the translated text.",
"required": false,
"x-ms-summary": "Include sentence length",
"x-ms-visibility": "advanced",
"default": "false",
"type": "string",
"enum": [
"false",
"true"
]
},
{
"name": "suggestedFrom",
"in": "query",
"description": "Specifies a fallback language if the language of the input text can't be identified.",
"required": false,
"x-ms-summary": "Suggested source language",
"x-ms-visibility": "advanced",
"x-ms-dynamic-values": {
"operationId": "GetTranslateSupportedLanguages",
"value-path": "Code",
"value-title": "Name"
},
"type": "string"
},
{
"name": "fromScript",
"in": "query",
"description": "The name of the script of the input text.",
"required": false,
"x-ms-summary": "Script of the source text",
"x-ms-visibility": "advanced",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationFromScripts",
"parameters": {
"language": {
"parameter": "from"
}
},
"value-path": "Code",
"value-title": "Name"
},
"x-ms-test-value": "Latn",
"type": "string"
},
{
"name": "toScript",
"in": "query",
"description": "The name of the script of the translated text.",
"required": false,
"x-ms-summary": "Script of the translated text",
"x-ms-visibility": "advanced",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationToScriptsForLanguage",
"parameters": {
"language": {
"parameter": "to"
}
},
"value-path": "Code",
"value-title": "Name"
},
"x-ms-test-value": "Latn",
"type": "string"
},
{
"name": "category",
"in": "query",
"description": "A string specifying the category (domain) of the translation. This parameter is used to get translations from a customized system built with Custom Translator.",
"required": false,
"x-ms-summary": "Category",
"x-ms-visibility": "advanced",
"default": "general",
"type": "string"
},
{
"name": "allowFallback",
"in": "query",
"description": "Specifies that the service is allowed to fall back to a general system when a custom system doesn't exist.",
"required": false,
"x-ms-summary": "Allow fallback to general domain",
"x-ms-visibility": "advanced",
"default": "false",
"type": "string",
"enum": [
"true",
"false"
]
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Text": {
"type": "string",
"title": "Text",
"description": "Text to translate.",
"x-ms-visibility": "important",
"default": "Hello"
}
},
"required": [
"Text"
]
},
"required": [
"items"
]
}
}
]
}
},
"/translator/text/v3.0/transliterate": {
"post": {
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/TransliterationResults"
}
}
},
"400": {
"description": "Invalid request. Check input parameters.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "Unauthorized. Check your credentials.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"403": {
"description": "The request is not authorized. Check the details of the error message. This often indicates that all free translations provided with a trial subscription have been used up.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"429": {
"description": "Request rate is too high.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"503": {
"description": "Service is currently unavailable. Try again later.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"summary": "Transliterate",
"description": "Converts text in one language from one script to another script.",
"operationId": "Transliterate",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "Content-Type",
"description": "Content type like application/json.",
"default": "application/json",
"in": "header",
"required": true,
"type": "string",
"x-ms-visibility": "internal"
},
{
"name": "api-version",
"description": "Version of the API requested by the client. Value must be 3.0.",
"default": "3.0",
"in": "query",
"required": true,
"type": "string",
"x-ms-visibility": "internal"
},
{
"name": "language",
"in": "query",
"description": "Specifies the language of the text to convert from one script to another.",
"required": true,
"x-ms-summary": "Language",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationLanguages",
"value-path": "Code",
"value-title": "Name"
},
"type": "string",
"x-ms-test-value": "en"
},
{
"name": "fromScript",
"in": "query",
"description": "The name of the script of the input text.",
"required": true,
"x-ms-summary": "Source script",
"x-ms-visibility": "important",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationFromScripts",
"parameters": {
"language": {
"parameter": "language"
}
},
"value-path": "Code",
"value-title": "Name"
},
"x-ms-test-value": "Latn",
"type": "string"
},
{
"name": "toScript",
"in": "query",
"description": "The name of the script of the transliterated text.",
"required": true,
"x-ms-summary": "Target script",
"x-ms-visibility": "important",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationToScripts",
"parameters": {
"language": {
"parameter": "language"
},
"fromScript": {
"parameter": "fromScript"
}
},
"value-path": "Code",
"value-title": "Name"
},
"x-ms-test-value": "Latn",
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Text": {
"type": "string",
"title": "Text",
"description": "Text to translate.",
"x-ms-visibility": "important",
"default": "Hello"
}
},
"required": [
"Text"
]
},
"required": [
"items"
]
}
}
],
"x-ms-visibility": "important"
}
},
"/translator/text/batch/v1.1/batches/": {
"post": {
"responses": {
"202": {
"description": "Successful. The batch request is created.",
"schema": {
"type": "object",
"properties": {
"operationID": {
"description": "Operation ID.",
"type": "string"
}
}
},
"headers": {
"apim-request-id": {
"description": "Apim request id.",
"type": "string"
},
"content-length": {
"description": "Content length. ",
"type": "integer"
},
"date": {
"description": "Date and time in which the request is submitted.",
"type": "string"
},
"operation-location": {
"description": "The header Operation-Location will indicate a status url with the operation ID.HeadersOperation-Location: string",
"type": "string"
},
"request-context": {
"description": "Request context.",
"type": "string"
},
"strict-transport-security": {
"description": "Strict transport security.",
"type": "string"
},
"x-content-type-options": {
"description": "Content types for this document format.",
"type": "string"
},
"x-ms-function-status": {
"description": "Status of document translation job.",
"type": "string"
},
"x-powered-by": {
"description": "X-powered by.",
"type": "string"
},
"x-requestid": {
"description": "Document translation request ID. Value of this is same as APIM request Id",
"type": "string"
}
}
},
"400": {
"description": "Invalid request. Check input parameters.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "Unauthorized. Check your credentials.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"429": {
"description": "Request rate is too high.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"503": {
"description": "Service is currently unavailable. Try again later.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Operation Failed."
}
},
"summary": "Start document translation",
"description": "This action starts a document translation job.",
"operationId": "StartDocumentTranslation",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"name": "Content-Type",
"description": "Content type like application/json.",
"default": "application/json",
"in": "header",
"required": true,
"type": "string",
"x-ms-visibility": "internal"
},
{
"name": "Input",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/DocumentTranslationRequest"
}
}
]
}
},
"/translator/text/batch/v1.1/batches/{id}": {
"get": {
"responses": {
"200": {
"description": "Response OK.",
"schema": {
"$ref": "#/definitions/TranslationStatusResponse"
}
},
"401": {
"description": "Unauthorized. Check your credentials.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"404": {
"description": "Resource is not found.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"default": {
"description": "Operation Failed."
}
},
"summary": "Get translation status",
"description": "Gets a summary of the status for a specific document translation request.",
"operationId": "GetTranslationStatus",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"description": "The operation ID.",
"x-ms-summary": "Operation ID",
"x-ms-visibility": "important"
}
]
},
"delete": {
"responses": {
"200": {
"description": "Response OK.",
"schema": {
"$ref": "#/definitions/TranslationStatusResponse"
}
},
"401": {
"description": "Unauthorized. Check your credentials.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"404": {
"description": "Resource is not found.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"default": {
"description": "Operation Failed."
}
},
"summary": "Cancel translation",
"description": "Cancels a document translation job that is currently processing or queued.",
"operationId": "CancelTranslation",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"description": "The operation ID.",
"x-ms-summary": "Operation ID",
"x-ms-visibility": "important"
}
]
}
},
"/translator/text/batch/v1.1/batches": {
"get": {
"responses": {
"200": {
"description": "Response OK.",
"schema": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/TranslationStatusResponse"
},
"description": "Response Value."
},
"@nextLink": {
"type": "string",
"description": "Url for the next page. Null if last page."
}
}
}
},
"400": {
"description": "Bad Request. Invalid request. Check input parameters.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"401": {
"description": "Unauthorized. Check your credentials.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"default": {
"description": "Operation Failed."
}
},
"summary": "Get translations status",
"description": "Gets a list along with the status of all translation requests submitted by the user.",
"operationId": "GetTranslationsStatus",
"parameters": [
{
"name": "$top",
"in": "query",
"required": false,
"type": "integer",
"description": "The total number of records the user wants to be returned across all pages.",
"x-ms-summary": "Total number of records to return",
"format": "int32",
"x-ms-visibility": "advanced"
},
{
"name": "$skip",
"in": "query",
"required": false,
"type": "integer",
"description": "The number of records to skip from the list based on the sorting method.",
"x-ms-summary": "Number of records to skip",
"x-ms-visibility": "advanced",
"format": "int32"
},
{
"name": "$maxpagesize",
"in": "query",
"required": false,
"type": "integer",
"description": "The maximum records returned in a page.",
"x-ms-summary": "Maximum records returned",
"x-ms-visibility": "advanced",
"format": "int32"
},
{
"name": "$orderBy",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"description": "The sorting query for the collection, eg.,'CreatedDateTimeUtc asc', 'CreatedDateTimeUtc desc'.",
"x-ms-summary": "Sort by",
"x-ms-visibility": "advanced"
},
{
"name": "createdDateTimeUtcStart",
"in": "query",
"required": false,
"type": "string",
"description": "The start datetime to get records after.",
"x-ms-summary": "Start datetime",
"x-ms-visibility": "advanced",
"format": "date-time"
},
{
"name": "createdDateTimeUtcEnd",
"in": "query",
"required": false,
"type": "string",
"description": "The end datetime to get records before.",
"x-ms-summary": "End datetime",
"x-ms-visibility": "advanced",
"format": "date-time"
},
{
"name": "statuses",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"description": "Statuses to use in filtering.",
"x-ms-summary": "Filter by status",
"x-ms-visibility": "advanced"
},
{
"name": "ids",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"description": "Operation IDs to use in filtering.",
"x-ms-summary": "Filter by operation IDs",
"x-ms-visibility": "advanced"
}
]
}
},
"/translator/text/batch/v1.1/batches/{id}/documents/{documentId}": {
"get": {
"responses": {
"200": {
"description": "Response OK.",
"schema": {
"$ref": "#/definitions/DocumentStatusResponse"
}
},
"401": {
"description": "Unauthorized. Check your credentials.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"description": "Resource is not found..",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Operation Failed."
}
},
"summary": "Get document status",
"description": "Gets the status for a specific document in a job.",
"operationId": "GetDocumentStatus",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"description": "The operation ID.",
"x-ms-summary": "Operation ID",
"x-ms-visibility": "important"
},
{
"name": "documentId",
"in": "path",
"required": true,
"type": "string",
"description": "The document ID.",
"x-ms-summary": "Document ID",
"x-ms-visibility": "important"
}
]
}
},
"/translator/text/batch/v1.1/documents/formats": {
"get": {
"responses": {
"200": {
"description": "Response OK.",
"schema": {
"$ref": "#/definitions/FormatOKResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Operation Failed."
}
},
"summary": "Get supported document formats",
"description": "Gets a list of supported document formats.",
"operationId": "GetSupportedDocumentFormats"
}
},
"/translator/text/batch/v1.1/glossaries/formats": {
"get": {
"responses": {
"200": {
"description": "Response OK.",
"schema": {
"$ref": "#/definitions/FormatOKResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Operation Failed."
}
},
"summary": "Get supported glossary formats",
"description": "Gets a list of supported glossary formats.",
"operationId": "GetSupportedGlossaryFormats"
}
},
"/translator/text/batch/v1.1/storagesources": {
"get": {
"responses": {
"200": {
"description": "Response OK.",
"schema": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"type": "string"
},
"description": "Response Value."
}
}
}
},
"500": {
"description": "Internal server error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Operation failed."
}
},
"summary": "Get supported storage sources",
"description": "Gets a list of supported storage sources/options.",
"operationId": "GetSupportedStorageSources"
}
},
"/translator/text/batch/v1.1/batches/{id}/documents": {
"get": {
"responses": {
"200": {
"description": "Response OK.",
"schema": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Location of the document or folder."
},
"sourcePath": {
"type": "string",
"description": "Location of the source document."
},
"createdDateTimeUtc": {
"type": "string",
"description": "Operation created date time."
},
"lastActionDateTimeUtc": {
"type": "string",
"description": "Date time in which the operation's status has been updated."
},
"status": {
"type": "string",
"description": "List of possible statuses for job or document."
},
"to": {
"type": "string",
"description": "Target language."
},
"progress": {
"type": "integer",
"format": "int32",
"description": "Progress of the translation if available."
},
"id": {
"type": "string",
"description": "Document ID."
},
"characterCharged": {
"type": "integer",
"format": "int32",
"description": "Characters charged by the API."
}
}
},
"description": "Response Value."
},
"@nextLink": {
"type": "string",
"description": "Url for the next page. Null if last page."
}
}
}
},
"400": {
"description": "Bad Request. Invalid request. Check input parameters.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"401": {
"description": "Unauthorized. Check your credentials.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"404": {
"description": "Resource is not found.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"500": {
"description": "Internal Server Error.",
"schema": {
"$ref": "#/definitions/TranslationErrorResponse"
}
},
"default": {
"description": "Operation Failed."
}
},
"summary": "Get documents status",
"description": "Gets the status of all documents in a translation job.",
"operationId": "GetDocumentsStatus",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"type": "string",
"x-ms-visibility": "important",
"description": "The operation ID.",
"x-ms-summary": "Operation ID"
},
{
"name": "$top",
"in": "query",
"required": false,
"type": "integer",
"description": "The total number of records the user wants to be returned across all pages.",
"x-ms-summary": "Total number of records to return",
"format": "int32",
"x-ms-visibility": "advanced"
},
{
"name": "$skip",
"in": "query",
"required": false,
"type": "integer",
"description": "The number of records to skip from the list based on the sorting method.",
"x-ms-summary": "Number of records to skip",
"x-ms-visibility": "advanced",
"format": "int32"
},
{
"name": "$maxpagesize",
"in": "query",
"required": false,
"type": "integer",
"description": "The maximum records returned in a page.",
"x-ms-summary": "Maximum records returned",
"x-ms-visibility": "advanced",
"format": "int32"
},
{
"name": "$orderBy",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"description": "The sorting query for the collection. (Eg., 'CreatedDateTimeUtc asc', 'CreatedDateTimeUtc desc').",
"x-ms-summary": "Sort by",
"x-ms-visibility": "advanced"
},
{
"name": "createdDateTimeUtcStart",
"in": "query",
"required": false,
"type": "string",
"description": "The start datetime to get items after.",
"x-ms-summary": "Start datetime",
"x-ms-visibility": "advanced",
"format": "date-time"
},
{
"name": "createdDateTimeUtcEnd",
"in": "query",
"required": false,
"type": "string",
"description": "The end datetime to get items before.",
"x-ms-summary": "End datetime",
"x-ms-visibility": "advanced",
"format": "date-time"
},
{
"name": "statuses",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"description": "Statuses to use in filtering.",
"x-ms-summary": "Filter by status",
"x-ms-visibility": "advanced"
},
{
"name": "ids",
"in": "query",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"description": "Document IDs to use in filtering.",
"x-ms-summary": "Filter by document ID",
"x-ms-visibility": "advanced"
}
]
}
},
"/languages": {
"get": {
"summary": "Get languages",
"description": "Retrieves all languages supported for translation by the Microsoft Azure Cognitive Services Translator.",
"operationId": "GetTranslateSupportedLanguages",
"consumes": [],
"produces": [
"application/json"
],
"parameters": [],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Language"
}
}
}
}
}
},
"/Transliteratelanguages": {
"get": {
"summary": "Get transliterate languages",
"description": "Retrieves all languages supported for transliteration by the Microsoft Azure Cognitive Services Translator.",
"operationId": "GetTransliterationLanguages",
"x-ms-visibility": "internal",
"consumes": [],
"produces": [
"application/json"
],
"parameters": [],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Language"
}
}
}
}
}
},
"/sourcelanguages": {
"get": {
"summary": "Get source languages",
"description": "Retrieves all languages supported for translation by the Microsoft Azure Cognitive Services Translator.",
"operationId": "GetTranslateSupportedSourceLanguages",
"x-ms-visibility": "internal",
"consumes": [],
"produces": [
"application/json"
],
"parameters": [],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Language"
}
}
}
}
}
},
"/glossaryformatversion": {
"get": {
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/GlossaryFormatVersion"
}
}
}
},
"summary": "Get glossary format and version",
"description": "Retrieves all supported glossary formats and versions.",
"operationId": "GetGlossaryFormatVersion",
"x-ms-visibility": "internal"
}
},
"/TransliterationFromScripts": {
"get": {
"summary": "List transliteration from scripts",
"description": "Retrieves the list of from scripts for transliteration scope.",
"operationId": "GetTransliterationFromScripts",
"x-ms-visibility": "internal",
"consumes": [],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "language",
"in": "query",
"description": "The name of the Language for which fromScript has to be fetched.",
"required": true,
"x-ms-summary": "Language ",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationLanguages",
"value-path": "Code",
"value-title": "Name"
},
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Language"
}
}
},
"default": {
"description": "Operation Failed."
}
},
"deprecated": false,
"x-ms-no-generic-test": true
}
},
"/TransliterationToScripts": {
"get": {
"summary": "List transliteration to scripts",
"description": "Retrieves the list of to scripts for transliteration scope.",
"operationId": "GetTransliterationToScripts",
"x-ms-visibility": "internal",
"consumes": [],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "language",
"in": "query",
"description": "The name of the Language for which toScript has to be fetched.",
"required": true,
"x-ms-summary": "Language",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationLanguages",
"value-path": "Code",
"value-title": "Name"
},
"type": "string"
},
{
"name": "fromScript",
"in": "query",
"description": "The name of the fromScript for which toScript has to be fetched.",
"required": true,
"x-ms-summary": "Source script",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationFromScripts",
"parameters": {
"language": {
"parameter": "language"
}
},
"value-path": "Code",
"value-title": "Name"
},
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Language"
}
}
},
"default": {
"description": "Operation Failed."
}
},
"deprecated": false,
"x-ms-no-generic-test": true
}
},
"/TransliterationToScriptsForLanguage": {
"get": {
"summary": "List all transliteration toscripts for a given language",
"description": "Retrieves the list of all toscripts for transliteration scope for a given language.",
"operationId": "GetTransliterationToScriptsForLanguage",
"x-ms-visibility": "internal",
"consumes": [],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "language",
"in": "query",
"description": "The name of the Language for which toScript has to be fetched.",
"required": true,
"x-ms-summary": "Language name",
"x-ms-dynamic-values": {
"operationId": "GetTransliterationLanguages",
"value-path": "Code",
"value-title": "Name"
},
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Language"
}
}
},
"default": {
"description": "Operation Failed."
}
},
"deprecated": false,
"x-ms-no-generic-test": true
}
}
},
"definitions": {
"TranslationResults": {
"description": "Translation result.",
"type": "object",
"properties": {
"TranslatedText": {
"description": "Gets the translated text.",
"type": "string",
"x-ms-summary": "Translated text",
"x-ms-visibility": "important"
},
"TransliteratedText": {
"description": "Gets the transliterated text.",
"type": "string",
"x-ms-summary": "Transliterated text",
"x-ms-visibility": "important"
}
}
},
"TransliterationResults": {
"description": "Transliteration results.",
"type": "object",
"properties": {
"text": {
"description": "Gets the transliterated text.",
"type": "string",
"title": "Text",
"x-ms-visibility": "important"
},
"script": {
"description": "Transliterated script.",
"type": "string",
"title": "Script",
"x-ms-visibility": "important"
}
}
},
"Language": {
"description": "Language code. If none specified, Microsoft Translator will try to auto-detect the document language.",
"type": "object",
"properties": {
"Code": {
"description": "Gets or sets the language code.",
"type": "string",
"x-ms-summary": "Language code",
"x-ms-visibility": "advanced"
},
"Name": {
"description": "Gets or sets the language.",
"type": "string",
"x-ms-summary": "Language"
}
}
},
"GlossaryFormatVersion": {
"description": "Glossary Format and version for document translation.",
"type": "object",
"properties": {
"FormatVersionCode": {
"description": "Gets or sets the file format and version code.",
"type": "string",
"x-ms-summary": "File format and version code",
"x-ms-visibility": "advanced"
},
"FormatVersionName": {
"description": "Gets or sets the file format and version name.",
"type": "string",
"x-ms-summary": "File format and version name"
}
}
},
"DocumentTranslationRequest": {
"required": [
"storageType",
"sourceLanguage",
"sourceURL",
"targetContainerURL",
"targetLanguage"
],
"type": "object",
"properties": {
"storageType": {
"type": "string",
"x-ms-summary": "Storage type of the input documents",
"description": "Choose a file or folder.",
"x-ms-visibility": "important",
"enum": [
"File",
"Folder"
]
},
"sourceLanguage": {
"type": "string",
"x-ms-summary": "Source language",
"description": "Language code. If none is specified, Microsoft Translator will try to auto-detect the document language.",
"default": "Auto-detect",
"x-ms-dynamic-values": {
"operationId": "GetTranslateSupportedSourceLanguages",
"value-path": "Code",
"value-title": "Name",
"parameters": {}
}
},
"sourceURL": {
"type": "string",
"x-ms-summary": "Location of the source documents",
"description": "The location of the source document(s) which can be a single file or a folder. This location is a URL link from your Azure blob storage.",
"x-ms-visibility": "important"
},
"documentFilterPrefix": {
"type": "string",
"x-ms-summary": "Prefix filter",
"description": "A case-sensitive prefix string to filter documents in the source path for translation. For example, when using an Azure storage blob Uri, use the prefix to restrict sub folders for translation.",
"x-ms-visibility": "advanced"
},
"documentFilterSuffix": {
"type": "string",
"x-ms-summary": "Suffix filter",
"description": "A case-sensitive suffix string to filter documents in the source path for translation. It's most often use for file extensions.",
"x-ms-visibility": "advanced"
},
"targetCategory": {
"type": "string",
"x-ms-summary": "Category",
"description": "A string specifying the category (domain) of the translation. This parameter is used to get translations from a customized system built with Custom Translator.",
"x-ms-visibility": "advanced"
},
"targetContainerURL": {
"type": "string",
"x-ms-summary": "Location of the translated documents",
"description": "The location where the translated documents will be stored. This location is a URL link from your Azure blob storage.",
"x-ms-visibility": "important"
},
"targetLanguage": {
"type": "string",
"x-ms-summary": "Target language",
"description": "Target language code.",
"x-ms-visibility": "important",
"x-ms-dynamic-values": {
"operationId": "GetTranslateSupportedLanguages",
"value-path": "Code",
"value-title": "Name"
}
},
"glossaryUrl": {
"type": "string",
"x-ms-summary": "Glossary URL",
"description": "The location of the glossary documents. This location is a URL link from your Azure blob storage.",
"x-ms-visibility": "advanced"
},
"glossaryFormatVersion": {
"type": "string",
"x-ms-summary": "Glossary document format and version",
"description": "Glossary document format and version.",
"x-ms-visibility": "advanced",
"x-ms-dynamic-values": {
"operationId": "GetGlossaryFormatVersion",
"value-path": "FormatVersionCode",
"value-title": "FormatVersionName"
}
}
}
},
"TranslationErrorResponse": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Gets high-level error code."
},
"message": {
"type": "string",
"description": "Gets high-level error message."
},
"target": {
"type": "string",
"description": "Gets the source of the error. For example, it would be documents or document ID in case of an invalid document."
},
"innerError": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Gets code error string."
},
"message": {
"type": "string",
"description": "Gets high-level error message."
},
"target": {
"type": "string",
"description": "Gets the source of the error. For example, it would be documents or document id if there was an invalid document."
}
},
"description": "New inner error format that conforms to Cognitive Services API guidelines. This contains required properties like ErrorCode, message, and optional properties target, details (key value pair), inner error (this can be nested)."
}
},
"description": "Translation error response."
}
}
},
"ErrorResponse": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Gets high-level error code."
},
"message": {
"type": "string",
"description": "Gets high-level error message."
},
"innerError": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Gets code error string."
},
"message": {
"type": "string",
"description": "Gets high-level error message."
},
"target": {
"type": "string",
"description": "Gets the source of the error. For example, it would be documents or document id if there was an invalid document."
}
},
"description": "New inner error format that conforms to Cognitive Services API guidelines. This contains required properties like ErrorCode, message, and optional properties target, details (key value pair), inner error (this can be nested)."
}
},
"description": "Error response."
}
}
},
"FormatOKResponse": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"format": {
"type": "string",
"description": "Name of the document format."
},
"fileExtensions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Supported file extension for this format."
},
"contentTypes": {
"type": "array",
"items": {
"type": "string"
},
"description": "Supported Content-Types for this format."
},
"versions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Supported version."
},
"defaultVersion": {
"type": "string",
"description": "Default version if none is specified."
}
}
},
"description": "File format with details."
}
}
},
"TranslationStatusResponse": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of the operation."
},
"createdDateTimeUtc": {
"type": "string",
"description": "Operation created date time."
},
"lastActionDateTimeUtc": {
"type": "string",
"description": "Date time in which the operation's status has been updated."
},
"status": {
"type": "string",
"description": "List of possible statuses for job or document like Canceled, Cancelling, Failed, NotStarted, Running, Succeeded, ValidationFailed."
},
"summary": {
"type": "object",
"properties": {
"total": {
"type": "integer",
"format": "int32",
"description": "Count of total documents."
},
"failed": {
"type": "integer",
"format": "int32",
"description": "Count of documents failed."
},
"success": {
"type": "integer",
"format": "int32",
"description": "Count of documents successfully translated."
},
"inProgress": {
"type": "integer",
"format": "int32",
"description": "Count of documents in progress."
},
"notYetStarted": {
"type": "integer",
"format": "int32",
"description": "Count of documents not yet started processing."
},
"cancelled": {
"type": "integer",
"format": "int32",
"description": "Count of documents canceled."
},
"totalCharacterCharged": {
"type": "integer",
"format": "int32",
"description": "Total count of characters charged."
}
},
"description": "Summary containing the details."
}
}
},
"DocumentStatusResponse": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Location of the document or folder."
},
"sourcePath": {
"type": "string",
"description": "Location of the source document."
},
"createdDateTimeUtc": {
"type": "string",
"description": "Operation created date time."
},
"lastActionDateTimeUtc": {
"type": "string",
"description": "Date time in which the operation's status has been updated."
},
"status": {
"type": "string",
"description": "List of possible statuses for job or document like Canceled, Cancelling, Failed, NotStarted, Running, Succeeded, ValidationFailed."
},
"to": {
"type": "string",
"description": "Target language."
},
"progress": {
"type": "integer",
"format": "int32",
"description": "Progress of the translation if available."
},
"id": {
"type": "string",
"description": "Document ID."
},
"characterCharged": {
"type": "integer",
"format": "int32",
"description": "Characters charged by the API."
}
}
}
},
"parameters": {},
"responses": {},
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"in": "header",
"name": "Ocp-Apim-Subscription-Key"
}
},
"security": [],
"tags": []
}