Skip to content

Additional filtering by identifiers

Description

When retrieving directories, you can use the additional ids parameter to ensure that only the elements of the directory whose identifiers were mentioned in the query string remain in the response array.

Notes:

URL structure

GET /v2/path/to/some/reference?ids=1&ids=2&ids=5
# or
GET /v2/path/to/some/reference?ids=1,2,5

# for the country directory
GET /v2/references/countries?signs=TZ&signs=JP
# or
GET /v2/references/countries?signs=TZ,JP

Sample requests and sample responses

For directory "Regions"

Request

curl -X GET -H "Accept: application/json" -H "Authorization: 3WQ1EQ465C4005000130" "https://api.lardi-trans.com/v2/references/areas?ids=16,17,19" 

Response

[
    {
        "id": 16,
        "name": "Волынская обл.",
        "countrySign": "UA",
        "regionId": 4
    },
    {
        "id": 17,
        "name": "Днепропетровская обл.",
        "countrySign": "UA",
        "regionId": 2
    },
    {
        "id": 19,
        "name": "Житомирская обл.",
        "countrySign": "UA",
        "regionId": 6
    }
]
For directory "Countries"

Request

curl -X GET -H "Accept: application/json" -H "Authorization: 3WQ1EQ465C4005000130" "https://api.lardi-trans.com/v2/references/countries?signs=JP,TZ" 

Response

[
    {
        "sign": "TZ",
        "name": "Танзания"
    },
    {
        "sign": "JP",
        "name": "Япония"
    }
]