Version v0.43 of Metabase is no longer supported. Check out the docs for the current stable version, Metabase v0.63.
Various endpoints that use JSON web tokens to fetch Cards and Dashboards.
The endpoints are the same as the ones in api/public/, and differ only in the way they are authorized.
To use these endpoints:
1. Set the `embedding-secret-key` Setting to a hexadecimal-encoded 32-byte sequence (i.e., a 64-character string).
You can use `/api/util/random_token` to get a cryptographically-secure value for this.
2. Sign/base-64 encode a JSON Web Token using the secret key and pass it as the relevant part of the URL path
to the various endpoints here.
Tokens can have the following fields:
{:resource {:question <card-id>
:dashboard <dashboard-id>}
:params <params>}.
GET /api/embed/card/:tokenFetch a Card via a JSON Web Token signed with the embedding-secret-key.
Token should have the following format:
{:resource {:question <card-id>}}.
tokenGET /api/embed/card/:token/field/:field-id/remapping/:remapped-idFetch remapped Field values. This is the same as GET /api/field/:id/remapping/:remapped-id, but for use with
embedded Cards.
token
field-id
remapped-id
value value must be a non-blank string.
GET /api/embed/card/:token/field/:field-id/search/:search-field-idSearch for values of a Field that is referenced by an embedded Card.
token
field-id
search-field-id
value value must be a non-blank string.
limit value may be nil, or if non-nil, value must be a valid integer greater than zero.
GET /api/embed/card/:token/field/:field-id/valuesFetch FieldValues for a Field that is referenced by an embedded Card.
token
field-id
GET /api/embed/card/:token/queryFetch the results of running a Card using a JSON Web Token signed with the embedding-secret-key.
Token should have the following format:
{:resource {:question <card-id>}
:params <parameters>}.
token
&
query-params
GET /api/embed/card/:token/query/:export-formatLike GET /api/embed/card/query, but returns the results as a file in the specified format.
token
export-format value must be one of: api, csv, json, xlsx.
query-params
GET /api/embed/dashboard/:tokenFetch a Dashboard via a JSON Web Token signed with the embedding-secret-key.
Token should have the following format:
{:resource {:dashboard <dashboard-id>}}.
tokenGET /api/embed/dashboard/:token/dashcard/:dashcard-id/card/:card-idFetch the results of running a Card belonging to a Dashboard using a JSON Web Token signed with the
embedding-secret-key.
token
dashcard-id
card-id
&
query-params
GET /api/embed/dashboard/:token/dashcard/:dashcard-id/card/:card-id/:export-formatFetch the results of running a Card belonging to a Dashboard using a JSON Web Token signed with the
embedding-secret-key return the data in one of the export formats.
token
export-format value must be one of: api, csv, json, xlsx.
dashcard-id
card-id
query-params
GET /api/embed/dashboard/:token/field/:field-id/remapping/:remapped-idFetch remapped Field values. This is the same as GET /api/field/:id/remapping/:remapped-id, but for use with
embedded Dashboards.
token
field-id
remapped-id
value value must be a non-blank string.
GET /api/embed/dashboard/:token/field/:field-id/search/:search-field-idSearch for values of a Field that is referenced by a Card in an embedded Dashboard.
token
field-id
search-field-id
value value must be a non-blank string.
limit value may be nil, or if non-nil, value must be a valid integer greater than zero.
GET /api/embed/dashboard/:token/field/:field-id/valuesFetch FieldValues for a Field that is used as a param in an embedded Dashboard.
token
field-id
GET /api/embed/dashboard/:token/params/:param-key/search/:prefixEmbedded version of chain filter search endpoint.
token
param-key
prefix
query-params
GET /api/embed/dashboard/:token/params/:param-key/valuesEmbedded version of chain filter values endpoint.
token
param-key
query-params
GET /api/embed/pivot/card/:token/queryFetch the results of running a Card using a JSON Web Token signed with the embedding-secret-key.
Token should have the following format:
{:resource {:question <card-id>}
:params <parameters>}.
token
&
query-params
GET /api/embed/pivot/dashboard/:token/dashcard/:dashcard-id/card/:card-idFetch the results of running a Card belonging to a Dashboard using a JSON Web Token signed with the
embedding-secret-key.
token
dashcard-id
card-id
&
query-params