First steps

Translate By Humans API is a paid service. You must have a developer account to access the API and Sandbox environment.

How to get a Developer account ?

Learn more about getting a developer account here.

Available SDK

We currently only support SDK for the following:

  1. PHP

Find it on GitHub here.

How to configure?

Once you’ve downloaded the SDK, locate config.php in downloadedSDK/example/. You will need to configure your Client ID and Client SECRET in the code so open the file config.php in the choice of your text editor.

Please note that the Client ID & Client SECRET are different for live environment and Sandbox environment.

  1. For sandbox environment, login to Developers Console (https://dev.translatebyhumans.com) and navigate to the credentials page. Copy the Client ID & Client SECRET from here.
  2. For live environment, login to Translate By Humans website (https://www.translatebyhumans.com) and navigate to the API Settings page. Copy the Client ID & Client SECRET from here.

Now that you have the Client ID & Client SECRET with you, let’s go back to the file config.php that you found in the SDK's example. Look at the example below and search for this code in the file.

Example:


 const CLIENT_ID = 'TBH-XXXXXXXXXXX';
 const CLIENT_SECRET = '**************************************';
 const CLIENT_PUBLIC = '**************************************';
 const SANDBOX = true; 

    

You need to set Client id & secret on creating object of TbhClient class.

You will have to set your Client ID & Client SECRET for the variables CLIENT_ID & CLIENT_SECRET. Remember that these values are different for live environment & sandbox environment so use values for the environment you want to enable.

The variable “SANDBOX” when set to true implies that you wish to enable the sandbox environment. Setting it to false will enable live environment.

$apiClient = new TbhClient() will create a new object of the Translate By Humans Client class.

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