Getting started with your access token

How to successfully call the EasyTranslate API with your system and integrate our language solutions with the relevant activities in your business.

Before you can start using the API, you will need access to the EasyTranslate Platform and therefore create an account. You can see how to create an account here. 

  • Your API keys 

The EasyTranslate API requires API keys to authenticate requests. 

All API requests exist in either test (Sandbox environment activated) or live mode (Production) 

EasyTranslate automatically generates API keys (Client ID, Client Secret) once you create an account. Your API keys are always available on the EasyTranslate platform in the settings of your account --only you can see these values, make sure to keep them safe. 

 

 

For testing purposes, please use your test API keys from your sandbox environment to prevent creating and assigning real life projects. If you wish to have access to the sandbox environment, please contact EasyTranslate Support Team. 

  • Obtain the access token 

Sandbox endpoint

https://api.platform.sandbox.easytranslate.com/oauth/token

To obtain an access token to authenticate to the api, you need to send a POST request. 

In your request's header, you need to specify that json should be accepted. To do so, add "Accept" as a key and "application/json" as its value. You also need to specify the content-type, add "Content-Type" as a key and "application/x-www-form-urlencoded" as its value. 

Finally, you need to pass data to the body of your POST request, here are the data values you need to provide:

    • client_id: {{CLIENT_ID}}
      Your client ID can be found on the EasyTranslate platform in Settings > account > API 
    • client_secret: {{CLIENT_SECRET}}
      The client secret is a secret token linked to your account, you can find it on the EasyTranslate platform in Settings > account > API. To display the secret token, simply click on the eye icon inside of the field. 
    • grant_type: The grant_type value needs to be set to “password”
    • username: {{USERNAME}}
      The username here is the email address of your account
    • password: {{PASSWORD}}
      The password is the password you are using to connect to your account
    • scope: The scope value has to be set to “dashboard”

Request example (Sandbox)

curl --location --request POST 'https://api.platform.sandbox.easytranslate.com/oauth/token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--form 'client_id="{{CLIENT_ID}}"' \
--form 'client_secret="{{CLIENT_SECRET}}"' \
--form 'grant_type="password"' \
--form 'username="{{USERNAME}}"' \
--form 'password="{{PASSWORD}}"' \
--form 'scope="dashboard"'

Response example

When the request has passed the relevant data, the request should return:

{
"token_type": "Bearer",
"expires_in": 31622400,
"access_token": "{{ACCESS_TOKEN}}",
"refresh_token": "{{REFRESH_TOKEN}}"
}
    • token_type: The token type here is “bearer”
    • expires_in: You can see here until when the token is available
    • access_token: This is the token you will be required to provide when you need to authenticate.
    • refresh_token: You will need this token to refresh your access token once it has expired

 

Your access token can be used for a month from the time you requested it, once it has expired, you have the possibility to refresh your access token.