Skip to main content

Examples overview

Each page in this section solves one operational problem against the real platform API contracts, with complete implementations in TypeScript (fetch), Python (requests), Go (net/http), and cURL.

ExampleProblem it solves
Ingest telemetryPush records in batches of at most 1,000 and handle partial rejection correctly.
Poll topologyReconstruct fleet state over time with a stepped as_of_utc poller.
Fetch predictionsRead SNR predictions for link ids, handling empty results and 429 backoff.
Monitor the platformHealth probes plus an authenticated key check, with exit codes for cron and CI.
Connection smoke testThe staged health-then-auth flow the console's connection test runs.

Common setup

Every example reads two environment variables:

export CONSTELLATION_API_BASE="https://api.constellation.space" # or dev/stage/sandbox
export CONSTELLATION_API_TOKEN="<your tenant API key>"

Base URLs per environment are listed in the API overview; keys are environment-specific (Authentication). All authenticated calls send the key as the x-api-key header. Run these from server-side environments; browser origins are CORS-restricted (API overview).

Language notes:

  • TypeScript: uses the built-in fetch, Node 18 or newer, no dependencies. Run with npx tsx script.ts or compile with tsc.
  • Python: uses requests (pip install requests), Python 3.9 or newer.
  • Go: standard library only, Go 1.21 or newer.
  • cURL: plain curl plus jq for JSON handling where needed.