Records

  1. Get a record
  2. List records
  3. List the trail of change for a record

See the Record definition to understand how this resource fits into the data model.

Get a record

Endpoint

GET /records/{id}

Parameters

Name Type Description
id ID The record identifier.

Gets a record by key.

The column order is implementation dependent when the data is represented in a tabular format like CSV. For tree-like formats like JSON, the object has to be treated as unordered.

GET /records/E09000019 HTTP/1.1
Host: local-authority.register.gov.uk
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Link: </records/E09000019/entries>; rel="version-history"

{
  "_id": "E09000019",
  "name": "Islington"
}

HTTP headers

This resource SHOULD provide a Link: header with a rel="version-history" [RFC5829] to the corresponding Record trail for this record.

List records

Endpoint

GET /records

Query string parameters

Name Type Description
name Name An attribute name part of the data. Required if value is present.
value String The string representation of a valid value for the name. Required if name is present.

Gets the list of records. This resource MAY be paginated.

It is not mandatory to implement the query string parameters for this endpoint.

For example, a request for all records would look like:

GET /records HTTP/1.1
Host: local-authority-eng.register.gov.uk
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "_id": "E09000019",
    "name": "Islington"
  },
  {
    "_id": "E09000016",
    "name": "Havering"
  }
]

For example, you can filter by value on the local-authority-type attribute:

GET /records?name=local-authority-type&value=CC HTTP/1.1
Host: local-authority-eng.register.gov.uk
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "_id": "LND",
    "type": "CC",
    "official-name": "City of London Corporation",
    "name": "City of London",
    "start-date": "1905-06-28"
  }
]

List the trail of change for a record

Endpoint

GET /records/{key}/entries

Parameters

Name Type Description
key ID The record identifier.

Get the list of entries with the record key. This resource MAY be paginated.

The order MUST be by ascending entry number.

GET /records/CI/entries HTTP/1.1
Host: country.register.gov.uk
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "entry-number": 90,
    "entry-timestamp": "2016-04-05T13:23:05Z",
    "key": "CI",
    "blob-hash": "12207c16257bd45b4716914010b39dd40e5a6b985b8928d7b8bb0fe3005d2f2b0fec"
  },
  {
    "entry-number": 207,
    "entry-timestamp": "2017-10-25T09:52:52Z",
    "key": "CI",
    "blob-hash": "1220b3ca21b3b3a795ab9cd1d10f3d447947328406984f8a461b43d9b74b58cccfe8"
  }
]

© Crown copyright released under the Open Government Licence.