Misc · Drive
Get folder
Gets a folder by organization ID and folder ID, including its totals and preview files. Returns its direct and inherited shares only when the caller has unrestricted drive.read access.
Permissions
Send an API key of the organization in the path, using the X-API-Key header.
Who may call it
- Requires organization authentication.
- Callers with
drive.readaccess that is not assigned-only can view the folder. Other callers can view it only if it is shared with them. - Actor details are protected using
user.read. Non-contact actors other than the current actor are masked without it. - API actor details are masked without
apiKey.read. A non-current API actor is also masked withoutuser.read. - Legacy
contact.readalso allows contact actor details to be shown.
Request
Path parameters
-
organizationIdidrequired -
folderIdidrequired
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
--request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/drive/folders/YOUR_FOLDER_ID' \
--header 'X-API-Key: YOUR_API_KEY'const response = await fetch("https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/drive/folders/YOUR_FOLDER_ID", {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
},
redirect: 'error',
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(`campai HTTP ${response.status}`);
const text = await response.text();
const result = text ? JSON.parse(text) : null;
console.log(JSON.stringify(result, null, 2));<?php
$context = stream_context_create(['http' => [
'method' => 'GET',
'header' => [
'X-API-Key: YOUR_API_KEY',
],
'timeout' => 30,
'follow_location' => 0,
'ignore_errors' => true,
]]);
$text = @file_get_contents('https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/drive/folders/YOUR_FOLDER_ID', false, $context);
preg_match('/^HTTP\/\S+ (\d{3})/', $http_response_header[0] ?? '', $match);
$status = (int) ($match[1] ?? 0);
if ($text === false || $status < 200 || $status >= 300) {
throw new RuntimeException("campai HTTP $status (0 means no response)");
}
$result = $text === '' ? null : json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($result, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
Response
200 Successful response
Content-Type: application/json
-
folderobject14 properties
-
_idid -
parentidnullable -
namestring1–128 characters
-
colorstring22 values
slategrayzincneutralstoneredorangeamberyellowlimegreenemeraldtealcyanskyblueindigovioletpurplefuchsiapinkrose -
coverFileidnullable -
contentUpdatedAtstring · date-time -
createdAtstring · date-timenullable -
createdByobjectnullable -
fileCountintegerat least 0
-
folderCountintegerat least 0
-
sizeBytesnumberat least 0
-
shareCountintegerat least 0
-
peekFilesobject[]14 properties
-
_idid -
folderidnullable -
namestring1–128 characters
-
kindstringimagevideoaudiopdfwordexcelpowerpointtextarchiveother -
fileobject4 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
-
thumbnailobjectnullable4 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
-
widthintegernullable -
heightintegernullable -
durationSecondsnumbernullableat least 0
-
waveformnumber[]nullableat most 96 items · each 0–1
-
createdAtstring · date-timenullable -
createdByobjectnullable -
updatedAtstring · date-timenullable -
updatedByobjectnullable
-
-
coverobjectnullable14 properties
-
_idid -
folderidnullable -
namestring1–128 characters
-
kindstringimagevideoaudiopdfwordexcelpowerpointtextarchiveother -
fileobject4 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
-
thumbnailobjectnullable4 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
-
widthintegernullable -
heightintegernullable -
durationSecondsnumbernullableat least 0
-
waveformnumber[]nullableat most 96 items · each 0–1
-
createdAtstring · date-timenullable -
createdByobjectnullable -
updatedAtstring · date-timenullable -
updatedByobjectnullable
-
-
-
sharesobject[]sharesis empty withoutdrive.readaccess that is not assigned-only.5 properties
-
typestringusercontactsegmentcontactTypeteam -
idstring1–64 characters
-
namestring1–200 characters
-
accessstringviewaddsubmit -
hasConnectAccessboolean
-
-
inheritedSharesobject[]inheritedSharesis empty withoutdrive.readaccess that is not assigned-only.6 properties
-
typestringusercontactsegmentcontactTypeteam -
idstring1–64 characters
-
namestring1–200 characters
-
accessstringviewaddsubmit -
hasConnectAccessboolean -
viaobject2 properties
-
_idid -
namestring1–128 characters
-
-
{
"folder": {
"_id": "000000000000000000000001",
"parent": "000000000000000000000001",
"name": "string",
"color": "slate",
"coverFile": "000000000000000000000001",
"contentUpdatedAt": "2026-06-15T22:30:00Z",
"fileCount": 0,
"folderCount": 0,
"sizeBytes": 0,
"shareCount": 0,
"peekFiles": [
{
"_id": "000000000000000000000001",
"folder": "000000000000000000000001",
"name": "string",
"kind": "image",
"file": {
"resource": "string"
},
"thumbnail": {
"resource": "string"
},
"width": 1,
"height": 1,
"durationSeconds": 0,
"waveform": [
0
]
}
],
"cover": {
"_id": "000000000000000000000001",
"folder": "000000000000000000000001",
"name": "string",
"kind": "image",
"file": {
"resource": "string"
},
"thumbnail": {
"resource": "string"
},
"width": 1,
"height": 1,
"durationSeconds": 0,
"waveform": [
0
]
}
},
"shares": [
{
"type": "user",
"id": "string",
"name": "string",
"access": "view",
"hasConnectAccess": true
}
],
"inheritedShares": [
{
"type": "user",
"id": "string",
"name": "string",
"access": "view",
"hasConnectAccess": true,
"via": {
"_id": "000000000000000000000001",
"name": "string"
}
}
]
}
Errors
Other errors
| Status | Error | When |
|---|---|---|
| 404 | The folder was not found | Returns 404 NOT_FOUND with routes.misc.drive.noFolder if the folder does not exist in the organization. |
| 404 | The folder was not found | Returns 404 NOT_FOUND with routes.misc.drive.noFolder if the caller lacks unrestricted drive.read access and the folder is not shared with them. |
Errors nearly every request can meet are listed under Errors.