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).
API endpoint that allows user to delete database schema
Id of the database that schema is requested
1
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/eregistrations-dev"
Success
"Success"
API endpoint that allows user to create or modify database schema
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/eregistrations-dev"
Group name where this schema is located
"Test"
Catalog name where this schema is located
"Mother and Child"
Short code of the database
"MCR"
"object"
"string"
"=="
""
"&&"
"set-value"
"MCTS{indexNoByCode}"
1
true
true
"Registration ID"
"MCTS31"
1
"string"
"string"
"Child ID"
"ID2"
13
20
"ID"
Success
"object"
"string"
"=="
""
"&&"
"set-value"
"MCTS{indexNoByCode}"
1
true
true
"Registration ID"
"MCTS31"
1
"string"
"string"
"Child ID"
"ID2"
13
20
"ID"
API endpoint that allows user to get database information with schema
Id of the database that schema is requested
1
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/eregistrations-dev"
Database ID
353
Database version number
"2.7"
Database name
"MCTS"
Database description
"Database holding information about MCTS objects"
Owner of the database (institution)
"Ministry of Social Affairs"
Number format in database
"{code}{indexNoByCode}"
Example of databases API request response body
ID of databases
85
Name of databases group
"Mother and Child"
Short name of databases group
"MCTS"
Array of databases schemas
Database ID
353
Database version number
"2.7"
Database name
"MCTS"
Database description
"Database holding information about MCTS objects"
Owner of the database (institution)
"Ministry of Social Affairs"
Number format in database
"{code}{indexNoByCode}"
Example of databases API request response body
List of different schema tags that are related to the database
""
"/Child/Citizenship"
true
List of different schema flags that are related to the database
"mandatory"
"/ID"
""
Shows database draft status (is draft true/false)
false
Shows if database is disabled or not
false
Shows if database is archived or not
false
Shows database last modification time
"2021-10-03T08:35:01.775915Z"
Shows user name of a person who created the database
"ingmar.dev"
Shows id of a person who created the database
1
Shows user id whose behalf was this database created
0
Shows user name whose behalf was this database created
List of possible API services for this database
1
"data-create"
true
0
Shows database increment
0
Shows if this database has logo or not
false
ID of databases group
10
Order number of databases group
76
Data index increment of databases group
3
List of different schema tags that are related to the database
""
"/Child/Citizenship"
true
List of different schema flags that are related to the database
"mandatory"
"/ID"
""
Shows database draft status (is draft true/false)
false
Shows if database is disabled or not
false
Shows if database is archived or not
false
Shows database last modification time
"2021-10-03T08:35:01.775915Z"
Shows user name of a person who created the database
"ingmar.dev"
Shows id of a person who created the database
1
Shows user id whose behalf was this database created
0
Shows user name whose behalf was this database created
List of possible API services for this database
1
"data-create"
true
0
Shows database increment
0
Shows if this database has logo or not
false
API endpoint that allows user to get information about all databases
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/eregistrations-dev"
ID of databases
85
Name of databases group
"Mother and Child"
Short name of databases group
"MCTS"
Array of databases schemas
Database ID
353
Database version number
"2.7"
Database name
"MCTS"
Database description
"Database holding information about MCTS objects"
Owner of the database (institution)
"Ministry of Social Affairs"
Number format in database
"{code}{indexNoByCode}"
Example of databases API request response body
ID of databases
85
Name of databases group
"Mother and Child"
Short name of databases group
"MCTS"
Array of databases schemas
ID of databases group
10
Order number of databases group
76
Data index increment of databases group
3
List of different schema tags that are related to the database
""
"/Child/Citizenship"
true
List of different schema flags that are related to the database
"mandatory"
"/ID"
""
Shows database draft status (is draft true/false)
false
Shows if database is disabled or not
false
Shows if database is archived or not
false
Shows database last modification time
"2021-10-03T08:35:01.775915Z"
Shows user name of a person who created the database
"ingmar.dev"
Shows id of a person who created the database
1
Shows user id whose behalf was this database created
0
Shows user name whose behalf was this database created
List of possible API services for this database
1
"data-create"
true
0
Shows database increment
0
Shows if this database has logo or not
false
ID of databases group
10
Order number of databases group
76
Data index increment of databases group
3
Delete record.
ID of the citizen that needs to be deleted from the Registry data query API
"ID1"
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Searches and returns one record’s one field value.
Primary key field
"DB-1"
Data format. Endpoint: /data/DB/1.0/DB-1/read-value/First%20name.json
"First name"
Data format. Endpoint: /data/DB/1.0/DB-1/read-value/First%20name.json
"json"
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Searches (Regex supported) and returns multiple records as an array-list.
Field for searching random string type data from database
"John"
Field name that user wishes to filter
"FirstName"
How user wishes to order the data
"descending"
Result page number
1
Number of results on one page
10
Example of searchable database field. If more searchable fields are in DB, then more similar fields will follow in input
"Value can be in any supported format, for an example 'string'"
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Number of results
1
URI to next results page
1
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Searches (Regex supported) and returns multiple records as an array-list.
Field for searching random string type data from database
"John"
Field name that user wishes to filter
"FirstName"
How user wishes to order the data
"descending"
Result page number
1
Number of results on one page
10
Example of searchable database field. If more searchable fields are in DB, then more similar fields will follow in input
"Value can be in any supported format, for an example 'string'"
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Number of results
1
URI to next results page
1
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Searches and returns one record.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Searches and returns one record.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Allows a user to see who has read their personal data.
User's personal unique identifier
"EE378129277266"
Database acronym
"MCTS"
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Success Response
Log record ID
"1234567"
Identifier of a reader who looked at personal data
"EE37819285773"
Reader's initials
"JD"
Reader's instituition ID
"EE70049837"
Reader's institution name
"East Hospital"
Reader's institution system name
"East Hospital healthcare back office"
Date and time of registration
"2017-07-21T17:32:28Z"
Personal Data reference
Registration ID
"MCTS31"
Updates one existing record in the registry database.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Search object that needs to be updated
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Update found object with the following data
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Updates multiple records in the registry database that match the input query.
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Find objects that needs to be updated
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Data that needs to be added to the found objects
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Searches records based on input parameters and returns boolean answer (true/false).
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Example object found in database
true
More information about the object
"Object found from database"
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
"eGovStack/GOV/90000009/digitalregistries"
Find object to update, if object not found, new will be created
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Data that will be updated for found Example object. If object not found new object with this data is created
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Citizen's identifier
"EE378627348834"
Citizen's first name
"John Helmut"
Citizen's last name
"Smith Carry"
Birth certificate ID in CR
"RR-1234567889"
Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM
"eGovStack/GOV/90000009/digitalregistries"
Registration ID
"MCTS31"
Record registration date
"2021-10-03T07:03:36Z"
Record expiry date
"2021-10-03T07:03:36Z"
Child object data that is queried from database
Child ID
"ID2"
Child first name
"Usha"
Child last name
"Bajaj"
Child data of birth
"2021-10-03T07:03:36Z"
Child's address
"Longroad 123, Welltown, Ethiopia"
Child is a citizen of this country. ISO 3166-1 encoding list
"ET"
Caretaker's information
Caretaker's ID
"ID1"
Caretaker's first name
"Sowmya"
Caretaker's last name
"Bajaj"
Caretaker's birth date
"2021-10-03T07:03:36Z"
Caretaker's phone number
"+3725278511"
Caretaker's email
"test@test.et"
Registration ID
"MCTS31"
Record registration date
"2021-10-03T07:03:36Z"
Record expiry date
"2021-10-03T07:03:36Z"
Child object data that is queried from database
Child ID
"ID2"
Child first name
"Usha"
Child last name
"Bajaj"
Child data of birth
"2021-10-03T07:03:36Z"
Child's address
"Longroad 123, Welltown, Ethiopia"
Child is a citizen of this country. ISO 3166-1 encoding list
"ET"
Caretaker's information
Caretaker's ID
"ID1"
Caretaker's first name
"Sowmya"
Caretaker's last name
"Bajaj"
Caretaker's birth date
"2021-10-03T07:03:36Z"
Caretaker's phone number
"+3725278511"
Caretaker's email
"test@test.et"