To read existing transaction records you will need to make a TLS request to the OpenHIM API for the below method and endpoint.
#Read all transactions
The following query parameters are supported:
filterLimit: The max number of transactions to return
filterPage: The page to return (used in conjunction with
filterRepresentation: Determines how much information for a transaction to return; options are
simple: minimal transaction information
simpledetails: minimal transaction information, but with more fields than simple
bulkrerun: minimal transaction information required in order to determine rerun status
full: Full transaction information
fulltruncate: The same as full except that large transaction bodies will be truncated
channelID: Only return transactions that are linked to the specified channel
filters: Advanced filters specified as an object. Transaction fields can be specified based on the transaction schema. For example, in order to filter by response status 200 and a property called
propwith a value
val, the following query could be used:
#Read client's transactions
#Read a specific transaction
#Example Fetch transactions
Before we can send our request to the OpenHIM API we need to ensure that we construct our valid HTTP headers to successfully authenticate with the OpenHIM API.
Copy the below code at the bottom of your nodejs script that handles the authentication of the OpenHIM headers as described in the authentication section.
openhimOptions values with the correct implementation details
Ensure that you have created your bash script to construct the HTTP authentication headers and send the request to the OpenHIM API as described in the authentication section.
Execute the below command in your terminal where the file is located with the required arguments. Replace the placeholder arguments with the correct implementation details.
The response status code will be
200 if successful.