Locales API

Provides operations on OMN locales.

Retrieve locales

/common/locales/retrieve Returns locales by mode, ids or identifiers
Table 1. Details

Resource path

/api/core/v1/common/locales/retrieve

HTTP method

POST

Request content type

application/json

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Body parameters

Specified by LocaleRequest

  • ids - (List of type Integer) - a list of locale ids which should be returned; (Optional)

  • tids - (List of type String) - a list of locale tids which should be returned; (Optional)

  • mode - a specified mode of languages loading. The following values are here: (Required)

    • ID - locales for the given ids should be loaded;

    • TID - locales for the given identifiers should be loaded;

    • ALL - a list of all locales should be loaded;

    • CONTENT - a list of content locales should be loaded;

    • FRONTEND - a list of frontend locales should be loaded

  • exportConfig - (true|false) - whether the "config" information (tag) should be returned. By default, it is false; (Optional)

If "ids" parameter is set then the "mode" must be "ID" - it is required;

If "tids" parameter is set then the "mode" must be "TID" - it is required;

Return Type

PimType with filled LocalesType

Responses
Table 2. Http response codes
Code Message Datatype

200

PimType with list of locales

PimType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
Table 3. Request examples
Use-case Request body JSON

Get a list of all locales

{
    "mode": "ALL"
}

Get a list of specific locales by ids

{
"ids": [6000, 6003],
"mode": "ID"
}

Get a list of specific locales by identifiers

{
"tids": ["en_EN"],
"mode": "TID"
}

Get all content languages

{
"mode": "CONTENT"
}

Get all frontend languages

{
"mode": "FRONTEND"
}

Get a list of the specified locales with config information

{
"tids": ["en_EN", "de_DE"],
"mode": "TID",
"exportConfig": true
}
Get a list of all locales with configuration
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/common/locales/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "mode": "ALL",
    "exportConfig": true
}'
Request body
{
    "mode": "ALL",
    "exportConfig": true
}
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <locales mode="delta">
        <locale country="EN" id="6000" language="en" name="English" tid="en_EN">
            <config>
                <itms mode="delta" type="dateFormat">
                    <itm key="customDateFormatsEnabled">false</itm>
                </itms>
            </config>
            <meta>
                <itm key="contentLocale">true</itm>
                <itm key="defaultContentLocale">true</itm>
                <itm key="defaultFrontendLocale">false</itm>
                <itm key="frontendLocale">true</itm>
            </meta>
        </locale>
        <locale country="DE" id="6003" language="de" name="German" tid="de_DE">
            <config>
                <itms mode="delta" type="dateFormat">
                    <itm key="customDateFormatsEnabled">false</itm>
                </itms>
            </config>
            <meta>
                <itm key="contentLocale">true</itm>
                <itm key="defaultContentLocale">false</itm>
                <itm key="defaultFrontendLocale">true</itm>
                <itm key="frontendLocale">true</itm>
            </meta>
        </locale>
    </locales>
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-12-19T07:17:57.303Z</itm>
        <itm key="sourceEnv">dev</itm>
        <itm key="itemInformationType">locale</itm>
    </meta>
</pim>
Get a list of specific locales
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/common/locales/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"tids": ["en_EN"],
"mode": "TID",
"exportConfig": true
}'
Request body
{
"tids": ["en_EN"],
"mode": "TID"
}
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <locales mode="delta">
        <locale country="EN" id="6000" language="en" name="English" tid="en_EN">
            <meta>
                <itm key="contentLocale">true</itm>
                <itm key="defaultContentLocale">true</itm>
                <itm key="defaultFrontendLocale">false</itm>
                <itm key="frontendLocale">true</itm>
            </meta>
        </locale>
    </locales>
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-12-19T07:23:29.494Z</itm>
        <itm key="sourceEnv">pddevelop_test</itm>
        <itm key="itemInformationType">locale</itm>
    </meta>
</pim>

Welcome to the AI Chat!

Write a prompt to get started...