Python demos for calling FAIMS3 REST APIs with a long-lived API token.
- uv (manages Python and dependencies)
- A FAIMS3 deployment with the Conductor API reachable from your machine
- A long-lived API token and a project (notebook) ID you can read
cd python
cp .env.example .env
# Edit .env with your API URL, token, and project ID
uv syncRead-only demo of the Records CRUD API:
- Exchanges the long-lived token for a short-lived access token
- Lists record metadata (
GET /api/notebooks/:id/records/metadata) - Fetches full data for one record (
GET /api/notebooks/:id/records/:recordId)
uv run fetch_records_demo.py
uv run fetch_records_demo.py --limit 10
uv run fetch_records_demo.py --record-id rec-abc123
uv run fetch_records_demo.py --form-id FORM2CLI flags override values from .env.
Long-lived tokens are not sent on every API call. Exchange them for a short-lived Bearer token first:
Long-lived token → POST /api/auth/exchange-long-lived-token → Bearer token → API calls
Access tokens expire after about five minutes; the demo refreshes automatically.