Skip to content

Commit

Permalink
Merge pull request metabase#6476 from metabase/fix-bad-error-message-…
Browse files Browse the repository at this point in the history
…in-card-endpoint

Fix incorrect error message for GET /api/card endpoint
  • Loading branch information
camsaul authored Nov 27, 2017
2 parents ec12d4c + cf8c148 commit 894cbe4
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 100 deletions.
35 changes: 20 additions & 15 deletions docs/api-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,20 @@ Delete a `Card`.

## `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:
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:

Optionally filter cards by LABEL or COLLECTION slug. (COLLECTION can be a blank string, to signify cards with *no collection* should be returned.)
Optionally filter cards by LABEL or COLLECTION slug. (COLLECTION can be a blank string, to signify cards with *no
collection* should be returned.)

NOTES:
NOTES:

* Filtering by LABEL is considered *deprecated*, as `Labels` will be removed from an upcoming version of Metabase in favor of `Collections`.
* LABEL and COLLECTION params are mutually exclusive; if both are specified, LABEL will be ignored and Cards will only be filtered by their `Collection`.
* If no `Collection` exists with the slug COLLECTION, this endpoint will return a 404.
* Filtering by LABEL is considered *deprecated*, as `Labels` will be removed from an upcoming version of Metabase
in favor of `Collections`.
* LABEL and COLLECTION params are mutually exclusive; if both are specified, LABEL will be ignored and Cards will
only be filtered by their `Collection`.
* If no `Collection` exists with the slug COLLECTION, this endpoint will return a 404.

##### PARAMS:

Expand All @@ -161,7 +164,8 @@ Get `Card` with ID.

## `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.
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.

Expand Down Expand Up @@ -219,9 +223,9 @@ Update the set of `Labels` that apply to a `Card`.

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

Generate publically-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.
Generate publically-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.

Expand All @@ -245,7 +249,8 @@ Run the query associated with a Card.

## `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
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:

Expand All @@ -258,8 +263,8 @@ Run the query associated with a Card, and return its results as a file in the sp

## `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.
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:

Expand Down
Loading

0 comments on commit 894cbe4

Please sign in to comment.