Skip to content

Metabase REST API Patterns

Daniel Higginbotham edited this page Jan 23, 2020 · 4 revisions

General Patterns used in the Metabase REST API

I'm hoping we can write down:

  • Patterns for using the REST API with a client (e.g. the JS web app frontend), and code examples
  • Patterns for handling REST API requests in the backend, and code examples
  • Reasoning behind any patterns that aren't obvious

Requests

Auth

TODO

Responses

Errors

Request Parameter Errors (Schema validation errors)

These all have a standard pattern, since the code that throws them is generated by the defendpoint macro. I have to go look it up and post it here

TODO
Query Processor errors

We are in the process of standardizing all of these to come back with an :error_type key (going forward); they also come back with:

TODO

Async Responses

Async responses return a 202 status and stream the body. The body should include a _status JSON key so that the frontend can dispatch on non-OK responses. In particular, if an exception is thrown we want the frontend to display it.

Clone this wiki locally