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

People First API

Resource templates

The aim of this section of the API documentation is to explain the concept of a Resource Template. Before explaining what a Resource Template is in the context of the People First APIs let's first break this term down to understand its meaning and application.


What is a REST Resource?

A REST Resource can be almost any content which is returned from a REST application in response to an API endpoint request. A resource could be any of the follow formats:

  • Image
  • Video
  • HTML file or extract
  • XML object
  • JSON object

Resources returned from PF API endpoints will nearly always be JSON objects containing information retrieved from the PF API Databases.


What is a Template?

A template can be best described as a blueprint or design that provides a pre-determined structure, layout and / or style.


What is a Resource Template and what are they used for?

A resource template is a blank version of a resource, which also provides the structure and layout of that resource. This is provided to the client to fill in and post back to create a new resource. Below is an example of a resource template to create a person. This example is in JSON format and is provided with all the fields blank bar a few which are auto-populated by the PF APIs.

 {
  "person": {
    "_links": {},
    "firstName": "",
    "lastName": "",
    "title": "",
    "otherNames": "",
    "knownAs": "",
    "pronouns": "",
    "previousLastName": "",
    "startDate": "2022-06-01",
    "personalReference": "",
    "socialSecurityNumbers": [
      {
        "legislation": "47c23873-057b-4b22-b2d9-a1a31ccec3fb",
        "socialSecurityNumber": "",
        "_status": "new"
      }
    ]
  }
}

Looking for something specific?