Draft API Specification
As we are moving to an API first approach for HSDS we need to specify what a minimal API should look like. We also need to define some methods that, even if they are not required, should be consistent amongst publishers of this API.
The document Por11328 - Aligning Open Referral and Open Referral UK - The API - HSDA contains work as an approach to the API. All sections in this document from 1 - 2.5 should be followed.
The following spreadsheet contains information on the endpoints that will be codified into an OpenAPI specification:
Aspects of the above spreadsheet differ from what has been previously discussed and may need to be discussed further:
MUST, SHOULD, COULD.
Each endpoint and parameter has a must, could or should related to it (column C). The opinions about what things fit into these categories might be implementation specific and there might be disagreement about what minimally should fit in each category.
We invite people to share their views by adding comments directly to the spreadsheet. To do this, right click fields within the ‘API Required’ column (Column C) and add a comment for us to review.
“full” parameter.
Service list by default will contain relationships that are only one-to-one with it. This option gives you the possibility in certain publications to ask for the full nested JSON object.
organization/{id} by default only contains minimal service information
This is so that publications that have organizations containing lots of services will not need to provide all the related full nested service information at once. This is because services in organizations can not be paginated and may mean the response size is too big.
A parameter full_service
has been added to be able to ask for that information on publications that wish to support it.
Not many detailed search parameters
Things like location/age range search are not currently part of core spec. However, these and other paramenters may be adopted into the core spec in the future to allow further interoperability.
An optional New Line Delimited JSON endpoint for services.
Pagination is easy to implement and should be the default but has downsides of not ensuring consistency when paginating through large amounts of data if the data is changing while paginating. Streaming all the data using NDJSON is a solution to this as the provider streams all data that is consistent at one point in time. This will not be for all publications but useful for ones that care about consistent reconciliation/federation.
Recommendations
From doing this work we’ve identified that the following things would be very beneficial as a part of the core spec. Both have been discussed previously, but not yet decided for 3.0:
UUIDs
All IDs should be UUIDs to help with reconciliation and federation. We previously said that we did not want to break backwards compatibility to do this, but as we are now moving to an API approach, specifying this now would be a great benefit.
Last Modified Dates for Services.
An optional “last_modified” datetime field against a service that changed when a service and ANY related data changed, would be very good to add before 3.0. It would give the service endpoints a way to say they only wanted changes from a certain point.
We are proposing the addition of these as a part of the 3.0 upgrade and would welcome people’s views on this also.
Please share your comments and feedback by replying to this post.
For those in the HSDS workgroup. I will send an email out shortly inviting you to a workgroup meeting to discuss this as a collective next Monday (13th Feb)
Thanks to @davidraznick for his hard work on this.
Dan