This section provides a reference for APIs that should be implemented by this Building Block.
The APIs defined here establish a blueprint for how the Building Block will interact with other Building Blocks. Additional APIs may be implemented by the Building Block, but the listed APIs define a minimal set of functionality that should be provided by any implementation of this Building Block.
The GovStack non-functional requirements document provides additional information on how 'adaptors' may be used to translate an existing API to the patterns described here. This section also provides guidance on how candidate products are tested and how GovStack validates a product's API against the API specifications defined here.
The tests for the Digital Registries Building Block can be found in this GitHub repository.
The Digital Registries Building Block may contain multiple registries/databases. The dynamic nature of the database structure requires a standard set of automatically generated APIs for all databases hosted on the platform. The system generates default API method endpoints automatically after each publication 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 structure of the API endpoint are 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 Building Block enables an Analyst to change the data storage structure/schema on the fly. In the following example API descriptions are generated for one example dataset for the Postpartum Infant Care Program registry, where the Caretaker and infant child are registered and a registration ID is issued.
Digital Registries Building Block is expected to host the following API services for each database hosted on the platform.
The API is built using a representational state transfer (REST) software architectural style and described in Open API 3 standard using YAML (a human-readable data-serialization language). Request and response body is in JSON (lightweight data-interchange format).
Delete record.
ID of the citizen that needs to be deleted from the Registry data query API
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Searches and returns one record’s one field value.
Primary key field
Data format. Endpoint: /data/DB/1.0/DB-1/read-value/First%20name.json
Data format. Endpoint: /data/DB/1.0/DB-1/read-value/First%20name.json
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Searches (Regex supported) and returns multiple records as an array-list.
Field for searching random string type data from database
Field name that user wishes to filter
How user wishes to order the data
Result page number
Number of results on one page
Example of searchable database field. If more searchable fields are in DB, then more similar fields will follow in input
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Number of results
URI to next results page
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Searches (Regex supported) and returns multiple records as an array-list.
Field for searching random string type data from database
Field name that user wishes to filter
How user wishes to order the data
Result page number
Number of results on one page
Example of searchable database field. If more searchable fields are in DB, then more similar fields will follow in input
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Number of results
URI to next results page
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Searches and returns one record.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Searches and returns one record.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Allows a user to see who has read their personal data.
User's personal unique identifier
Database acronym
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Success Response
Log record ID
Identifier of a reader who looked at personal data
Reader's initials
Reader's instituition ID
Reader's institution name
Reader's institution system name
Date and time of registration
Personal Data reference
Registration ID
Updates one existing record in the registry database.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Search object that needs to be updated
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Update found object with the following data
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Updates multiple records in the registry database that match the input query.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Find objects that needs to be updated
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Data that needs to be added to the found objects
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Searches records based on input parameters and returns boolean answer (true/false).
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Example object found in database
More information about the object
API updates existing record if matching with input parameters is successful. If record is not found the API will create a new record.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Find object to update, if object not found, new will be created
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Data that will be updated for found Example object. If object not found new object with this data is created
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Citizen's identifier
Citizen's first name
Citizen's last name
Birth certificate ID in CR
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Registration ID
Record registration date
Record expiry date
Child object data that is queried from database
Child ID
Child first name
Child last name
Child data of birth
Child's address
Child is a citizen of this country. ISO 3166-1 encoding list
Caretaker's information
Caretaker's ID
Caretaker's first name
Caretaker's last name
Caretaker's birth date
Caretaker's phone number
Caretaker's email
Registration ID
Record registration date
Record expiry date
Child object data that is queried from database
Child ID
Child first name
Child last name
Child data of birth
Child's address
Child is a citizen of this country. ISO 3166-1 encoding list
Caretaker's information
Caretaker's ID
Caretaker's first name
Caretaker's last name
Caretaker's birth date
Caretaker's phone number
Caretaker's email
API endpoint that allows user to delete database schema
Id of the database that schema is requested
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Success
API endpoint that allows user to create or modify database schema
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Group name where this schema is located
Catalog name where this schema is located
Short code of the database
Success
API endpoint that allows user to get database information with schema
Id of the database that schema is requested
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
Database ID
Database version number
Database name
Database description
Owner of the database (institution)
Number format in database
Example of databases API request response body
ID of databases
Name of databases group
Short name of databases group
Array of databases schemas
Database ID
Database version number
Database name
Database description
Owner of the database (institution)
Number format in database
Example of databases API request response body
List of different schema tags that are related to the database
List of different schema flags that are related to the database
Shows database draft status (is draft true/false)
Shows if database is disabled or not
Shows if database is archived or not
Shows database last modification time
Shows user name of a person who created the database
Shows id of a person who created the database
Shows user id whose behalf was this database created
Shows user name whose behalf was this database created
List of possible API services for this database
Shows database increment
Shows if this database has logo or not
ID of databases group
Order number of databases group
Data index increment of databases group
List of different schema tags that are related to the database
List of different schema flags that are related to the database
Shows database draft status (is draft true/false)
Shows if database is disabled or not
Shows if database is archived or not
Shows database last modification time
Shows user name of a person who created the database
Shows id of a person who created the database
Shows user id whose behalf was this database created
Shows user name whose behalf was this database created
List of possible API services for this database
Shows database increment
Shows if this database has logo or not
API endpoint that allows user to get information about all databases
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
ID of databases
Name of databases group
Short name of databases group
Array of databases schemas
Database ID
Database version number
Database name
Database description
Owner of the database (institution)
Number format in database
Example of databases API request response body
ID of databases
Name of databases group
Short name of databases group
Array of databases schemas
ID of databases group
Order number of databases group
Data index increment of databases group
List of different schema tags that are related to the database
List of different schema flags that are related to the database
Shows database draft status (is draft true/false)
Shows if database is disabled or not
Shows if database is archived or not
Shows database last modification time
Shows user name of a person who created the database
Shows id of a person who created the database
Shows user id whose behalf was this database created
Shows user name whose behalf was this database created
List of possible API services for this database
Shows database increment
Shows if this database has logo or not
ID of databases group
Order number of databases group
Data index increment of databases group