JSON API: Domain Queries

Domain queries are used to obtain a list of the domains defined in the ledger.

Refer to the domain query schema for a formal definition of the request and the domain query response schema for a definition of the response.

Domains are retrieved by code and/or name. There are two ways to select results by code: the range andrangeEnding properties specify the first and last code to retrieve, respectively. Alternatively, the codes array can be used to select or exclude specific codes and code ranges.

The names property can be used to select names by content or language, including wildcard and exclusion. See Range Selectors for more information on ranges with examples.

The page size limit is capped by the ledger configuration. If a request is made for more records than the configured limit, then only the configured maximum page size will be returned.

Route: domain/query

Request all domains in sets of 10:

{
  "limit": 10
}

Request a single domain:

{
  "codes": ["ENG"]
}

Request all domains containing "pharma":

{
  "names": {
    "name": "%pharma%",
    "like": true
  }
}

Sample result:

{
  "domains": [
    {
      "uuid": "2da08cab-6de0-43db-8b39-de5a1e484b9d",
      "code": "ENG",
      "currency": "CAD",
      "names":[
        {
          "name": "Engineering",
          "language": "en",
          "createdAt": "2021-12-22T05:28:27.776353Z",
          "updatedAt": "2021-12-22T05:28:27.776353Z"
        },
        {
          "name": "la machination",
          "language": "fr",
          "createdAt": "2021-12-22T05:28:27.779119Z",
          "updatedAt": "2021-12-22T05:28:27.779119Z"
        }
      ],
      "revision": "10b15d680033c4622d6616ff1204be9c291e246d43e898471d570a41fab3bb04",
      "createdAt": "2021-12-22T05:28:27.774975Z",
      "updatedAt": "2021-12-22T05:28:27.774975Z"
    }
  ],
  "after": "2ec47cc3-6117-40f8-adaf-d1067caf04b0",
  "time": "2022-01-18T16:10:58.021722Z"
}