Locales API
Provides operations on OMN locales.
Retrieve locales
| /common/locales/retrieve Returns locales by mode, ids or identifiers |
Resource path |
/api/core/v1/common/locales/retrieve |
HTTP method |
POST |
Request content type |
application/json |
Response content type |
|
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
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
| Use-case | Request body JSON |
|---|---|
Get a list of all locales |
|
Get a list of specific locales by ids |
|
Get a list of specific locales by identifiers |
|
Get all content languages |
|
Get all frontend languages |
|
Get a list of the specified locales with config information |
|
Get a list of all locales with configuration
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
}'
{
"mode": "ALL",
"exportConfig": true
}
<?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 --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
}'
{
"tids": ["en_EN"],
"mode": "TID"
}
<?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>