Count the number of objects of a specific type within a folder. Useful for pagination planning, dashboard statistics, and capacity monitoring.
Task<long> GetObjectCountsAsync(
FolderInfo folder,
string typeName,
bool includeChildFolders = false
)
| Parameter | Type | Description |
|---|---|---|
folder |
FolderInfo |
The folder to count objects in |
typeName |
string |
Object type name (without “Info” suffix) |
includeChildFolders |
bool |
Include child folder objects |
Important: Use the type name without the “Info” suffix. The exception is
BaseInfo, which usesKeepObject.
| C# Class | Type Name |
|---|---|
PersonInfo |
Person |
ControllerInfo |
Controller |
ReaderInfo |
Reader |
AccessLevelInfo |
AccessLevel |
ScheduleInfo |
Schedule |
EventMessageInfo |
EventMessage |
BaseInfo |
KeepObject |
// Count people in an instance
var personCount = await client.GetObjectCountsAsync(instance, "Person");
Console.WriteLine($"Total cardholders: {personCount}");
// Count controllers including child folders
var controllerCount = await client.GetObjectCountsAsync(
rootInstance,
"Controller",
includeChildFolders: true
);
// Count for pagination
var totalPeople = await client.GetObjectCountsAsync(instance, "Person");
var pageSize = 100;
var totalPages = (int)Math.Ceiling((double)totalPeople / pageSize);
for (int page = 0; page < totalPages; page++)
{
var people = await client.GetPeopleAsync(instance, page * pageSize, pageSize);
// Process page...
}
curl -X GET \
"https://api.acresecurity.cloud/api/f/{instance-key}/count?typeName=Person&includeChildFolders=false" \
-H "Authorization: Bearer TOKEN_GOES_HERE"
| Use Case | Example |
|---|---|
| Dashboard statistics | Count controllers, readers, cardholders |
| Pagination planning | Calculate total pages before fetching |
| License monitoring | Count active cardholders vs license limit |
| Health checks | Verify expected object counts |
Example in C#
// Returns: Int64
var item = client.CallCount;
Overview of get_CallCount goes here.
Example in C#
// Returns: Int32
var item = await client.GetNextCounterAsync(FolderInfo folder);
Overview of GetNextCounterAsync goes here.
Example in C#
// Returns: Int64
var item = await client.GetObjectCountsAsync(FolderInfo folder, String typeName, Boolean includeChildFolders);
Count objects of a specific type within a folder. Returns a long value representing the total count.
Task<long> GetObjectCountsAsync(
FolderInfo folder,
string typeName,
bool includeChildFolders = false
)
| Parameter | Type | Description |
|---|---|---|
folder |
FolderInfo |
The folder to count objects in |
typeName |
string |
Object type name (without “Info” suffix) |
includeChildFolders |
bool |
Include objects in child folders |
| C# Class | Type Name |
|---|---|
PersonInfo |
Person |
ControllerInfo |
Controller |
ReaderInfo |
Reader |
AccessLevelInfo |
AccessLevel |
ScheduleInfo |
Schedule |
BaseInfo |
KeepObject |
// Count people in instance
var personCount = await client.GetObjectCountsAsync(instance, "Person");
Console.WriteLine($"Total cardholders: {personCount}");
// Count controllers across all child folders
var controllerCount = await client.GetObjectCountsAsync(
rootInstance,
"Controller",
includeChildFolders: true
);
// Pagination calculation
var total = await client.GetObjectCountsAsync(instance, "Person");
var pageSize = 100;
var pages = (int)Math.Ceiling((double)total / pageSize);
for (int page = 0; page < pages; page++)
{
var people = await client.GetPeopleAsync(instance, page * pageSize, pageSize);
// Process page...
}
curl -X GET \
"https://api.acresecurity.cloud/api/f/{instance-key}/count?typeName=Person&includeChildFolders=false" \
-H "Authorization: Bearer TOKEN_GOES_HERE"
| Use Case | Description |
|---|---|
| Dashboard stats | Display object counts on dashboards |
| Pagination | Calculate total pages before fetching |
| License check | Count cardholders against license limits |
| Health monitoring | Track object counts over time |
Example in C#
// Returns: Int32
var item = await client.GetUnreadNotificationCountForUserAsync(FolderInfo folder, UserInfo user, DateTime beforeStartDate, DateTime beforeEndDate, DateTime afterStartDate, DateTime afterEndDate);
Overview of GetUnreadNotificationCountForUserAsync goes here.
Example in C#
// Returns: nothing
await client.IncrementExecutionCount(FitScriptExecSpecInfo item);
Overview of IncrementExecutionCount goes here.
Example in C#
// Returns: nothing
await client.IncrementInstallCount(MarketplacePackageInfo item);
Overview of IncrementInstallCount goes here.