/api/collection

GET /api/collection/tree

Changed on

Similar to GET /, but returns Collections in a tree structure, e.g.

[{:name     "A"
:below    #{:card :dataset}
:children [{:name "B"}
           {:name     "C"
            :here     #{:dataset :card}
            :below    #{:dataset :card}
            :children [{:name     "D"
                        :here     #{:dataset}
                        :children [{:name "E"}]}
                       {:name     "F"
                        :here     #{:card}
                        :children [{:name "G"}]}]}]}
{:name "H"}]

The here and below keys indicate the types of items at this particular level of the tree (here) and in its subtree (below).

TODO: for historical reasons this returns Saved Questions AS 'card' AND Models as 'dataset'; we should fix this at some point in the future.

By default, looks at the analytics (if enabled) and regular (nil) namespaces. You can optionally pass a namespace argument, or one or many namespaces, to specify the particular collection namespaces you wish to look at. For example, namespaces=analytics&namespaces= would match the default behavior.

When shallow is true, takes an optional collection-id and returns only the requested collection (or the root, if collection-id is nil).

get/api/collection/tree

Request

  • Base URL
    (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    API key in header X-API-Key

Query parameters

exclude-archivedboolean nullable
exclude-other-user-collectionsboolean nullable
include-libraryboolean nullable
namespacestring nullable

value must be a non-blank string.

namespacesstring[] nullable
shallowboolean nullable
collection-idinteger nullable

value must be an integer greater than zero.

Request body

object required

Response

Successful response

Changes

    • info

      added optional request body

    • info

      the query request parameter exclude-archived became optional

    • info

      the query request parameter exclude-other-user-collections became optional

    • info

      the query request parameter include-library became optional

    • info

      the query request parameter shallow became optional

    • info

      added the media type application/json for the response with the status

    • info

      api operation id get-api-collection-tree was added