Skip to content

Improve API response profile/format options #400

@kjlippold

Description

@kjlippold

Describe the feature you'd like and what it will do

Define the following response profiles for all data management API endpoints:

  1. compact: Returns only the ID and name for each resource in the collection.
  2. standard: Returns all resource fields, and IDs of related many-to-one resources.
  3. extended: Returns all resource fields, and nested standard responses for all many-to-one related resources.

For Sites, either add an additional profile that contains the minimum fields required to display sites on a map, such as "map" or "location", or just include minimal location metadata in the compact profile. Alternatively, we could add a GeoJSON format or a dedicated map tile service API that serves map tiles.

For Datastreams, we could also consider adding a bounded sparkline block to the extended response that contains the most recent 100 or so observations in a compact columnar or row oriented format.

For Observations, the compact profile should return time-value pairs without IDs; the standard profile should return time-values pairs, plus quality metadata; the extended profile should include time-value pairs, quality metadata, and observation IDs.

Why is this feature important?

We've started adding dedicated endpoints to serve some pages of the data management app. Most of these endpoints just retrieve collections of resources formatted differently than the standard endpoint, however we don't currently have feature parity between these collection endpoints, e.g., /things/site-summaries and /things both return collections of things, but the site-summaries endpoint does not provide the same filters as /things, which may be confusing for consumers of our API.

For endpoints that return the same collection of resources, but formatted differently or using different subsets of properties, it will be easier to maintain the API if we use one endpoint per collection, and expose additional profile and/or format parameters on the endpoints.

Is your feature request related to a problem? Please describe.

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions