Quote API

This method is used to get a quote for the order you wish to place. Using this method, you can identify the word count of a document and the corresponding credits that will be utilized in translating it to your desired language.

To get a quote for an order, you need to provide the following fields:

  1. source_language_code:  Required
    Source language code received from sourcelanguage call.
  2. destination_language_code:  Required
    Destination language code received from destinationlanguage call.
    Multiple language codes can be passed in this field with comma-separated(,) values.
  3. category_id:  Required
    Pass the category id received from category call.
  4. proof_reading:  Optional
    Pass the proof reading language(s) of your choice retrieved from destinationlanguage call. Multiple languages can be passed with comma-separated(,) values.
  5. source_text:  Optional if used Upload file
    The text that needs to be translated is passed here. If you wish to upload the file, you can skip this field.
  6. Upload file:  Optional if used Upload file
    You can upload a maximum of 3 files with specific names.
    document_1
    document_2
    document_3

Make the file names match here with the ones sent in the multipart request.

Use the following method for Get Quote:


Request Method  : POST
ContentType : multipart/form-data
Requets Url : API_BASE_URL/API_VERSION/quote/
Auth : Yes     

    

Here’s a PHP SDK Example for the same:


require_once 'tbh-sdk/TbhClient.php';
$apiclient = new TbhClient(CLIENT_ID,CLIENT_SECRET,CLIENT_PUBLIC,ACCESS_TOKEN);
$data = array(
    'source_language_code' => 'en',
    'destination_language_code' => 'th,de',
    'category_id' => '2',
    'source_text' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.    Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum',
    'proof_reading' => 'th',
);
$files = $_FILES;
$quote_data = $apiclient->GetQuote($data,$files);      

    

Sample Output:



{
  "data": {
    "source_language_code": "en",
    "destination_language_code": [
      "th",
      "de"
    ],
    "category_id": "2",
    "summery": {
      "total_credit": 3404,
      "destination_languages": [
        {
          "destination_language_code": "de",
          "total_word": 92,
          "proof_reading": "no",
          "total_credit_charge": 1380
        },
        {
          "destination_language_code": "th",
          "total_word": 92,
          "proof_reading": "yes",
          "total_credit_charge": 2024
        }
      ]
    }
  },
  "message": "Success",
  "error_code": 0,
  "success": true
}
      

    
© 2019 Translate By Humans [Innovative Humans Limited]. All Rights Reserved.