Make your first request
Read clinic information from your server using a narrowly scoped API key.
Before you begin
Coordinate the API base origin and access with BioParse. A doctor in your clinic can create a key in Connectors → Clinic API access. For this first request, choose clinic:read. Copy the token when it is revealed and store it in your server’s secret manager.
The origin below is deliberately non-routable. Replace it with the agreed API origin; no public sandbox or SDK is implied. All example identifiers elsewhere in these docs are synthetic.
curl
Run this on your server or development machine. Populate BIOPARSE_API_TOKEN through your secret tooling, without putting the token in shell history.
export BIOPARSE_API_URL="https://api.example.invalid"
# BIOPARSE_API_TOKEN is supplied by your secret manager.
curl --fail-with-body --silent --show-error \
"$BIOPARSE_API_URL/v1/clinic" \
--header "Authorization: Bearer $BIOPARSE_API_TOKEN" \
--header "Accept: application/json"TypeScript
Use your server’s built-in fetch. This is ordinary HTTP code, not a BioParse SDK. Do not bundle it into a browser application.
const baseUrl = process.env.BIOPARSE_API_URL;
const token = process.env.BIOPARSE_API_TOKEN;
if (!baseUrl || !token) {
throw new Error("Set the integration environment variables.");
}
const response = await fetch(new URL("/v1/clinic", baseUrl), {
headers: { Authorization: `Bearer ${token}`, Accept: "application/json" },
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) {
// Keep clinical response bodies and credentials out of logs.
throw new Error(`BioParse request failed: ${response.status}`);
}
const clinic: unknown = await response.json();Python
This example uses only the Python standard library. Catch HTTPError in your integration and handle its status and Retry-After header as described in errors and retries.
import json
import os
from urllib.request import Request, urlopen
base_url = os.environ["BIOPARSE_API_URL"].rstrip("/")
request = Request(
f"{base_url}/v1/clinic",
headers={
"Authorization": f"Bearer {os.environ['BIOPARSE_API_TOKEN']}",
"Accept": "application/json",
},
)
with urlopen(request, timeout=30) as response:
clinic = json.load(response)Synthetic response
{
"id": "00000000-0000-4000-8000-000000000001",
"name": "Example Clinic"
}Next, choose patients:read or results:read as needed and follow the API reference. Check every response status before consuming its JSON. Avoid logging bodies: even a successful read can contain clinical information.