Skip to main content
The haau3 platform API is in preview: it may change as we build, usually to add features or improve performance.
The platform API has an open-source SDK for TypeScript, Python and Go. Each is generated from the API’s OpenAPI document, so every endpoint is a method named by its operationId, with its parameters and its answer typed. Each also retries after a timeout, a network failure, a 429 or a 5xx, gives typed errors that never print a response body, follows a FHIR search’s pages, and sends several requests as one batch. All three are MIT licensed. Each runs on a server only, and refuses to start in a browser, where an API key would be public. Every operation’s page in the API reference shows its call in each language beside the curl command.

Install

Authenticate

Create an API key on platform.haau3.com (see Authentication). Each SDK reads it from HAAU3_API_KEY, or takes it as an option. Make one client and reuse it: it holds a pool of connections.
Python also has AsyncHaau3, with the same methods awaited, on asyncio and on trio.

A first call

A FHIR answer is FHIR R4 in each language’s own form: @types/fhir’s types in TypeScript (exported as fhir4), plain dicts typed with TypedDicts from HL7’s R4 schema in Python, and structs generated from the same schema in Go’s fhir package. FHIR elements are optional, so Python reads them with .get() and Go holds each as a pointer. The other services’ answers have the API’s own types.

One call per service

Each SDK’s api.md lists every method by service, with its request and its page in the API reference: TypeScript, Python and Go.

Errors

Every error the API answered carries its request id. No answer is never reported as an empty result, and an empty result is never an error. An error’s message never includes the body the API answered with, and the body is never printed when the error is logged. A FHIR answer is checked against the resource types its operation answers with, and anything else is a no-answer error with the reason unreadable. Errors lists every status the API answers.

Request ids and timing

Quote the request id when you ask for help: it finds the request in the API’s own logs. To find a request by an id of your own, pass a UUID as the call’s correlation id, and it comes back on the answer and on every error the API answered.

Paging

Each SDK follows a FHIR search’s next links on the client’s own host, one page at a time, or one resource at a time across every page:
Scheduling’s searches page with limit and offset instead, and answer with a total.

Several requests in one

A batch sends several operations of the FHIR base as one request, and each gets its own result, in the order given:
An entry that fails does so alone, while the others answer. The API takes up to 100 entries in up to 1 MiB, and gives a batch 60 seconds. Every operation on the FHIR base can go in a batch except the batch itself and MedList’s $reconcile-medications.

Any request

Each SDK sends a request as you give it and returns what the API answered, whatever the status:

Options

Every option has a default: A call can set its own time and retries too. A retry waits a short, growing interval, or what the API’s Retry-After header says when that is 60 seconds or less. A longer one fails at once, carrying it. The API key is sent only to the base URL’s host. Set HAAU3_BASE_URL to run code you have not changed against a stand-in API of your own.

Frameworks and testing

Each README covers its own language’s frameworks and tests:

Versions

Each SDK is 0.y.z while the API is in preview: a minor release may change what a method takes or answers, and a patch release never does. Each repository’s CHANGELOG.md lists every release, and a release that takes a new version of the API’s spec names that version.