API - Get project information
The purpose of this method is to retrieve and check the languages of the connected Beebox project. This is very important since the languages of your content (CMS, database, etc.) and the Beebox project languages must match.
When to use: A CMS connector checks languages in the page where the user configures the connection to the Beebox. You would get the languages with the present method and make sure that the languages correspond to those in the CMS. The source language must match or you will not be able to send any content for translation. The target language codes should match too or you can only get translations for those languages that do match.
URL
(GET) /api/details?token=
PARAMETERS
Parameters are:
token | The session token obtained when connecting. |
RESULTS
The method returns JSON and HTTP status 200. Other HTTP status values indicate an error.
The JSON properties are:
Property | Description |
---|---|
sourceLocale | ISO source language code. About language codes. |
sourceLocaleName | English name. |
sourceLocaleRTL | Boolean. True if language is right-to-left (Arabic, Hebrew ...) |
targetLocales | Array with the project target language codes. |
targetLocaleNames | Array with the English names of target languages. |
targetLocaleItems | Array combining codes and names, see example below. |
extensions | The file extensions that this Beebox project accepts for translations. The accepted file formats are a configuration of the Beebox project. |
Note: If you connect using administrator credentials, you will obtain all project details.
EXAMPLE
A typical result may look like:
{
"sourceLocale":"en",
"sourceLocaleName":"English (en)",
"sourceLocaleRTL":false,
"targetLocales":["fr","de"],
"targetLocaleNames":["French (fr)","German (de)"],
"targetLocaleItems":[{"v":"fr","t":"French (fr)"},{"v":"de","t":"German (de)"}],
"extensions": [".htm",".html",".htmls",".json",".xml"]
}