Skip to content
campaiDeveloper
campai.com

Misc · Drive

GET/{organizationId}/misc/drive/treeReads only

List folder tree

Lists the folder tree for an organization identified by organizationId. Returns folders with each folder's _id, parent, ancestors, name, and color, sorted by name. With assigned-only drive access, the list is limited to shared folders and their descendants.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • Requires organization access and the drive.read permission.

Request

Path parameters

  • organizationIdidrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/drive/tree' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • foldersobject[]
    5 properties
    • _idid
    • parentidnullable
    • ancestorsid[]
    • namestring

      1–128 characters

    • colorstring
      22 values
      slate gray zinc neutral stone red orange amber yellow lime green emerald teal cyan sky blue indigo violet purple fuchsia pink rose
Response200
{
  "folders": [
    {
      "_id": "000000000000000000000001",
      "parent": "000000000000000000000001",
      "ancestors": [
        "000000000000000000000001"
      ],
      "name": "string",
      "color": "slate"
    }
  ]
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.