Image
abstract swish line in gradient colouring from pink to blue on a dark blue background

People First API

Pagination

Collections of resources may be paginated; these collections provide additional meta data and hypermedia links allowing the navigation of the paginated set.

The additional links provided are:

  • first: the first page of data
  • last: the last page of data
  • prev: the previous page of data
  • next: the next page of data

The additional meta data attributes provided are:

  • totalPages: the total number of pages in the set
  • pageNumber: the current page number
  • pageSize: the number of resources returned per page
  • maxPageSize: the maximum number of resources that can be requested on a page
  • count: the total number of resources in the set

The following query string parameters can be provided to control the pagination of the returned results:

  • page[offset]: The page index to return (zero indexed)
  • page[limit]: The number of resources to return per page

Example of a paginated collection:

{
  "data": {
    "people": [
      {
        "id": "031c0575-ed2e-4e04-bd01-cc7565045d8b",
        "type": "person",
        "firstName": "Susan",
        "lastName": "Smith",
        "_links": {
          "self": {
            "href": "people/031c0575-ed2e-4e04-bd01-cc7565045d8b"
          }
        }
      },{
        "id": "80e3ef54-2905-42f7-87ac-eaaed55df144",
        "type": "person",
        "firstName": "David",
        "lastName": "Jones",
        "_links": {
          "self": {
            "href": "people/80e3ef54-2905-42f7-87ac-eaaed55df144"
          }
        }
      }
    ]
  },
  "meta": {
    "totalPages": 5,
    "pageNumber": 2,
    "pageSize": 2,
    "maxPageSize": 100,
    "count": 10,
    "links": {
      "self": {
        "href": "people"
      },
      "next": {
        "href": "people?page%5Boffset%5D=4&page%5Blimit%5D=2"
      },
      "prev": {
        "href": "people?page%5Boffset%5D=0&page%5Blimit%5D=2"
      },
      "last": {
        "href": "people?page%5Boffset%5D=8&page%5Blimit%5D=2"
      },
      "first": {
        "href": "people?page%5Boffset%5D=0&page%5Blimit%5D=2"
      }
    }
  }
}
                


 

Concurrency

To prevent concurrency issues when updating or deleting resources an If-Match header is expected on the request, which should be set to the current version of the resource. The resource version is provided in the ETag header on a GET request.

If a request to update or delete a concurrency-controlled resource does not contain a If-Match header a 409 status code will be returned. If the header is provided and does not match the latest version a 412 status code is returned.

Looking for something specific?