Liking cljdoc? Tell your friends :D

metabase.api.card

/api/card endpoints.

/api/card endpoints.
raw docstring

check-data-permissions-for-queryclj

(check-data-permissions-for-query query)

Check that we have data permissions to run the QUERY in question.

Check that we have *data* permissions to run the QUERY in question.
sourceraw docstring

delete-alert-and-notify-archived!clj

(delete-alert-and-notify-archived! alerts)

Removes all alerts and will email each recipient letting them know

Removes all alerts and will email each recipient letting them know
sourceraw docstring

DELETE_:card-id_favoriteclj

DELETE /api/card/:card-id/favorite

Unfavorite a Card.

PARAMS:
  • card-id
## `DELETE /api/card/:card-id/favorite`

Unfavorite a Card.

##### PARAMS:

*  **`card-id`** 
sourceraw docstring

DELETE /api/card/:card-id/public_link

Delete the publicly-accessible link to this Card.

You must be a superuser to do this.

PARAMS:
  • card-id
## `DELETE /api/card/:card-id/public_link`

Delete the publicly-accessible link to this Card.

You must be a superuser to do this.

##### PARAMS:

*  **`card-id`** 
sourceraw docstring

DELETE_:idclj

DELETE /api/card/:id

Delete a Card. (DEPRECATED -- don't delete a Card anymore -- archive it instead.)

PARAMS:
  • id
## `DELETE /api/card/:id`

Delete a Card. (DEPRECATED -- don't delete a Card anymore -- archive it instead.)

##### PARAMS:

*  **`id`** 
sourceraw docstring

GET_clj

GET /api/card/

Get all the Cards. Option filter param f can be used to change the set of Cards that are returned; default is all, but other options include mine, fav, database, table, recent, popular, and archived. See corresponding implementation functions above for the specific behavior of each filter option. :card_index:

PARAMS:
  • f value may be nil, or if non-nil, value must be one of: all, archived, database, fav, mine, popular, recent, table.

  • model_id value may be nil, or if non-nil, value must be an integer greater than zero.

## `GET /api/card/`

Get all the Cards. Option filter param `f` can be used to change the set of Cards that are returned; default is
  `all`, but other options include `mine`, `fav`, `database`, `table`, `recent`, `popular`, and `archived`. See
  corresponding implementation functions above for the specific behavior of each filter option. :card_index:

##### PARAMS:

*  **`f`** value may be nil, or if non-nil, value must be one of: `all`, `archived`, `database`, `fav`, `mine`, `popular`, `recent`, `table`.

*  **`model_id`** value may be nil, or if non-nil, value must be an integer greater than zero.
sourceraw docstring

GET_:idclj

GET /api/card/:id

Get Card with ID.

PARAMS:
  • id
## `GET /api/card/:id`

Get `Card` with ID.

##### PARAMS:

*  **`id`** 
sourceraw docstring

GET /api/card/:id/related

Return related entities.

PARAMS:
  • id
## `GET /api/card/:id/related`

Return related entities.

##### PARAMS:

*  **`id`** 
sourceraw docstring

GET_embeddableclj

GET /api/card/embeddable

Fetch a list of Cards where enable_embedding is true. The cards can be embedded using the embedding endpoints and a signed JWT.

You must be a superuser to do this.

## `GET /api/card/embeddable`

Fetch a list of Cards where `enable_embedding` is `true`. The cards can be embedded using the embedding endpoints
  and a signed JWT.

You must be a superuser to do this.
sourceraw docstring

GET_publicclj

GET /api/card/public

Fetch a list of Cards with public UUIDs. These cards are publicly-accessible if public sharing is enabled.

You must be a superuser to do this.

## `GET /api/card/public`

Fetch a list of Cards with public UUIDs. These cards are publicly-accessible *if* public sharing is enabled.

You must be a superuser to do this.
sourceraw docstring

hydrate-favoritesclj

(hydrate-favorites cards)

Efficiently add favorite status for a large collection of Cards.

Efficiently add `favorite` status for a large collection of `Cards`.
sourceraw docstring

POST_clj

POST /api/card/

Create a new Card.

PARAMS:
  • visualization_settings value must be a map.

  • description value may be nil, or if non-nil, value must be a non-blank string.

  • collection_position value may be nil, or if non-nil, value must be an integer greater than zero.

  • result_metadata value may be nil, or if non-nil, value must be an array of valid results column metadata maps.

  • metadata_checksum value may be nil, or if non-nil, value must be a non-blank string.

  • collection_id value may be nil, or if non-nil, value must be an integer greater than zero.

  • name value must be a non-blank string.

  • dataset_query

  • display value must be a non-blank string.

## `POST /api/card/`

Create a new `Card`.

##### PARAMS:

*  **`visualization_settings`** value must be a map.

*  **`description`** value may be nil, or if non-nil, value must be a non-blank string.

*  **`collection_position`** value may be nil, or if non-nil, value must be an integer greater than zero.

*  **`result_metadata`** value may be nil, or if non-nil, value must be an array of valid results column metadata maps.

*  **`metadata_checksum`** value may be nil, or if non-nil, value must be a non-blank string.

*  **`collection_id`** value may be nil, or if non-nil, value must be an integer greater than zero.

*  **`name`** value must be a non-blank string.

*  **`dataset_query`** 

*  **`display`** value must be a non-blank string.
sourceraw docstring

POST_:card-id_favoriteclj

POST /api/card/:card-id/favorite

Favorite a Card.

PARAMS:
  • card-id
## `POST /api/card/:card-id/favorite`

Favorite a Card.

##### PARAMS:

*  **`card-id`** 
sourceraw docstring

POST_:card-id_public_linkclj

POST /api/card/:card-id/public_link

Generate publicly-accessible links for this Card. Returns UUID to be used in public links. (If this Card has already been shared, it will return the existing public link rather than creating a new one.) Public sharing must be enabled.

You must be a superuser to do this.

PARAMS:
  • card-id
## `POST /api/card/:card-id/public_link`

Generate publicly-accessible links for this Card. Returns UUID to be used in public links. (If this Card has
  already been shared, it will return the existing public link rather than creating a new one.)  Public sharing must
  be enabled.

You must be a superuser to do this.

##### PARAMS:

*  **`card-id`** 
sourceraw docstring

POST_:card-id_queryclj

POST /api/card/:card-id/query

Run the query associated with a Card.

PARAMS:
  • card-id

  • parameters

  • ignore_cache value may be nil, or if non-nil, value must be a boolean.

## `POST /api/card/:card-id/query`

Run the query associated with a Card.

##### PARAMS:

*  **`card-id`** 

*  **`parameters`** 

*  **`ignore_cache`** value may be nil, or if non-nil, value must be a boolean.
sourceraw docstring

POST_:card-id_query_:export-formatclj

POST /api/card/:card-id/query/:export-format

Run the query associated with a Card, and return its results as a file in the specified format. Note that this expects the parameters as serialized JSON in the 'parameters' parameter

PARAMS:
  • card-id

  • export-format value must be one of: csv, json, xlsx.

  • parameters value may be nil, or if non-nil, value must be a valid JSON string.

  • respond

  • raise

## `POST /api/card/:card-id/query/:export-format`

Run the query associated with a Card, and return its results as a file in the specified format. Note that this
  expects the parameters as serialized JSON in the 'parameters' parameter

##### PARAMS:

*  **`card-id`** 

*  **`export-format`** value must be one of: `csv`, `json`, `xlsx`.

*  **`parameters`** value may be nil, or if non-nil, value must be a valid JSON string.

*  **`respond`** 

*  **`raise`** 
sourceraw docstring

POST_collectionsclj

POST /api/card/collections

Bulk update endpoint for Card Collections. Move a set of Cards with CARD_IDS into a Collection with COLLECTION_ID, or remove them from any Collections by passing a null COLLECTION_ID.

PARAMS:
  • card_ids value must be an array. Each value must be an integer greater than zero.

  • collection_id value may be nil, or if non-nil, value must be an integer greater than zero.

## `POST /api/card/collections`

Bulk update endpoint for Card Collections. Move a set of `Cards` with CARD_IDS into a `Collection` with
  COLLECTION_ID, or remove them from any Collections by passing a `null` COLLECTION_ID.

##### PARAMS:

*  **`card_ids`** value must be an array. Each value must be an integer greater than zero.

*  **`collection_id`** value may be nil, or if non-nil, value must be an integer greater than zero.
sourceraw docstring

POST_relatedclj

POST /api/card/related

Return related entities for an ad-hoc query.

PARAMS:
  • query
## `POST /api/card/related`

Return related entities for an ad-hoc query.

##### PARAMS:

*  **`query`** 
sourceraw docstring

PUT_:idclj

PUT /api/card/:id

Update a Card.

PARAMS:
  • visualization_settings value may be nil, or if non-nil, value must be a map.

  • description value may be nil, or if non-nil, value must be a string.

  • archived value may be nil, or if non-nil, value must be a boolean.

  • collection_position value may be nil, or if non-nil, value must be an integer greater than zero.

  • result_metadata value may be nil, or if non-nil, value must be an array of valid results column metadata maps.

  • metadata_checksum value may be nil, or if non-nil, value must be a non-blank string.

  • enable_embedding value may be nil, or if non-nil, value must be a boolean.

  • collection_id value may be nil, or if non-nil, value must be an integer greater than zero.

  • card-updates

  • name value may be nil, or if non-nil, value must be a non-blank string.

  • embedding_params value may be nil, or if non-nil, value must be a valid embedding params map.

  • dataset_query value may be nil, or if non-nil, value must be a map.

  • id

  • display value may be nil, or if non-nil, value must be a non-blank string.

## `PUT /api/card/:id`

Update a `Card`.

##### PARAMS:

*  **`visualization_settings`** value may be nil, or if non-nil, value must be a map.

*  **`description`** value may be nil, or if non-nil, value must be a string.

*  **`archived`** value may be nil, or if non-nil, value must be a boolean.

*  **`collection_position`** value may be nil, or if non-nil, value must be an integer greater than zero.

*  **`result_metadata`** value may be nil, or if non-nil, value must be an array of valid results column metadata maps.

*  **`metadata_checksum`** value may be nil, or if non-nil, value must be a non-blank string.

*  **`enable_embedding`** value may be nil, or if non-nil, value must be a boolean.

*  **`collection_id`** value may be nil, or if non-nil, value must be an integer greater than zero.

*  **`card-updates`** 

*  **`name`** value may be nil, or if non-nil, value must be a non-blank string.

*  **`embedding_params`** value may be nil, or if non-nil, value must be a valid embedding params map.

*  **`dataset_query`** value may be nil, or if non-nil, value must be a map.

*  **`id`** 

*  **`display`** value may be nil, or if non-nil, value must be a non-blank string.
sourceraw docstring

routesclj

Ring routes for api/card: (POST_ DELETE_:card-id_public_link PUT_:id GET_public GET_embeddable DELETE_:card-id_favorite POST_:card-id_public_link GET_ POST_related POST_:card-id_query GET_:id_related POST_:card-id_favorite DELETE_:id GET_:id POST_:card-id_query_:export-format POST_collections)

Ring routes for api/card:
(POST_
 DELETE_:card-id_public_link
 PUT_:id
 GET_public
 GET_embeddable
 DELETE_:card-id_favorite
 POST_:card-id_public_link
 GET_
 POST_related
 POST_:card-id_query
 GET_:id_related
 POST_:card-id_favorite
 DELETE_:id
 GET_:id
 POST_:card-id_query_:export-format
 POST_collections)
sourceraw docstring

run-query-for-card-asyncclj

(run-query-for-card-async
  card-id
  &
  {:keys [parameters constraints context dashboard-id middleware]
   :or {constraints constraints/default-query-constraints context :question}})

Run the query for Card with parameters and constraints, and return results in a core.async channel. Will throw an Exception if preconditions (such as read perms) are not met before returning a channel.

Run the query for Card with `parameters` and `constraints`, and return results in a core.async channel. Will throw an
Exception if preconditions (such as read perms) are not met before returning a channel.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close