Test with curl
Using curl provides a lightweight way to validate authentication, connectivity, and request formatting from the command line. curl is commonly used for scripting, automation, and troubleshooting outside of interactive tools.
Prepare the Request
Before sending a request, ensure that the following information is available:
- Fast Healthcare Interoperability Resources (FHIR) R4 base URL for the selected environment
- OAuth 2.0 access token
- Target FHIR resource and identifier
The access token must be included in the Authorization header of each request.
Send a Test Request
Send an HTTPS GET request to the Health Gorilla FHIR API using curl. The example below uses a Patient read request to validate access.
Example: Patient Read Request
curl -X GET "https://sandbox.healthgorilla.com/fhir/R4/Patient/YOUR_PATIENT_ID" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Accept: application/fhir+json"Replace YOUR_PATIENT_ID with a valid patient identifier available in the target environment.
Review the Response
A successful request returns an HTTP 200 OK response and a FHIR resource in JSON format.
Confirm that:
- The request completes without authentication errors.
- The response body contains the expected FHIR resource.
- Returned data aligns with the scopes associated with the access token.
Troubleshoot Common Issues
If the request does not succeed, review the following:
- The access token is valid and unexpired.
- The request is sent to the correct environment base URL.
- The OAuth 2.0 scopes assigned to the token permit access to the requested resource.
curl responses are useful for debugging because they expose raw HTTP behavior, making them well suited for diagnosing authentication or formatting issues.
Once a request succeeds using curl, connectivity and token handling are confirmed at the protocol level.
Updated about 1 hour ago

