...
The next step is to go to https://console.custom.mt/swagger/ Custom MT API and enable API connection. To do so open the link https://console.custom.mt/swagger/ and select Authorize button.
...
Enter the languages from the translation template you created earlier.
Code Block |
---|
{
"source_language": "en-us",
"target_language": "es-es"
} |
...
Response:
Code Block |
---|
curl -X 'POST' \
'https://console.custom.mt/translation/get-templates' \
-H 'accept: application/json' \
-H 'token: ********' \
-H 'Content-Type: application/json' \
-H 'X-CSRFToken: *********' \
-d '{
"source_language": "en-us",
"target_language": "es-es"
}' |
Code Block |
---|
[
{
"template_name": "English-Spanish",
"engines": [
"MicrosoftProvider",
"AmazonProvider"
]
}
] |
Get the list of templates for the selected languages by pressing Try it out and Execute buttons.
...
Code Block |
---|
curl -X 'GET' \
'https://console.custom.mt/translation/get-templates-list' \
-H 'accept: application/json' \
-H 'token: ******' \
-H 'X-CSRFToken: *****' |
Response bodyload
Code Block |
---|
[
{
"template_name": "English-Spanish",
"source_language": "en-US",
"target_language": "es-ES",
"engines": [
"MicrosoftProvider",
"AmazonProvider"
]
}
] |
Translate your text by adding the text to be translated and the template name and pressing Execute button.
...
Curl
Code Block |
---|
curl -X 'POST' \
'https://console.custom.mt/translation/translate' \
-H 'accept: application/json' \
-H 'token: ef3b2699-d98b-4d16-9791-a7c8ae577cd2' \
-H 'Content-Type: application/json' \
-H 'X-CSRFToken: U0JBjSZD0qRPeedwYxBNz1nqQb3UExvW3kWl2h3rDEKAUiAtatFT1NEbwoHm8R5b' \
-d '{
"text": [
"Hello world!"
],
"template_name": "English-Spanish"
}' |
Response
Code Block |
---|
{
"translated_text": [
"¡Hola mundo!"
]
} |
...