New FHIR API Explorer App

By the development and donation of this web app, I hope to help other folks, through both example code and functionality, a head start on their own application to take advantage of OpenEMR API’s.

Feedback and improvements are greatly appreciated.
For convivence here is a download. Use repo for up to date code.
Unzip in openemr root:
oe-module-api-explorer.zip (32.8 KB)
example bookmark: https://localhost/openemr/modules/oe-module-api-explorer/oeApiExplorer.php?cleanSession

OpenEMR API Explorer - Installation Guide

Purpose

Educational reference implementation for developers building apps that integrate with OpenEMR’s OAuth2, FHIR, and Standard REST APIs.

Features

  • FHIR and Standard API support
  • OAuth2 client registration (JWT, Confidential, Public clients)
  • Multiple grant type support (Authorization Code + PKCE, Client Credentials, JWT Bearer, Refresh Token)
  • Interactive API explorer with browser-based UI
  • Multi-site configuration support
  • Automatic JWT key generation and JWKS setup
  • Smart UI that syncs client and grant selections
  • Scope-based resource population
  • Token auto-refresh functionality

Requirements

  • OpenEMR 7.02+
  • PHP 8.1+ with OpenSSL extension
  • SSL certificate (only required if using jwks_uri mode)

Installation Steps

  1. Clone or download the project to your OpenEMR modules directory
  1. Navigate to /openemr/modules/oe-module-api-explorer/
  2. Edit config.php if needed (default localhost configuration works for most setups)
  3. Access the explorer at oeApiExplorer.php
  4. Register clients from within the app(Register will create all(3) required client types and keys):
    • Select desired API Site from dropdown
    • Click “Register Clients” button
    • Repeat for each site you want to use

Quick Start

  1. Open oeApiExplorer.php in your browser
  2. Select API Site and click “Register Clients” (do this for each site you plan to use)
  3. Select client type, grant type, API type, and resource
  4. Click “Fetch” to test API calls

Configuration

  • Edit config.php to add additional OpenEMR sites
  • Default supports localhost, docker, and remote demo sites
  • JWKS can be served inline (default) or via file (requires SSL)

Key Files

  • client_register.php - Client and key registration
  • oeApiExplorer.php - Main browser interface
  • oauth_client.php - OAuth2 flow handlers
  • config.php - Environment configuration
  • clients_keys/ - Generated client credentials and keys

Links

Support

This is a community-contributed educational tool. For issues or contributions, use the GitHub repository.

2 Likes
  • Select a Site then Register:
  • After register select site, grant and a resource:

  • Be sure to enable client that the Explorer doesn’t have database access to auto enable.
3 Likes