API service documentation

Introduction

The Translations Cloud API provides some features of our system, in order to integrate them in your applications and websites. Our API works on REST (Representational State Transfer), and returns JSON formatted responses.

The API uses an API key and a secret key in order to enstablish a connection with our servers. You can find these informations in your dashboard, under the tab Settings.

Authentication

Each request need an authentication.

  • Download our PHP client Download PHP client
  • Get your API credentials (api_key and secret_key) from your dashboard and replace them in your PHP client code
  • The authentification is needed on each API call.

Requests are sent at the address : (API backend point)
https://api.translationscloud.com/

The following code is an example of an API call




# example of an API call request

$api_call = new API();
$result = $api_call->Login('12345678901234567890123456789012')->Item('meta_home_desc')->Lang('it')->Get();
     # example of a JSON output
Array ( [message] => Content of the translation )

Responses

Each response is returned on JSON format. If any language is specified, english translation is provided. Response fields are the following :

  • action : Feature name used.
    Example : "action": "default",
  • version : API version.
    Example : "version": "3.1",
  • code : HTTP response code. See table above.
    Example : "code": "200",
  • data : If no error, the request result.
    Example : "data": [],
  • error : If error (code != 200), error message.
    Example : "error": "Authentification failed",

Error codes and description :

Code Description
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Unprocessable Entity
500 Internal Server Error



   # Example of success

{
  "action": "ACTION_NAME",
  "version": "3.1",
  "code": "200",
  "data": [],
}

   # Example of error

{
  "action": "ACTION_NAME",
  "version": "3.1",
  "code": "403",
  "error": "Authentification failed.",
}
     # example of a JSON output

Features

The Translations Cloud API provides the following features:

  • default : returns the default translation for an alias
  • language : returns the translation of a given alias for a given language
  • debug : returns all the informations on a given alias

API methods

Our API does support only the GET method at the moment.

  • default
    Parametres

    content

    Responses

    content

    Errors

    content

  • language
    Parametres

    content

    Responses

    content

    Errors

    content

  • debug
    Parametres

    content

    Responses

    content

    Errors

    content







   # Example of content







   # Example of content






   # Example of content