Pricing 
API Pricing

Try For Free Now

Dark

Light

FILE TRANSLATION
File Translation Download
Download the files translated.
You can download the translated files in 14 days after the translation is done. (You can contact us to adjust the period.)
File Translation can only be processed by T-4OO or T-3MT engine.
Endpoint
Request details
GET
https://translate.rozetta-api.io/api/v1/downloads
Header
Header
Description
accessKey, nonce, signature
Please refer to the authentication section.
Parameter
Parameter
Require
Description
ids
O
Array of "translateItemId".
Request Sample
curl --globoff 'https://translate.rozetta-api.io/api/v1/downloads?ids=["11111_1AA1"]' -H 'nonce: Your Nonce' -H  'accesskey: Your Access Key' -H  'signature: Your Signature' -o download_result.zip
Response
Key
Description
N/A
A zip file that contains all translated files.

api/v1/downloads
Download translated files.
JavaScript
C#
VB.NET
TypeScript
const superagent = require('superagent');
const crypto = require('crypto');
const fs = require('fs');
const AdmZip = require('adm-zip');

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

const serverConfig = {
 protocol: 'https:',
 hostname: 'translate.rozetta-api.io',
 port: 443
};
const authConfig = {
 accessKey: 'YOUR_ACCESS_KEY',
 secretKey: 'YOUR_SECRET_KEY',
 nonce: new Date().getTime().toString()
};

const translateItemIds = 'your translateItemIds';

const sendRequest = (serverConfig, authConfig, translateItemIds) => {
  const itemIds = translateItemIds.split(',');

  const url = `/api/v1/downloads?ids=${JSON.stringify(itemIds)}`;
  const signature = authUtils.generateSignature(
    url,
    authConfig.secretKey,
    authConfig.nonce,
  );

  superagent.get(`${serverConfig.protocol}//${serverConfig.hostname}${url}`)
    .set({
      accessKey: authConfig.accessKey,
      signature,
      nonce: authConfig.nonce,
    }).end(function (req, resp) {
      if (resp.status === 200) {
        fs.createWriteStream('./output.zip').write(resp.body, (error) => {
          if (error) {
            console.error(error);
          } else {
            const zip = new AdmZip('./output.zip');
            zip.extractAllTo('./', true);
          }
        });
      }
    });
};

const main = async () => {
  if (!translateItemIds) {
    console.log("Error. please input translationItemId.");
    return;
  };
  try {
    await sendRequest(
      serverConfig,
      authConfig,
      translateItemIds
    );
  } catch (error) {
    console.error(error);
  }
};

main();
About the authentication, please refer to the authentication section.
You can get a full version of sample codes here
©️ 2019 Rozetta API  ・  Powered by Rozetta

Rozetta Corp.

^