Tolq - Easy Translation

Suggest Edits

Getting Started

This page will help you get started with Tolq API.

 

Implementing the Tolq Translation API is straightforward proces.

These are the required steps to get going:

  1. Get the Access keys

    You will only need to do this once. Once you have your access keys keep them somewhere safe and use them to make your requests.

  2. Create a Translation Request

    POST the content you need to translate and order or quote it.

  3. Retrieve a Translation Request

    GET the translations for any content you have previously ordered.

  4. Stay in sync

    Get a callback on all your translation requests when the translations are updated.

You can test your implementation with Tolq Latin (tq), a test language that allows you to tests all the functionalities the API has for free. With the test you can get acquainted with all the flows without worrying.

Support

We offer developer support for API integration. Please contact us using support@tolq.com or use the support button on the right bottom of your screen.

Suggest Edits

Access keys

How to get the secret and access key to use Tolq API

 

In order to communicate with our API, you first need to get an Access key and an Access Secret.

You can generate your access credentials from inside your Tolq account, in the developers section:

https://clients.tolq.com/developers

Click on "Generate key":

Copy the Access key and the Access secret and store them somewhere safe.

Using the API

From here you can begin to make API requests. Please note that if you want to make paid requests, you will need to set your payment details in your personal account.

The Tolq API is a REST(Representational State Transfer) based API communicating over JSON. Authentication takes place as HTTP Basic over a secured connection.

Make sure that you set the Content-Type header to application/json. Moreover, don't forget to check if all your requests have https://{access_key}:{secret}@api.tolq.com/v1 as their base url.

Recovering the keys

You will have access to your access key from your account's developer section. Due to security reasons the secret is not recoverable.

You can also regenerate your secret and access key in your account developer section, by clicking on "regenerate key":

Suggest Edits

Create a Translation Request

Send the content you need to translate.

 

For creating a Translation request we offer two options: Posting a Translation Request or Posting a Quote Request.

If you intend to create particularly large or small requests, please take a look at our sizing guide.

If you have code, escaped or not escaped html, newlines or other special characters in your source text, please take a look at Special characters, encoding and newlines

  • Translation Request

    Posting a Translation Request orders the texts you have included within the request attribute. Please note that whenever using paid languages the order will be automatically charged to you. You can always do some testing for free with Tolq Latin (tq).

  • Quote Request

    If you prefer to check the content and the price beforehand in the clients application, you should create a Quote Request which works exactly the same except from the fact you have to add `/quote` at the end of the url and you will be able to review it before they are ordered. They can be ordered both from the UI and via our API.

Before you start making requests, you should take the limits of the API and how the content is split among translators into account. This will help you to optimise the results so they will meet your expectations.

Example

Let's imagine you need to translate an article in your CMS which has a title, an introduction, and a body of text.

Seeing as this is your first order, and you want to have it handled automatically, you decide to order it Posting a Translation Request and using Tolq Latin as the target language, which is free to test things out.

In this first request you would send this JSON:

{
  "request": {
        "title": {
          "text": "The example",
        },
        "intro": {
        	"text": "An example on how to use Tolq"
        },
    		"body": {
       		"text": "Tolq is a platform that allows you easily translate lots of content."
        }
    },
    "source_language_code": "en",
    "target_language_codes": "tq",
    "quality": "machine"
}

The server would answer back with this response:

{
  "id" : 1,
  "name" : null,
  "slug" : "untitled-1",
  "context_url" : null,
  "description" : null,
  "created_at" : "2016-03-02T10:23:32.441Z",
  "completed_at" : null,
  "quality" : "machine",
  "target_language_code" : "tq",
  "style_guide_reference_id" : 1,
  "status" : "pending"
}

If the request is made successfully, you will get a response with some useful data like the id. You will be able to use the id to retrieve a Translation Request. You can also use it to search and/or identify the request in the clients application. Or you can use this id to identify a callback later. For an overview of the possible states, see the status section to learn about the lifetime of a translation request.

Suggest Edits

Retrieve a Translation Request

Collect your translated content.

 

After creating a Translation Request, creating a quote or ordering a quote, we get access to retrieving the translations of said requests.

We can retrieve the translations in 2 different ways: using the id, the requests return to GET Translation Request or using the callback url:

  • GET Translation Request

    Using the id returned by the original POST request you can get back your translations.

  • Callback

    If you set the callback_url in your translation request you will be called back to that url once the translation is finished and reviewed.

We strongly advise that you use callbacks instead of getting the translations using GET to get the translations back into your system, seeing as callbacks provide a much better automated flow.

Example

The translation request you made in the previous example, is translated a few seconds after the request is made. This is applicable to any machine translation in general. This means that both getting Translation Request and using the callback url would return this:

{
  "id": 7,
  "name": nil,
  "slug": "untitled-7",
  "context_url": null,
  "description": null,
  "created_at": "2016-03-02T10:23:32.441Z",
  "completed_at": "2016-03-02T10:23:32.638Z",
  "quality": "machine",
  "target_language_code": "tq",
  "style_guide_reference_id": 1,
  "status": "finished",
  "orders": [
    {
      "quality": "machine",
      "target_language_code": "tq",
      "status": "finished",
      "ordered_words": 22,
      "price": 0.0,
      "total_words": 22
    }
  ],
  "original": {
    "title": "The example",
    "intro": "An example on how to use Tolq",
    "body": "Tolq is a platform that allows you to easily translate lots of content"
  },
  "translations": {
    "tq": {
      "title": "Arcu pretium",
      "intro": "Et ultricies ex elit ut ante Vitae",
      "body": "Augue ut a consectetur magna lacus enim ac euismod elementum morbi eu lobortis"
    }
  },
  "total_orders": 1,
  "total_ordered_words": 22,
  "total_words": 22,
  "total_cost": 0.0,
  "total_keys": 3,
  "callback_response_code": null,
  "last_callback_at": null,
  "_links": {
    "review": [
      {
        "target_language_code": "tq",
        "target_language_name": "Tolq Latin",
        "href": "https://clients.tolq.com/api/7/review/tq"
      }
    ]
  }
}

Getting the request before translation

Callbacks are made only once the translation is finished and accepted. If you were to get the translation using the id earlier on, we might find out that the translation isn't yet available due to the different stages of the lifecycle.

An order that hasn't yet been paid would have this format:

{
  "id": 10,
  "name": nil,
  "slug": "untitled-10",
  "context_url": nil,
  "description": nil,
  "created_at": "2016-03-02T12:33:30.678Z",
  "completed_at": nil,
  "quality": "machine",
  "target_language_code": "es",
  "style_guide_reference_id": 1,
  "status": "unordered",
  "es": {
    "previous_words": 0,
    "new_words": 22,
    "total_words": 22,
    "cost": 0.07
  }
}
Suggest Edits

Sizing

Strategies to have optimal qualities on your translations.

 

To get the best possible translations, it is important for translators to be able to work fast and review larger amounts of text at the same time. We advise clients to bulk up translation requests such that requests do not exist out of a single sentence, but of multiple, related chunks of text. This way, translators can far more effectively check their translations and work faster, resulting in better and faster translations.

In order to get your content translated as fast as possible, we pre-process the Translation Requests before sending the content to our translators.

If a single request has more than 1500 words, it will be split into different tasks that will usually be translated by different translators in parallel.

So even if the Limits of our API are much larger, we recommend to send requests with less than 1500 words.

Suggest Edits

Callbacks

How callbacks work in the system.

 

Tolq allows you setting a callback_url when you are creating a Translation Request. That url will be queried via a POST once the translations are finished and reviewed by our servers with a payload equivalent to the one you would get from a GET request on a Translation Request with the same status:

{
  "id": 7,
  "name": null,
  "slug": "untitled-7",
  "context_url": null,
  "description": null,
  "created_at": "2016-03-02T10:23:32.441Z",
  "completed_at": "2016-03-02T10:23:32.638Z",
  "quality": "machine",
  "target_language_code": "tq",
  "style_guide_reference_id": 1,
  "status": "finished",
  "orders": [
    {
      "quality": "machine",
      "target_language_code": "tq",
      "status": "finished",
      "ordered_words": 22,
      "price": 0.0,
      "total_words": 22
    }
  ],
  "original": {
    "title": "The example",
    "intro": "An example on how to use Tolq",
    "body": "Tolq is a platform that allows you to easily translate lots of content"
  },
  "translations": {
    "tq": {
      "title": "Arcu pretium",
      "intro": "Et ultricies ex elit ut ante Vitae",
      "body": "Augue ut a consectetur magna lacus enim ac euismod elementum morbi eu lobortis"
    }
  },
  "total_orders": 1,
  "total_ordered_words": 22,
  "total_words": 22,
  "total_cost": 0.0,
  "total_keys": 3,
  "callback_response_code": null,
  "last_callback_at": null,
  "_links": {
    "review": [
      {
        "target_language_code": "tq",
        "target_language_name": "Tolq Latin",
        "href": "https://clients.tolq.com/api/7/review/tq"
      }
    ]
  }
}

With callbacks, you don't need to constantly poll for the state of a translation request. You will get the approved translations in your system as soon as possible. This automated workflow can save you and us a lot of time.

Sync callbacks

Additionally, Tolq will call back the url every time a phrase belonging to a translation request is changed for any reason.

The only difference between this type of callback and a normal one is that it includes a new attribute that summarises the changes:

"recent_changes": [
  { 
    original_text: "...",
    previous_translation: "...",
    current_translation: "...",
    cause: "..." 
  },
  ...
]

In order to prevent DDOS-like callbacks flooding your servers, we batch them. So if several phrases change in one of your requests in a short period of time, you will receive just one callback.

How can phrases change

The most typical reason for phrases to change, is that phrases can be edited in the review section of the client application.

Since Tolq is using a Translation Memory, the same phrase might exist in several translation requests at the same time. This means that a single change could trigger several callbacks at the same time.

The other way for phrases to be changed is to order them in a higher quality. If a phrase from previous Translation Requests is ordered with a higher translation quality than all of the previously selected (i.e. old ones in basic, new one in standard), all the sentences will be updated to that new quality and several callbacks will be sent for the old requests.

Opt-out from sync callbacks

This option is enabled by default. If you supply your translation request with a callback_url attribute, you will get the response both when the translation is finished, and every time any of the sentences within the request is updated.

If you'd like to opt-out and receive callbacks just once after finishing the translations, send us an email to support@tolq.com.

Callback Security

Translations and copy can have severe impact on your application. Therefore we advise clients to take extra care when using callbacks. It should go without saying that you should keep your api details secret.

Prevent listening in

Prevent listening in by enabling https on the callback endpoint. This allows us to set up an encrypted connection.

Use authentication on your callback url

Provide a token or authentication details in the callback url, such that the endpoint cannot be accessed by unauthorised users.

Verify our requests with our HMAC signature

Tolq signs each callback in the X-Tolq-Signature header with an HMAC using a sha1. The signature uses your api key as the signing key. Most, if not all, common programming languages provide an interface to OpenSSL to do the verification. This way, you can ensure that the request originates from Tolq.

IP Whitelisting

We understand that verifying the HMAC signature is not applicable in every scenario. Therefore, we proxy all our callbacks, allowing you to whitelist a single ip address. This address is 84.22.114.141.

Suggest Edits

Stay in sync

 

Your translation memory will grow over time. This entails that you will usually have duplicated sentences across several translation requests.

You may, one day, need to keep your website up-to-date, but you could also reorder one or more requests in a higher quality. If you update a duplicated sentence, this will of course also affect the other translation requests in which the duplicate also occurs.

Each duplicate comes from the translation memory; when you alter the original, you also alter all the duplicates.

To make sure that you can update your content while also keeping track of all the content that is affected by these updates, we offer the possibility to get updated about those changes on the callback_url. When you want to use this feature, please provide a callback_url when creating the request.

Opt-out

This option is enabled by default. This means that if you supply your translation request with a callback_url attribute, you will get the response when the translation is finished and every time any of the sentences within the request is updated.

If you'd like to opt-out and receive callbacks just once after translations have been finished, send us an email to support@tolq.com.

Sync callback

The callback has the same format as a normal Retrieve a Translation Request with the only addition of a new recent_changes field containing an array of the changes in the translation request and the causes. The translations themselves have been updated as well, so you do not need to interpret this field. However, if you value tracking these changes, it is very useful.

"recent_changes": [
  { 
    original_text: "...",
    previous_translation: "...",
    current_translation: "...",
    cause: "..." 
  },
  ...
]
Suggest Edits

Limits

Limitations of the Tolq API

 

If any limit has been reached, our API will give you an error and inform you about the limit that you have hit.

Overview of the limits

Rate limit

100 requests per second

Size Limit

1 megabyte per request

Content limit

1000 keys per request

If any of our limits create a problem for your implementation, please contact us so we can advise you.

Suggest Edits

Special characters, encoding, HTML entities and newlines

 

Code and untranslatable content

Given the huge amount of different templating and programming languages, we advise clients to remove any such language from the source content as it's hard to successfully identify such a range of different codes. We've also noticed that sometimes, parts in the code also need to be translated. Please don't do either of this! Use our key-value structure to give context and structure to your text and render the translations back into your code. Many languages and frameworks have tools to help with this (i.e. yaml files, xliff)

Encoding

All our requests are encoded UTF-8 and are interpreted as such.

Entities and html

HTML entities are decoded to their counterparts so translators can work more easily with them, as they might not be present in the translation. For security purposes, we leave < and > as they are.

Newlines

In a well formatted text newlines denote the boundaries of a sentence or the start of a new paragraph. Many of our customers use them as such. Unfortunately, what we see often is that newlines might be the result of copy pasting or faulty user input. Since we can not reliably tell the difference, we advise clients to remove all newlines that are not meant to differentiate sentences. This way, we can ensure that sentences are segmented correctly with the the best translations as a result.

Suggest Edits

Translation Request states and lifecycle

 

Status

Both orders and requests have a status. The request also has a more generic completed_at attribute, representing the datetime at which all translations were present.

  • not_started - Translation process has not started yet. For a machine translation this means we are still processing the request.
  • started - Translations are being processed.
  • client_review - Translations are pending your review.
  • finished - Translation process has been finished.
  • payment_failed - The payment of the order failed. Usually this happens because the payment details weren't set. Rarely it can also happen that the payment platform fails.

Request states:

  • pending - The request has just been created and is pending for processing.
  • unordered - The request has been quoted but not ordered.
  • ordered - The request has been ordered.
  • in_translation - The request is being translated.
  • waiting_for_client - The translations are pending your review.
  • duplicated - All sentences have been previously ordered.
  • finished - Translation process has been finished.
Suggest Edits

Post a Translation Request

Send the content you need to translate.

 
posthttps://{access_key}:{secret}@api.tolq.com/v1/translations/requests

Body Params

request
object
required

The request object has keys that will contain the different texts you need to translate. Translators will receive the content in the same order as the keys.

text
string
required

Each key inside a request requires a text key with the content to translate.

source_language_code
string
required

The source language of the content in the order. Should contain a two-letter ISO 639-1 language code

target_language_code
string
required

The target language to which the content should be translated. Should contain a two-letter ISO 639-1 language code.

quality
string
required

"machine", "translation", "localization", or "expert". The quality level in which the request will be translated.

style_guide_reference_id
int32

Clients application allows you creating different style guides for your translators you can select which one you want to use via this attribute. If no ID is provided, translators will get your default style guide. In "options".

context_url
string

The content of this url will be shown to translators to let them know the context in which the sentences will be used. Please don't provide generic landing pages that are not contextually relevant to the translation. If you do not have a context url, you can can leave it empty. In "options".

name
string

A name so it can be identified easily in the clients application UI. In "options".

description
string

A clarification for future reference. In "options".

auto_client_review
boolean

It's possible to skip the Client Review process. In "options". Translations will then be moved to finished state immediately.

callback_url
string

Immediately after the translation request is reviewed and accepted we will call this url. It will contain the same payload as the one in the GET request. In "options".

 

The callback url

You don't need to constantly poll for the state of translation of a translation request in order to get the approved translations as soon as possible in your system.

If you provide a callback_url in the request we will call back on that url with the same payload as Retrieve a Translation Request when the translations have been reviewed and are finished.

Payment

The order will be billed to your account according to the billing information you have set up.

If you would like to verify the price of a request before you commit to an order, you can use the quote endpoint first.

Language Codes

All language codes have to be in ISO 639-1 format (two letters).

Request

{
  "request": {
        "a.key": {
            "text": "Some text to translate",           
        },
        "b.key": {
            "text": "More text to translate"
        }
    },
    "source_language_code": "en",
    "target_language_code": "de",
    "quality": "translation",
    "options": {
        "style_guide_reference_id":1,
        "context_url": "http://tolq.com/translations_on_this_page",
        "name": "My translations",
        "description": "A clarification for future reference",
        "auto_client_review": false,
        "callback_url": "http://www.tolq.com/translations_completed"        
    }
}

Results

{
  "id": 9,
  "name": "I like bacon",
  "slug": "i-like-bacon",
  "context_url": "http://www.tolq.com",
  "description": "This is a description",
  "created_at": "2014-09-16T13:17:04.368Z",
  "completed_at": "2014-09-16T13:17:04.368Z",
  "quality": "standard",
  "status": "pending"
}
{}
Suggest Edits

Post a Quote Request

Send the content you need to translate.

 
posthttps://{access_key}:{secret}@api.tolq.com/v1/translations/requests/quote
{
  "request": {
        "a.key": {
            "text": "Some text to translate",           
        },
        "b.key": {
            "text": "More text to translate"
        }
    },
    "source_language_code": "en",
    "target_language_code": "de",
    "quality": "machine",
  	"style_guide_reference_id":1,
    "options": {
        "context_url": "http://tolq.com/translations_on_this_page",
        "name": "My translations",
        "description": "A clarification for future reference",
        "auto_client_review": false,
        "callback_url": "http://www.tolq.com/translations_completed"        
    }
}
A binary file was returned

You couldn't be authenticated

{
  "id": 9,
  "name": "I like bacon",
  "slug": "i-like-bacon",
  "context_url": "http://www.tolq.com",
  "description": "This is a description",
  "created_at": "2014-09-16T13:17:04.368Z",
  "completed_at": "2014-09-16T13:17:04.368Z",
  "quality": "machine",
  "status": "pending"
}

Body Params

request
object
required

The request object has keys that will contain the different texts you need to translate. Translators will receive the content in the same order as the keys.

text
string
required

Each key inside a request requires a text key with the content to translate.

source_language_code
string
required

The source language of the content in the order. Should contain a two-letter ISO 639-1 language code

target_language_code
string
required

The target language to which the content should be translated. Should contain a two-letter ISO 639-1 language code.

quality
string
required

"machine", "translation", "localization", or "expert". The quality level in which the request will be translated.

style_guides_reference_id
int32

Clients application allows you creating different style guides for your translators you can select which one you want to use via this attribute. If no ID is provided, translators will get your default style guide.

context_url
string

The content of this url will be shown to translators to let them know the context in which the sentences will be used.

name
string

A name so it can be identified easily in the clients application UI

description
string

A clarification for future reference

auto_client_review
boolean

It's possible to skip the Client Review process. Translations will then be moved to finished state immediately.

callback_url
string

Immediately after the translation request is reviewed and accepted we will call this url. It will contain the same payload as the one in the GET request.

 

The callback url

You don't need to constantly poll for the state of translation of a translation request in order to get the approved translations as soon as possible in your system.

If you provide a callback_url in the JSON we will call back that url with the same payload as Retrieve a Translation Request.

Payment

The order will be billed to your account according to the billing information you have set up.

The order won't be made effective until you order it using the clients application or using the API.

Language Codes

All language codes have to be in ISO 639-1 format (two letters).

Suggest Edits

Order a Quoted Request

Confirm a previously quoted request

 
posthttps://{access_key}:{secret}@api.tolq.com/v1/translations/requests/id/order
curl --request POST \
  --url https://access_key:secret@api.tolq.com/v1/translations/requests/id/order
var request = require("request");

var options = { method: 'POST',
  url: 'https://access_key:secret@api.tolq.com/v1/translations/requests/id/order' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://access_key:secret@api.tolq.com/v1/translations/requests/id/order")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://access_key:secret@api.tolq.com/v1/translations/requests/id/order");

xhr.send(data);
import requests

url = "https://access_key:secret@api.tolq.com/v1/translations/requests/id/order"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": 10,
  "name": null,
  "slug": "untitled-10",
  "context_url": null,
  "description": null,
  "created_at": "2016-03-02T12:33:30.678Z",
  "completed_at": null,
  "quality": "machine",
  "target_language_code": "es",
  "style_guide_reference_id": 1,
  "status": "in_translation",
  "orders": [
    {
      "quality": "machine",
      "target_language_code": "es",
      "status": "not_started",
      "ordered_words": 22,
      "price": 0.07,
      "total_words": 22
    }
  ],
  "original": {
    "title": "The example",
    "intro": "An example on how to use Tolq",
    "body": "Tolq is a platform that allows you to easily translate lots of content"
  },
  "translations": {},
  "total_orders": 1,
  "total_ordered_words": 22,
  "total_words": 22,
  "total_cost": 0.07,
  "total_keys": 3,
  "callback_response_code": null,
  "last_callback_at": null,
  "_links": {
    "review": [
      {
        "target_language_code": "es",
        "target_language_name": "Spanish",
        "href": "https://clients.tolq.com/api/10/review/es"
      }
    ]
  }
}
 

After Creating a Quote Request we can create a request doing a POST request to the url above and from there the process will be the same as for Creating a Translation Request.

Missing payment details

Please note: if the payment details are not set in your account, the order will still be created and processed. But once you retrieve the Translation, you will get it with the following attribute: "status": "payment_failed" and the following icon in the clients app:

Suggest Edits

Get a Translation Request

Collect your translated content.

 
gethttps://{access_key}:{secret}@api.tolq.com/v1/translations/requests/id
curl --request GET \
  --url https://access_key:secret@api.tolq.com/v1/translations/requests/id
var request = require("request");

var options = { method: 'GET',
  url: 'https://access_key:secret@api.tolq.com/v1/translations/requests/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://access_key:secret@api.tolq.com/v1/translations/requests/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://access_key:secret@api.tolq.com/v1/translations/requests/id");

xhr.send(data);
import requests

url = "https://access_key:secret@api.tolq.com/v1/translations/requests/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": 7,
  "name": null,
  "slug": "untitled-7",
  "context_url": null,
  "description": null,
  "created_at": "2016-03-02T10:23:32.441Z",
  "completed_at": "2016-03-02T10:23:32.638Z",
  "quality": "machine",
  "target_language_code": "tq",
  "style_guide_reference_id": 1,
  "status": "finished",
  "orders": [
    {
      "quality": "machine",
      "target_language_code": "tq",
      "status": "finished",
      "ordered_words": 22,
      "price": 0.0,
      "total_words": 22
    }
  ],
  "original": {
    "title": "The example",
    "intro": "An example on how to use Tolq",
    "body": "Tolq is a platform that allows you to easily translate lots of content"
  },
  "translations": {
    "tq": {
      "title": "Arcu pretium",
      "intro": "Et ultricies ex elit ut ante Vitae",
      "body": "Augue ut a consectetur magna lacus enim ac euismod elementum morbi eu lobortis"
    }
  },
  "total_orders": 1,
  "total_ordered_words": 22,
  "total_words": 22,
  "total_cost": 0.0,
  "total_keys": 3,
  "callback_response_code": null,
  "last_callback_at": null,
  "_links": {
    "review": [
      {
        "target_language_code": "tq",
        "target_language_name": "Tolq Latin",
        "href": "https://clients.tolq.com/api/7/review/tq"
      }
    ]
  }
}
 

The example above contains the response of a successfully translated and accepted translation request. A quote that hasn't been ordered yet would look like this instead:

{
  "id": 10,
  "name": null,
  "slug": "untitled-10",
  "context_url": null,
  "description": null,
  "created_at": "2016-03-02T12:33:30.678Z",
  "completed_at": null,
  "quality": "machine",
  "target_language_code": "es",
  "style_guide_reference_id": 1,
  "status": "unordered",
  "es": {
    "previous_words": 0,
    "new_words": 22,
    "total_words": 22,
    "cost": 0.07
  }
}

Attributes extra info

Some of the returned attributes are self-explanatory, whereas some others need a little more detail:

original

Original texts sent for translation within their corresponding keys.

translation

Contains a key with the language code in ISO 639-1 of the ordered language.
This key contains all the translations to said language following the same structure as the original attribute.

orders and total_orders [deprecated]

In previous versions a single translation request could create several orders.
Now the system creates a single order and gives you access to the same data through other attributes, so we will be removing orders and total_orders in the following versions.

Suggest Edits

List All Requests

 
gethttps://{access_key}:{secret}@api.tolq.com/v1/translations/requests
curl --include \
'https://api.tolq.com/v1/translations/requests'
A binary file was returned

You couldn't be authenticated

    {
        "id": 1,
        "context_url": "http://tolq.com",
        "created_at": "2014-08-22 11:10:52 UTC",
        "completed_at": "2014-08-22 11:12:56 UTC",
        "total_keys": 3,
        "total_orders": 2,
        "total_cost": "0.22"
    },
    {
        "id": 2,
        "context_url": "http://tolq.com",
        "created_at": "2014-08-22 11:12:56 UTC",
        "completed_at": "2014-08-22 11:12:56 UTC",
        "total_keys": 3,
        "total_orders": 0,
        "total_cost": "0.0"
    },

Headers

Per-Page
int32

The amount of items per page

Page
int32

The page number

 

Pagination

This endpoint is paginated as per RFC 5988 and defaults to 25 results per page. When the result is paginated, you will have the following headers to navigate:

  • Page
  • Per-Page
  • Total
  • Links

Or you can use the page query parameter to do explicit per page navigation.