REST API Locale

Configuring Locale for REST APIs

To use the REST API in your own language(locale), you must first install the required TSS language pack.

The table below gives an example of what languages are available, taken from TSS documentation:

Language Locale Value
Brazilian Portuguese “pt_BR”
Chinese (Mainland) “zh_CN”
Chinese (Taiwan) “zh_TW”
English (US) “en_US”
French “fr”
German “de”
Italian “it”
Japanese “ja”
Korean “ko”
Spanish “es”

Note: TSS language packs require separate download and installation (see TSS documentation for more information on installing the language packs and to find out what languages are supported). Contact your account representative for details.

After installing the language pack, to use the required language you must add/edit the REST API locale configuration setting in ‘config.txt’ file in your TSS install location as shown below:

<TSS Install Location>\MBSW\15\etc\config.txt

In config.txt, you can add the following key/value pair, if they don’t already exist. If they exist then simply set the locale value to your selected language. If the key/value is not set or defined in ‘config.txt’ then the server will default to “en_us” language setting.

i.e. setting the locale to German, set locale value to “de”

key rest_api {
    value locale "de"
}

Get REST API Locale

GET /api/restapilocale

Returns REST API locale

GET /api/restapilocale HTTP/1.1
Accept: application/json
Response Code Reason
200 No error
500 Server error

The response is a JSON object containing the REST API locale:

{
    "locale": "de"
}