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 All Result
Get all the file translated results.
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/all
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/all
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
Array of result. In each object, 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. With "downloaded" you can check the files are downloaded or not. true for downloaded, false for not downloaded yet. With "error" you can check if there's any error occured. true for there's some error. false for normal. With "errorCode" you can check the error code. With "errorMessage" you can check the error message. "id" is numeric id. With "t4ooAuthFailed" is only showed when user is connected to T-4OO account and occured some error when translating. true for there's some error.
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/all
Get all of the translate results.
const superagent = require('superagent');
const config = require('./config');

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

const translateId = 'your translateId';
const url = `/api/v1/translate-result/all`;

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.

^