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 second POST API.
curl -X POST https://api.beringlab.com/v1/text-translate \
-H "Content-Type: application/json" \
-d '{
"source_language": "eng",
"target_language": "kor",
"source_content": " Introduction My children love many nursery rhymes and childhood songs. Favorites Humpty Dumpty None are more beloved than Humpty Dumpty . Humpty Dumpty sat on a wall. . . . ",
"domain": "business",
"subscription_id": [Your Subscription ID],
"api_key": [Your API Key],
"kind": "xml_docx"
}'
"7244211692106813440"
We retrieve the translated text by calling the second POST API.
curl -X POST https://api.beringlab.com/v1/text-translate/status/7244211692106813440 \
-H "Content-Type: application/json" \
-d '{
"subscription_id": [Your Subscription ID],
"api_key": [Your API Key]
}'
In the example response below, the translated text is returned successfully.
{"status_code":0,"text":"소개 제 아이들은 많은 동요와 어린 시절 노래를 좋아합니다. 즐겨찾기 험티 덤프티 험프티 덤프티보다 더 사랑받는 사람은 없다. 험프티 덤프티는 벽에 앉았다. . . . "}