REST API
Use REST API to automate interactions with Trifolia-on-FHIR (ToF). For example, a REST API can export your implementation guide (IG) on a regular schedule through another program.
Multiple FHIR servers
- The default FHIR server for this proxy endpoint is the first FHIR server available in the drop-down of FHIR servers in the settings screen of the application.
- If the ToF installation is configured to support multiple FHIR servers, the first FHIR server is the default in the REST API.
- To perform REST API operations on a different FHIR server, specify a fhirserver header in each request. The value of the fhirserver header must align with the ID of one of the FHIR servers returned by /api/config.
For more information, see FHIR Versions.
FHIR Server Proxy
An /api/fhir end-point in the API represents a "proxy" to the FHIR server(s) available within the ToF installation. The proxy endpoint supports GET, PUT, POST, DELETE requests for individual resources, as well as batches. Transactions are not supported by this proxy.
Authentication
Authentication is required to access the REST API. To get an authorization code to use the REST API:
- Log into the ToF web application and open the settings screen where the Authorization Code is displayed.
- Attach the authorization code in an Authorization header prefixed with Bearer.
Example: "Authorization: Bearer XXXX" where XXXX is your authorization code.
Trifolia-on-FHIR Native API
ToF's REST API is documented using Swagger. The publicly available installation exposes custom API documentation at /api-docs. The API described by /api-docs is the same API the web application (i.e., user interface) uses.