Dokumentation
ReferenzDirectories

List directories.

GET
/directories

List all directories the calling user can see, in breadth-first order: first all top-level directories, then all of their children, and so on. Within one level, personal directories come first, the rest is sorted by name.

Example directory structure:

  • A1
    • B1
    • B2
      • C1
      • C2
    • B3
  • A2
    • B1

The result without any filter lists: A1, A2, A1/B1, A1/B2, A1/B3, A2/B1, A1/B2/C1, A1/B2/C2.

The list can be narrowed with the query parameters. With targetDirectory set to A1/B2 and the default mode ancestors, the result lists the branch down to the target: A1, A1/B2. With mode ancestorsAndSiblings, the siblings on each level are included as well: A1, A2, A1/B1, A1/B2, A1/B3, A1/B2/C1, A1/B2/C2. With depth, the result lists the subtree below the target directory instead, down to the given number of levels.

A typical integration uses this operation to find the ID of its upload target directory, or to mirror a folder structure before uploading into it.

Project directories are never listed, not even for members of the project or for tenant managers: a project directory is reached through its project, as the directoryId of GET /projects. It is not accepted as targetDirectory either.

Authorization

apiKey
headerX-API-Key<token>

API key issued in the Galilea settings.

Query Parameters

targetDirectory?string

ID of a directory. Only directories of this directory's branch are included; which ones exactly is controlled by targetDirectoryMode. When depth is given, the subtree below this directory is listed instead.

Formatuuid
targetDirectoryMode?string

How to narrow the result around targetDirectory: ancestors lists only the path from the tree root down to the target directory; ancestorsAndSiblings additionally lists the siblings of every directory on that path. Requires targetDirectory.

Default"ancestors"
Value in"ancestors""ancestorsAndSiblings"
depth?integer

Lists the subtree below targetDirectory instead: the target directory and all descendants down to this many levels. Requires targetDirectory.

Range0 <= value

Response Body

The directory list.

application/json
  1. response
[index: integer]?

A directory as returned by the directory listing.

curl -X GET "https://example.com/directories"
[  {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "parent": "42e2bc1b-6741-4e2e-b138-97b4a342c999",    "name": "string",    "children": [      "4feb20ac-04ac-4bd8-9baa-d4924dafff88"    ],    "createdAt": "2019-08-24T14:15:22Z",    "lastModifiedAt": "2019-08-24T14:15:22Z",    "userPermissions": [      "view"    ],    "userGroups": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "type": "tenant_all",        "name": "string",        "acronym": "st",        "color": "string",        "emailAddress": "string",        "numberOfMembers": 0,        "tenant": {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "name": "string"        },        "user": {},        "createdAt": "2019-08-24T14:15:22Z",        "lastModifiedAt": "2019-08-24T14:15:22Z"      }    ],    "displayStyle": "default"  }]