Skip to content

Commit

Permalink
update API docs (metabase#24348)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-bruemmer authored Jul 27, 2022
1 parent b9d40a9 commit a897ec3
Show file tree
Hide file tree
Showing 46 changed files with 193 additions and 134 deletions.
3 changes: 2 additions & 1 deletion docs/api/activity.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Activity"
summary: "API endpoints for Activity."
summary: |
API endpoints for Activity.
---

# Activity
Expand Down
3 changes: 2 additions & 1 deletion docs/api/alert.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Alert"
summary: "/api/alert endpoints."
summary: |
/api/alert endpoints.
---

# Alert
Expand Down
3 changes: 2 additions & 1 deletion docs/api/automagic-dashboards.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Automagic dashboards"
summary: "API endpoints for Automagic dashboards."
summary: |
API endpoints for Automagic dashboards.
---

# Automagic dashboards
Expand Down
13 changes: 7 additions & 6 deletions docs/api/bookmark.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
title: "Bookmark"
summary: "Handle creating bookmarks for the user. Bookmarks are in three tables and should be thought of as a tuple of (model,
model-id) rather than a row in a table with an id. The DELETE takes the model and id because DELETE's do not
necessarily support request bodies. The POST is therefore shaped in this same manner. Since there are three
underlying tables the id on the actual bookmark itself is not unique among 'bookmarks' and is not a good
identifier for using in the API."
summary: |
Handle creating bookmarks for the user. Bookmarks are in three tables and should be thought of as a tuple of (model,
model-id) rather than a row in a table with an id. The DELETE takes the model and id because DELETE's do not
necessarily support request bodies. The POST is therefore shaped in this same manner. Since there are three
underlying tables the id on the actual bookmark itself is not unique among 'bookmarks' and is not a good
identifier for using in the API.
---

# Bookmark

Handle creating bookmarks for the user. Bookmarks are in three tables and should be thought of as a tuple of (model,
model-id) rather than a row in a table with an id. The DELETE takes the model and id because DELETE's do not
necessarily support request bodies. The POST is therefore shaped in this same manner. Since there are three
underlying tables the id on the actual bookmark itself is not unique among 'bookmarks' and is not a good
underlying tables the id on the actual bookmark itself is not unique among "bookmarks" and is not a good
identifier for using in the API.

- [DELETE /api/bookmark/:model/:id](#delete-apibookmarkmodelid)
Expand Down
15 changes: 10 additions & 5 deletions docs/api/card.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Card"
summary: "/api/card endpoints."
summary: |
/api/card endpoints.
---

# Card
Expand Down Expand Up @@ -62,7 +63,9 @@ Get `Card` with ID.

### PARAMS:

* **`id`**
* **`id`**

* **`ignore_view`**

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

Expand Down Expand Up @@ -103,7 +106,7 @@ Create a new `Card`.

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

* **`parameters`** value may be nil, or if non-nil, value must be an array. Each parameter must be a map with String :id key
* **`parameters`** value may be nil, or if non-nil, value must be an array. Each parameter must be a map with :id and :type keys

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

Expand All @@ -119,7 +122,7 @@ Create a new `Card`.

* **`dataset_query`**

* **`parameter_mappings`** value may be nil, or if non-nil, value must be an array. Each parameter mapping must be a String :parameter_id key
* **`parameter_mappings`** value may be nil, or if non-nil, value must be an array. Each parameter_mapping must be a map with :parameter_id and :target keys

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

Expand Down Expand Up @@ -235,9 +238,11 @@ Update a `Card`.

### PARAMS:

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

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

* **`parameters`** value may be nil, or if non-nil, value must be an array. Each parameter must be a map with String :id key
* **`parameters`** value may be nil, or if non-nil, value must be an array. Each parameter must be a map with :id and :type keys

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

Expand Down
27 changes: 13 additions & 14 deletions docs/api/collection.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: "Collection"
summary: "`/api/collection` endpoints. By default, these endpoints operate on Collections in the 'default' namespace, which is
the one that has things like Dashboards and Cards. Other namespaces of Collections exist as well, such as the
`:snippet` namespace, (called 'Snippet folders' in the UI). These namespaces are completely independent hierarchies.
To use these endpoints for other Collections namespaces, you can pass the `?namespace=` parameter (e.g.
`?namespace=snippet`)."
summary: |
`/api/collection` endpoints. By default, these endpoints operate on Collections in the 'default' namespace, which is
the one that has things like Dashboards and Cards. Other namespaces of Collections exist as well, such as the
`:snippet` namespace, (called 'Snippet folders' in the UI). These namespaces are completely independent hierarchies.
To use these endpoints for other Collections namespaces, you can pass the `?namespace=` parameter (e.g.
`?namespace=snippet`).
---

# Collection
Expand Down Expand Up @@ -197,23 +198,21 @@ Modify an existing Collection, including archiving or unarchiving it, or moving

### PARAMS:

* **`authority_level`** value may be nil, or if non-nil, value must be one of: `official`.

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

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

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

* **`color`** value may be nil, or if non-nil, value must be a string that matches the regex `^#[0-9A-Fa-f]{6}$`.

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

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

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

* **`id`**
* **`authority_level`** value may be nil, or if non-nil, value must be one of: `official`.

* **`update_collection_tree_authority_level`** value may be nil, or if non-nil, value must be a boolean.
* **`collection-updates`**

## `PUT /api/collection/graph`

Expand Down
9 changes: 5 additions & 4 deletions docs/api/dashboard.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Dashboard"
summary: "/api/dashboard endpoints."
summary: |
/api/dashboard endpoints.
---

# Dashboard
Expand Down Expand Up @@ -180,7 +181,7 @@ Create a new Dashboard.

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

* **`parameters`** value may be nil, or if non-nil, value must be an array. Each parameter must be a map with String :id key
* **`parameters`** value may be nil, or if non-nil, value must be an array. Each parameter must be a map with :id and :type keys

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

Expand Down Expand Up @@ -266,7 +267,7 @@ Add a `Card` to a Dashboard.

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

* **`parameter_mappings`** value must be an array. Each value must be a map.
* **`parameter_mappings`** value may be nil, or if non-nil, value must be an array.

* **`dashboard-card`**

Expand Down Expand Up @@ -322,7 +323,7 @@ Update a Dashboard.

### PARAMS:

* **`parameters`** value may be nil, or if non-nil, value must be an array. Each parameter must be a map with String :id key
* **`parameters`** value may be nil, or if non-nil, value must be an array. Each parameter must be a map with :id and :type keys

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

Expand Down
13 changes: 12 additions & 1 deletion docs/api/database.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Database"
summary: "/api/database endpoints."
summary: |
/api/database endpoints.
---

# Database
Expand All @@ -25,6 +26,7 @@ summary: "/api/database endpoints."
- [GET /api/database/db-ids-with-deprecated-drivers](#get-apidatabasedb-ids-with-deprecated-drivers)
- [POST /api/database/](#post-apidatabase)
- [POST /api/database/:id/discard_values](#post-apidatabaseiddiscard_values)
- [POST /api/database/:id/dismiss_spinner](#post-apidatabaseiddismiss_spinner)
- [POST /api/database/:id/persist](#post-apidatabaseidpersist)
- [POST /api/database/:id/rescan_values](#post-apidatabaseidrescan_values)
- [POST /api/database/:id/sync](#post-apidatabaseidsync)
Expand Down Expand Up @@ -248,6 +250,15 @@ Discards all saved field values for this `Database`.

* **`id`**

## `POST /api/database/:id/dismiss_spinner`

Manually set the initial sync status of the `Database` and corresponding
tables to be `complete` (see #20863).

### PARAMS:

* **`id`**

## `POST /api/database/:id/persist`

Attempt to enable model persistence for a database. If already enabled returns a generic 204.
Expand Down
3 changes: 2 additions & 1 deletion docs/api/dataset.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Dataset"
summary: "/api/dataset endpoints."
summary: |
/api/dataset endpoints.
---

# Dataset
Expand Down
7 changes: 4 additions & 3 deletions docs/api/ee/advanced-permissions-application.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
title: "Advanced permissions application"
summary: "`/advanced-permisisons/application` Routes.
Implements the Permissions routes needed for application permission - a class of permissions that control access to features
like access Setting pages, access monitoring tools ... etc."
summary: |
`/advanced-permisisons/application` Routes.
Implements the Permissions routes needed for application permission - a class of permissions that control access to features
like access Setting pages, access monitoring tools ... etc.
---

# Advanced permissions application
Expand Down
3 changes: 2 additions & 1 deletion docs/api/ee/audit-app-user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Audit app user"
summary: "`/api/ee/audit-app/user` endpoints. These only work if you have a premium token with the `:audit-app` feature."
summary: |
`/api/ee/audit-app/user` endpoints. These only work if you have a premium token with the `:audit-app` feature.
---

# Audit app user
Expand Down
7 changes: 4 additions & 3 deletions docs/api/ee/content-management-review.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
title: "Content management review"
summary: "API endpoints for Content management review."
summary: |
API endpoints for Content management review.
---

# Content management review

API endpoints for Content management review.

- [POST /api/ee/content-management/review/](#post-apieecontent-managementreview)
- [POST /api/moderation-review/review/](#post-apimoderation-reviewreview)

## `POST /api/ee/content-management/review/`
## `POST /api/moderation-review/review/`

Create a new `ModerationReview`.

Expand Down
23 changes: 12 additions & 11 deletions docs/api/ee/sandbox-gtap.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
---
title: "Sandbox GTAP"
summary: "`/api/mt/gtap` endpoints, for CRUD operations and the like on GTAPs (Group Table Access Policies)."
summary: |
`/api/mt/gtap` endpoints, for CRUD operations and the like on GTAPs (Group Table Access Policies).
---

# Sandbox GTAP

`/api/mt/gtap` endpoints, for CRUD operations and the like on GTAPs (Group Table Access Policies).

- [DELETE /api/ee/sandbox/gtap/:id](#delete-apieesandboxgtapid)
- [GET /api/ee/sandbox/gtap/](#get-apieesandboxgtap)
- [GET /api/ee/sandbox/gtap/:id](#get-apieesandboxgtapid)
- [POST /api/ee/sandbox/gtap/](#post-apieesandboxgtap)
- [PUT /api/ee/sandbox/gtap/:id](#put-apieesandboxgtapid)
- [DELETE /api/mt/gtap/:id](#delete-apimtgtapid)
- [GET /api/mt/gtap/](#get-apimtgtap)
- [GET /api/mt/gtap/:id](#get-apimtgtapid)
- [POST /api/mt/gtap/](#post-apimtgtap)
- [PUT /api/mt/gtap/:id](#put-apimtgtapid)

## `DELETE /api/ee/sandbox/gtap/:id`
## `DELETE /api/mt/gtap/:id`

Delete a GTAP entry.

### PARAMS:

* **`id`**

## `GET /api/ee/sandbox/gtap/`
## `GET /api/mt/gtap/`

Fetch a list of all the GTAPs currently in use.

## `GET /api/ee/sandbox/gtap/:id`
## `GET /api/mt/gtap/:id`

Fetch GTAP by `id`.

### PARAMS:

* **`id`**

## `POST /api/ee/sandbox/gtap/`
## `POST /api/mt/gtap/`

Create a new GTAP.

Expand All @@ -47,7 +48,7 @@ Create a new GTAP.

* **`attribute_remappings`**

## `PUT /api/ee/sandbox/gtap/:id`
## `PUT /api/mt/gtap/:id`

Update a GTAP entry. The only things you're allowed to update for a GTAP are the Card being used (`card_id`) or the
paramter mappings; changing `table_id` or `group_id` would effectively be deleting this entry and creating a new
Expand Down
7 changes: 4 additions & 3 deletions docs/api/ee/sandbox-table.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
title: "Sandbox table"
summary: "API endpoints for Sandbox table."
summary: |
API endpoints for Sandbox table.
---

# Sandbox table

API endpoints for Sandbox table.

- [GET /api/ee/sandbox/table/:id/query_metadata](#get-apieesandboxtableidquery_metadata)
- [GET /api/table/:id/query_metadata](#get-apitableidquery_metadata)

## `GET /api/ee/sandbox/table/:id/query_metadata`
## `GET /api/table/:id/query_metadata`

This endpoint essentially acts as a wrapper for the OSS version of this route. When a user has segmented permissions
that only gives them access to a subset of columns for a given table, those inaccessable columns should also be
Expand Down
11 changes: 6 additions & 5 deletions docs/api/ee/sandbox-user.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
title: "Sandbox user"
summary: "Endpoint(s)for setting user attributes."
summary: |
Endpoint(s)for setting user attributes.
---

# Sandbox user

Endpoint(s)for setting user attributes.

- [GET /api/ee/sandbox/user/attributes](#get-apieesandboxuserattributes)
- [PUT /api/ee/sandbox/user/:id/attributes](#put-apieesandboxuseridattributes)
- [GET /api/mt/user/attributes](#get-apimtuserattributes)
- [PUT /api/mt/user/:id/attributes](#put-apimtuseridattributes)

## `GET /api/ee/sandbox/user/attributes`
## `GET /api/mt/user/attributes`

Fetch a list of possible keys for User `login_attributes`. This just looks at keys that have already been set for
existing Users and returns those. .

## `PUT /api/ee/sandbox/user/:id/attributes`
## `PUT /api/mt/user/:id/attributes`

Update the `login_attributes` for a User.

Expand Down
Loading

0 comments on commit a897ec3

Please sign in to comment.