The Locale API can be used with a GET request to either retrieve the list of locale languages that are available in the current environment or look up the description of a language based on its IETF (Internet Engineering Task Force) code. Only these two types of GET calls are supported by the API – there is no POST request actually mapped to this API to create any new locales.
There are no parameters or necessary identifiers that need to be added to the request. The addition of a /?manufacturerID={id} or /?retailerID={id} parameter will be filtered out and ignored by the API.
The data returned by this request is the exact same as in the previous version of OMS, as the Unified Commerce platform supports backwards compatibility for this API. The only change to this request is the format of the base endpoint, as shown in the below table. Remember to provide the x-vol-tenant key for authentication in the headers.
Production URL | https://{tenantId}-translation.mozu.com/api/v2/locale |
Sandbox URL | https://{tenantId}-translation.sandbox.mozu.com/api/v2/locale |
Supported Formats | JSON |
HTTP Method | GET |
Example
In this example, the collection of languages returned includes a few sample languages. This is based on how the environment was set up and which locales have been enabled in the configuration.
To retrieve only the description of a known IETF code, then the code is simply appended to the request URL as /{code}, such as /de-DE.
General Information
The response returns a collection of entries with two pieces of information each:
- Locale Code (an Internet Engineering Task Force code)
- Locale Description
Retrieving Available Locales
Making the below request with the standard endpoint and no parameters will return a list of the locales supported by the environment.
https://{tenantId}-translation.mozu.com/api/v2/locale
This is the full response returned by the API.
{ "collection": [ { "localeIETF": "en-US", "description": "US English" }, { "localeIETF": "fr-CA", "description": "Canadian French" }, { "localeIETF": "en-GB", "description": "British English" }, { "localeIETF": "de-DE", "description": "German" }, { "localeIETF": "fr-FR", "description": "French" }, { "localeIETF": "it-IT", "description": "Italian" }, { "localeIETF": "sv-SE", "description": "Swedish" }, { "localeIETF": "nb-NO", "description": "Norwegian" } ] }
Retrieving a Specific Locale
This second call looks up only the description of a specific locale code.
https://{tenantId}-translation.mozu.com/api/v2/locale/fr-FR
This is the full response returned by the API.
{ "localeIETF": "fr-FR", "description": "French" }