How To Use 
Register an account

Try For Free Now

Dark

Light

Announcement: End of support for old file type in File Translation (08/24)

Announcemnet: System Maintenance (Update: September 17)

Announcement: End of support for old file type in File Translation (08/24)

FILE TRANSLATION
File Translation Result
Get the file translated result.
File Translation can only be processed by T-4OO or T-3MT engine.
Endpoint
Request details
GET
https://translate.rozetta-api.io/api/v1/translate-result/<translateId>
Path parameter
Path parameter
Description
translateId
The translaction task ID returned from the API after submitting the translation task.
Header
Header
Description
accessKey, nonce, signature
Please refer to the authentication section.
Request Sample
curl -H "nonce: Your Nonce" -H "accessKey: Your Access Key" -H "signature: Your Signature" https://translate.rozetta-api.info/api/v1/translate-result/8c76e418-9842-455b-aac1-5be28e8e4e94
Response
Key
Description
status
For successful request, success will be specified for this field, otherwise failure will be specified. ※Even only one paragraph is failed to translate, the entire request will be failed.
data
Object of result. You can check "translateItemId" to download the translated files. With "lang" you can check the language of the translated text. With "wordCount" you can check the count of text. (Word count or Chracter count, depends on engine. T-4OO: Word count, T-3MT: Chracter count) With "detectedLang" you can check the language of original text which is detected autometically. With "done" you can check if the translation is done or not. With "originalName" you can check the file name which you uploaded.
Response Sample
{
  "status": "success",
  "data": {
    "translateId": "8c76e418-9842-455b-aac1-5be28e8e4e94",
    "done": false,
    "langs": [
      "zh-CN",
      "ja"
    ],
    "fieldId": 1,
    "createdAt": {},
    "items": [
      {
        "translateItemId": "8c76e418-9842-455b-aac1-5be28e8e4e94",
        "lang": "ja",
        "wordCount": 1000,
        "detectedLang": "zh-CN",
        "done": false,
        "originalName": "test.pdf",
        "downloaded":false,
        "error":false,
        "errorCode":null,
        "errorMessage":null,
        "id":5507
      }
    ]
  }
}

api/v1/translate-result/<translateId>
Get translate result with request ID.
const superagent = require('superagent');
const config = require('./config');

const authUtils = require('./utils/auth-utils');

const translateId = 'your translateId';
const url = `/api/v1/translate-result/${translateId}`;

const sendRequest = (serverConfig, accessKey, secretKey) => {
  const nonce = new Date().getTime().toString();
  const signature = authUtils.generateSignature(
    url,
    secretKey,
    nonce,
  );

  superagent.get(`${serverConfig.protocol}//${serverConfig.hostname}:${serverConfig.port}${url}`)
    .set({
      accessKey,
      signature,
      nonce,
    }).end((req, resp) => {
      console.log(resp.text);
    });
};

const main = async () => {
  try {
    await sendRequest(
      config.serverConfig,
      config.authConfig.accessKey,
      config.authConfig.secretKey,
    );
  } catch (error) {
    console.error(error);
  }
};

main();
About the authentication, please refer to the authentication section.
About full sample code of each languages, please refer tohere
©️ 2019 Rozetta API  ・  Powered by Rozetta

Rozetta Corp.

^