Skip to content

Locale API

This section covers all the APIs related to managing locales in UnoPim.

Get All Locales

Endpoint:

GET {{url}}/api/v1/rest/locales

Headers

KeyValue
AuthorizationBearer access_token
Acceptapplication/json

Query Parameters

NameDescriptionTypeDefault
limitMaximum number of records per requestNumber10
pagePage number to retrieve based on the limitNumber1
filtersCriteria to filter the records returnedJSONN/A

Example Filters

  • Enabled Locales:

    json
    {"status":[{"operator":"=","value": true}]}
  • Disabled Locales:

    json
    {"status":[{"operator":"=","value": false}]}

Response

Response
json
{
    "data": [
        {
            "code": "af_ZA",
            "status": 0
        },
        {
            "code": "am_ET",
            "status": 0
        },
        {
            "code": "ar_AE",
            "status": 0
        },
        {
            "code": "ar_BH",
            "status": 0
        },
        {
            "code": "ar_DZ",
            "status": 0
        },
        {
            "code": "ar_EG",
            "status": 0
        },
        {
            "code": "ar_IQ",
            "status": 0
        },
        {
            "code": "ar_JO",
            "status": 0
        },
        {
            "code": "ar_KW",
            "status": 0
        },
        {
            "code": "ar_LB",
            "status": 0
        }
    ],
    "current_page": 1,
    "last_page": 21,
    "total": 210,
    "links": {
        "first": "{{url}}/api/v1/rest/locales?limit=10&page=1",
        "last": "{{url}}/api/v1/rest/locales?limit=10&page=21",
        "next": "{{url}}/api/v1/rest/locales?limit=10&page=2",
        "prev": null
    }
}

Get Locale by Code

Endpoint:

GET {{url}}/api/v1/rest/locales/{locale_code}

Path Parameter

NameDescriptionType
{locale_code}The unique code of the localeString

Example :

GET {{url}}/api/v1/rest/locales/en_US

Headers

KeyValue
AuthorizationBearer access_token
Acceptapplication/json

Response

Response
json
{
    "code": "en_US",
    "status": 1
}

Released under the MIT License.