Count components per folder
const url = 'https://api.ebitex.io/content/management/v1/folders/counts';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.ebitex.io/content/management/v1/folders/counts \ --header 'Authorization: Bearer <token>'Counts the components each folder holds directly, in one request, so a folder tree can show badges without listing every folder’s contents.
byFolder has an entry for every folder the key’s role can view, zero for an empty one. unfiled counts components filed at the top level and total is unfiled plus every visible folder’s own count. Components in a branch the key’s role cannot view are in none of the three, so the numbers never reveal hidden content. A folder’s count does not include its subfolders; add them up from parentFolderId if you want a branch total.
Key: a management key with content.management.read.
Authorizations
Section titled “Authorizations”Responses
Section titled “ Responses ”{ "total": 29, "unfiled": 2, "byFolder": { "<folder id>": 14 } }
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.
payment_required: the organization’s subscription needs attention.
scope_denied: the key lacks this route’s scope. tier_required: the Content Management API needs the Pro plan or above. ip_denied: the caller’s address is outside the key’s allowed ranges. app_not_available: Content is not enabled for the organization.
Rate limit or quota exceeded; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.