Find a dictionary option

The dictionary attribute contains a list of options. Each option has an ID, a number and a value. This article explains how to find a dictionary option using the Management API

Lookup dictionary options

URL

POST https://api.bluestonepim.com/pim/definitions/dictionary/{id}/values/list

Request body

{
   "filters": [
          {
               "values": [
                  "option-1",
                  "option-3"
               ],
               "type": "NUMBER_IN"
          }
   ],
    "page": 0,
    "pageSize": 20
}

The filters parameter is optional. Use it to search for option numbers with type NUMBER_IN or option id's with type ID_IN. 

If the filters parameter is omitted, the endpoint will return all dictionary options. Paginate through the results using page and pageSize parameters.

Response body

{
  "data": [
    {
      "id": "5f59cf80d60180000cb8c29d",
      "lastUpdate": 1599721344415,
      "createdDate": 1599721344415,
      "definitionId": "5f59cf80cff47e000c2ea630",
    "number": "option-1",
      "value": {
        "value": {
        "en": "First option"
        }
      }
    },
    {
      "id": "5f59cf80d60180000cb8c29c",
      "lastUpdate": 1599721344413,
      "createdDate": 1599721344413,
      "definitionId": "5f59cf80cff47e000c2ea630",
    "number": "option-3",
      "value": {
        "value": {
        "en": "Third option"
        }
      }
    }
  ]
}

The response will contain all information about each matching option. The id parameter is the option id, while the definitionId is the id of the dictionary attribute.

Try it in readme.io