This page is a Quick Start guide for testing the Bering API. It assumes you’ve already completed Access and Authentication. For detailed request parameters, please see our API Reference documentation.
The Bering API consists of two RESTful services:
POST 1: to send text for translation into a target language.
POST 2: to retrieve the translated text.
In the example below, we call the POST API for content from an XML document. The document is in English and we want to translate it to Korean with a legal context.
A job ID is returned, it will be used to get the translated text from the GET API.
POST task-management/api/v1/external/mt/text-api-jobs HTTP/2
Host: https://api-v2.beringlab.com/
User-Agent: YourApp/1.2.3
Content-Length: 45
Content-Type: application/json
{
"source_language": "eng",
"target_language": "kor",
"domain": "legal",
"source_content": "\n \n \n \n \n \n \n \n This is a styled paragraph with bold, italicized text, a font size of 14pt, and blue color. \n \n ",
"subscription_id": "34526267111122",
"api_key": "435436-asdg-3454654754-qnk-233",
"kind": "xml_docx"
}
{
"123456789"
}
We retrieve the translated text by calling the GET API.
GET /task-management/api/v1/external/mt/text-api-jobs/123456789 HTTP/2
Host: https://api-v2.beringlab.com/
User-Agent: YourApp/1.2.3
Content-Length: 45
Content-Type: application/json
{
"api_key": "435436-asdg-3454654754-qnk-233",
"subscription_id": "34526267111122"
}
In the example response below, the translated text is returned successfully.
{
"status_code": 0
"text": "이는 굵고 이탤릭체화된 텍스트, 글자 크기 14pt, 파란색으로 스타일링된 문단입니다. "
}