Record Search clients
Perform an advanced search of civil registration records from a trusted, external e-Gov service
Perform an advanced search of civil registration records from a trusted, external e-Gov service
The Record Search client can perform an advanced search of civil registration records. Use this to help support social protection systems, check the existence of civil registration records or check citizen demographics.
To stop abuse of such a powerful API, all results returned are audited as having been downloaded by the client. System Administrators should be careful to ensure that citizen data is not exposed to untrustworthy individuals by using this API.
All client behaviour is audited and is ultimately the personal responsibility of the National System Administrator of OpenCRVS that created the client. Protect citizen data and do not expose it unnecessarily as you may be in breach of local laws.
A daily limit of 2000 Record Search requests per client, per day is hardcoded into OpenCRVS Core. Any subsequent requests will fail.
You can use our Postman collections to test Record Search API functionality. Postman is a tool you can download to test API access before building your integrations.
Submitting a Record Search
To submit an Record Search, your client must first request an authorization token using your client_id
and client_secret
.
With the token as an authorization header, the following example request will submit a record search in GraphQL. GraphQL is the chosen protocol as this API re-uses the same Advanced Search GraphQL queries that are used buy the OpenCRVS GUI.
You can browse to the GraphQL Playground using an authorization header to view the full documentation for the searchEvents GraphQL query.
https://gateway.your_domain/graphql
The GraphQL parameters are explained below. A full list of available Advanced Search GraphQL variables is also explained below.
GraphQL Parameters
GraphQL variables.advancedSearchParameters object
We recommend that you use the Advanced Search feature in the OpenCRVS application and monitor the GraphQL payload that is sent to the Gateway using the Chrome Developer Tools "Network" tab, in order to understand how these parameters are formatted. The table below lists all possible parameters with a description and example where we feel further explanation is helpful.
Record Search Response
The response from a record search is not FHIR, but an Elasticsearch response. The audit experience is explained below the example payload.
After a search has completed and if you search for any record returned, you will see that in Record Audit, an entry shows that this client has accessed the personally identifiable citizen data on the record.
Parameter | Description |
---|---|
Parameter | Description | Example |
---|---|---|
operationName
Must be "searchEvents"
query
Use the exhaustive GraphQL syntax supplied or remove individual return parameters if you do not require that citizen information. Protect citizen's privacy! Only request what you need.
variables.advancedSearchParameters
A JSON object of optional search parameters listed below
count
The number of records to be returned per page
skip
Pagination offset
event
An enum for the registration event. Can be "birth" or "death"
birth
name
A string that can be used to search ALL names.
registrationStatuses
An array of possible application status enums. Possible statuses
["IN_PROGRESS", "REGISTERED"]
dateOfEvent
The date of event. YYYY-MM-DD
recordId
A unique uuid for the registration that forms part of the QR code URL on the certificate. Use this to validate a certificate.
dateOfEventStart
If you dont know the date of event, you can enter a start and end date to search within a range. YYYY-MM-DD
dateOfEventEnd
As above
contactNumber
The informant's mobile phone number with country code
nationalId
Any national id associated with any individual who has been involved in a registration event as a string
registrationNumber
An event registration number as a string