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.
The responses from the /folders
endpoint include the following fields:
Field | Type | Description |
---|---|---|
id | string | The unique identifier of the folder. |
parent_id | string | The unique identifier of the parent folder. |
name | string | The name of the folder. |
curl -X GET https://drive-api.disguise.cloud/v1/drives/{{drive_id}}/folders \
-H "Authorization: Token YOUR_API_TOKEN"
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"
}
]
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"
}
}
The following query parameters can be used with the /folders
endpoint for GET requests:
Parameter | Type | Description |
---|---|---|
name | string | Filter by folder name. Will preform a case and whitespace insensitive substring search. |
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"