Service: zimbraAdmin

Command: CountObjects
Namespace: urn:zimbraAdmin
Description: Count number of objects.
Returns number of objects of requested type.

Note: For account/alias/dl, if a domain is specified, only entries on the specified domain are counted. If no domain is specified, entries on all domains are counted.

For domain, if onlyRelated attribute is true and the request is sent by a delegate or domain admin, counts only domain on which has rights, without requiring countDomain right.

Properties:
Authorization token required true
Admin Authorization token required true

CountObjectsRequest

    <CountObjectsRequest
                            type="(userAccount | account | alias | dl | domain | cos | server | calresource | internalUserAccount | internalArchivingAccount | internalUserAccountX)"
                            [onlyRelated="(0|1)"]> ## CountObjectsRequest
        (<domain [by="{domain-selector-by} (id | name | virtualHostname | krb5Realm | foreignName)"]>{key}</domain> ## DomainSelector)*
    </CountObjectsRequest>

elements and attributes you can define within a <CountObjectsRequest> element:

XPath Required / Optional Description
@type Required (only 1) Type: userAccount | account | alias | dl | domain | cos | server | calresource | internalUserAccount | internalArchivingAccount | internalUserAccountX
Object type
@onlyRelated Optional (0 or 1) Type: 0|1
Get only related if delegated/domain admin
/domain Optional (0 or more) Type: {key}
Domain
Description for element text content:The key used to identify the domain. Meaning determined by {domain-selector-by}
/domain@by Optional (0 or 1) Type: id | name | virtualHostname | krb5Realm | foreignName
Select the meaning of {domain-selector-key}

CountObjectsResponse

    <CountObjectsResponse num="{num-objects} (long)" type="..." /> ## CountObjectsResponse

elements and attributes you can define within a <CountObjectsResponse> element:

XPath Required / Optional Description
@num Required (only 1) Type: long
Number of objects of the requested type
@type Required (only 1) Type: String