GetFolderStatistics API¶
Returns usage statistics for the specified folder, including subfolder count, total document count, checked-out document count, and total storage size of all documents in the folder tree.
Endpoint¶
Methods¶
- GET
/srv.asmx/GetFolderStatistics?authenticationTicket=...&folderPath=... - POST
/srv.asmx/GetFolderStatistics(form data) - SOAP Action:
http://tempuri.org/GetFolderStatistics
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Authentication ticket obtained from AuthenticateUser. |
folderPath |
string | Yes | Full infoRouter path to the folder (e.g. /Finance/Reports). |
Response¶
Success Response¶
<response success="true">
<statistics SubFolderCount="5" TotalDocumentCount="123" CheckedOutCount="3"
TotalSize="10485760"
RegisteredDocumentsIn30Days="12" RegisteredDocumentsIn60Days="34"
RegisteredDocumentsIn90Days="67"
FolderID="456" Name="Reports" />
</response>
Error Response¶
Statistics Attributes¶
| Attribute | Description |
|---|---|
SubFolderCount |
Number of subfolders at every depth below the folder. |
TotalDocumentCount |
Total number of documents in the folder and all subfolders. |
CheckedOutCount |
Number of currently checked-out documents in the folder tree. |
TotalSize |
Total storage size in bytes of all documents in the folder tree. |
RegisteredDocumentsIn30Days |
Number of documents registered in the last 30 days. |
RegisteredDocumentsIn60Days |
Number of documents registered in the last 60 days. |
RegisteredDocumentsIn90Days |
Number of documents registered in the last 90 days. |
FolderID |
Internal ID of the folder. |
Name |
Name of the folder. |
Required Permissions¶
The calling user must have read permission on the folder.
Example¶
GET Request¶
GET /srv.asmx/GetFolderStatistics
?authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&folderPath=/Finance/Reports
HTTP/1.1
POST Request¶
POST /srv.asmx/GetFolderStatistics HTTP/1.1
Content-Type: application/x-www-form-urlencoded
authenticationTicket=3f2504e0-4f89-11d3-9a0c-0305e82c3301
&folderPath=/Finance/Reports
SOAP Request¶
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://tempuri.org/">
<soap:Body>
<tns:GetFolderStatistics>
<tns:authenticationTicket>3f2504e0-4f89-11d3-9a0c-0305e82c3301</tns:authenticationTicket>
<tns:folderPath>/Finance/Reports</tns:folderPath>
</tns:GetFolderStatistics>
</soap:Body>
</soap:Envelope>
JavaScript¶
Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and
errorCode is the number to report.
async function call(action, params) {
const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
const root = new DOMParser()
.parseFromString(await response.text(), 'text/xml')
.documentElement;
if (root.getAttribute('success') !== 'true') {
throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
}
return root;
}
Counts what is in a folder and everything below it.
const root = await call('GetFolderStatistics', {
authenticationTicket: ticket,
folderPath: '/Finance/Reports'
});
const statistics = root.querySelector('statistics');
console.log(
statistics.getAttribute('TotalDocumentCount'), 'documents,',
statistics.getAttribute('TotalSize'), 'bytes,',
statistics.getAttribute('CheckedOutCount'), 'checked out'
);
Every count covers the whole tree below the folder, not just its direct children.
Notes¶
- Statistics are computed recursively across the entire folder tree, not just direct children.
TotalSizeis reported in bytes.- This API is useful for storage reporting and compliance dashboards.
- Use
GetSubFoldersCountfor a count of direct subfolders only. - Call this before GetFolderCatalog:
SubFolderCount+TotalDocumentCounttells how big the catalog will be.
Related APIs¶
- GetSubFoldersCount - Get only the direct subfolder count
- GetFolder - Get full folder metadata
- GetFolders - List subfolders
Error Codes¶
The errorCode values this operation returns, checked against a running server:
errorCode |
When |
|---|---|
4010 |
the ticket is expired or unknown |
4041 |
no folder at that path - including one the caller may not see |
HTTP 400 |
a required string parameter was empty; refused by model binding, so there is no error document |
A call with no ticket is not automatically refused: it signs in as the anonymous user, so a folder in
a library flagged as anonymous can be read without authenticating. The writes in this group -
CreateFolder, CreateFolder1, CreateHtmlDocument - refuse it with 4010.
| Error | Description |
|---|---|
[900] Authentication failed |
Invalid or missing authentication ticket. |
[901] Session expired or Invalid ticket |
The ticket has expired or does not exist. |
| Folder not found | The specified path does not resolve to an existing folder. |
| Access denied | The user does not have read permission on the folder. |
SystemError:... |
An unexpected server-side error occurred. |