disguise developers

Folders

The /folders endpoint of the Disguise Cloud Drive API returns information about all folders within a drive, regardless of their position in the directory. A folder represents a directory within a drive that can contain files and other folders.

This endpoint is useful for generating the full directory structure of a drive, as it includes all folders and their parent folders.

Endpoints

GET
drive-api.disguise.cloud
/v1/drives/{{drive_id}}/folders
Retrieve a list of all folders for the specified drive.

Response Structure

The responses from the /folders endpoint include the following fields:

FieldTypeDescription
idstringThe unique identifier of the folder.
parent_idstringThe unique identifier of the parent folder.
namestringThe name of the folder.

Response Example

curl -X GET https://drive-api.disguise.cloud/v1/drives/{{drive_id}}/folders \
-H "Authorization: Token YOUR_API_TOKEN"

Success

A successful response will return a 200 OK status code and the following JSON:

Please note this example excludes the pagination wrapper around the response. Please refer to the pagination documentation for more information.

[
  {
    "id": "f4df841d-eab3-4636-8448-81cde7543d1e",
    "parent_id": "1cb5e233-908b-4799-80d7-943b86d3916c",
    "name": "My Files"
  },
  {
    "id": "c71df693-d1ff-461d-9da6-b9f1ee9c6748",
    "parent_id": "f4df841d-eab3-4636-8448-81cde7543d1e",
    "name": "My Sub Folder"
  }
]

Errors

When searching for folders, and no results are found, the response will return a 404 Not Found status code and the following JSON:

{
  "error": {
    "message": "No folders found",
    "details": "No folders found"
  }
}

Query Parameters

The following query parameters can be used with the /folders endpoint for GET requests:

ParameterTypeDescription
namestringFilter by folder name. Will preform a case and whitespace insensitive substring search.

Query Example

Below is an example of making a GET request to the /folders endpoint to search for all folders with the name “My Folder”:

curl -X GET https://api.disguise.cloud/v1/drives/{{drive_id}}/folders?name=my%20folder \
-H "Authorization: Token YOUR_API_TOKEN"