Skip to content

API usage

S. Pothier edited this page Mar 18, 2025 · 4 revisions

Also see: README.md

Object Ids and Names

Each of Observatory, Site, Telescope, and Instrument (OSTI) have both and id and a name.

An explicit example would be that if your observatory is myObs , your site id would be myObs.mySite, your telescope would be myObs.mySite.myTel , and your instrument would be myObs.mySite.myTel.myInst This way just having your telescope or instrument id, it is both fully unique and you can see what observatory/site it comes from. The name field is just a human readable name - usually used in the UI. So if your id is myObs your name could be My Observatory or whatever you would want displayed in the UI. The name field doesn't have to form a unique identifier - it'll never be used to reference something in code, just for display in the UI.

Status and Capability

The TelescopeStatus or InstrumentCapability contain a date field (date a record is created). Both models may contain historical data. To get the "current" status or capability, retrieve the record with the latest date.

Neither model is mean to be updated or deleted by the API client.

See https://github.com/scimma/heroic/issues/6#issuecomment-2715825699

Error handling

The API client should check the status of the HTTP response from its request. Currently the response does not give much insight into the reason for an error. That will change.

Common problems with API request may include:

  1. Object already exists
  2. Payload is missing some required fields
  3. Name, Id lengths are to long
  4. other data validation issues

Clone this wiki locally