8 Service APIs
This section describes external APIs that must be implemented by the building block. Additional APIs may be implemented by the building block (all APIs must adhere to the standards and protocols defined), but the listed APIs define a minimal set that must be provided by any implementation.
Registries BB may contain multiple registries/databases. The dynamic nature of the database structure requires a standard set automatically generated APIs for all databases hosted on the platform. The system generates default API method endpoints automatically after each publish of the database schema. A new API service version is generated after each schema publish. Database schema version and API versions are in sync.
The naming convention and a structure of the API endpoint is the following:
/{information type}/{registry acronym or code}/{version}/{API method as a name}.
Example 1: /api/data/cr/1.0/create
Example 2: /api/v1/database/modify
Each registry contains a unique set of data and the BB enables an Analyst to change the data storage structure/schema on the fly. In this following example API descriptions are generated for one example dataset for the Postpartum Infant Care Program registry, where Caretaker and infant child is registered and registration ID is issued.
Example registry database logical data model.
.png?alt=media)
Example registry database Json schema.
Digital registries BB is expected to host the following API services for each database hosted on the platform
Description: Creates a new record in the registry database.
Request endpoint: POST /data/{code}/{version}/create
Oops, something is missing.
We could not find the original source to display this content.
Description: Updates one existing record in the registry database.
Request endpoint: PUT /data/{code}/{version}/update
Oops, something is missing.
We could not find the original source to display this content.
Description: API updates existing record if matching with input parameters is successful. If record is not found the API will create a new record.
Request endpoint: POST /data/{code}/{version}/update-or-create
Description: Updates multiple records in the registry database that match the input query.
Request endpoint: PUT /data/{code}/{version}/update-entries
Description: Searches (Regex supported) and returns multiple records as an array-list.
Request endpoint: GET /data/{code}/{version}
Description: Searches and returns one record.
Request endpoint: POST /data/{code}/{version}/read
Description: Searches and returns one record’s one field value.
Request endpoint: GET /data/{code}/{version}/{ID}/read-value/{field}.{ext}
Description: Searches records based on input parameters and returns boolean answer (true/false).
Request endpoint: POST /data/{code}/{version}/exists
Description: Delete record.
Request endpoint: DELETE /data/{code}/{version}/{ID}/delete
Description: The purpose of this API is to make personal data protection better and make BB personal data usage transparent by showing who has looked at personal data of the user. Each user can see who has looked at their personal data and when. The definition of personal data is described by each BB owner in the respective country.
Request endpoint: GET /data/MyPersonalDataUsage/{version}
Database Schema APIs are following:
Description: API reads existing registry database schema.
Request endpoint: GET /api/V1/database/{id}
Description: API creates a new registry database schema or updates existing schema if matching with input parameters is successful. If schema is not found the API will create a new schema.
Request endpoint: POST /api/V1/database/modify
Description: API deletes registry database.
Request endpoint: DELETE /api/v1/database/{id}
Description: API gets all databases and schema versions as a list array.
Request endpoint: GET /api/v1/databases
Example API: see in github.
Standards/Protocols:
The API is built using representational state transfer (REST) software architectural style (https://restfulapi.net/) and described in Open API 3 standard
(https://swagger.io/specification/) using YAML (a human-readable data-serialization language - http://yaml.org/). Request and response body is in JSON (lightweight data-interchange format - https://www.json.org/json-en.html).
Last modified 9mo ago