Vision 6

countFolders

Counts the number of Folders that match the search criteria.

countFolders

Counts the number of Folders that match the search criteria.

Top ↑

Syntax

int countFolders(
    string api_key,
    string folder_type,
  [ array search_criteria ] 
);

Parameters

api_key (string)

The key required to access the API. See Getting Started for more information.

folder_type (string)

The type of Folder to count. Valid values are: list, message or file.

search_criteria (array - optional)

An array of search criteria that selects the Folders to be counted. See searchFolders for a description of the values that can be searched on.

Return Value

The number of Folders that match the search criteria.

Examples

The following examples count the number of empty File Folders in an Account.

PHP

$search_criteria = array(
    array('item_count', 'exactly', 0)
);

// API Call
$api = new Api($url, 'YOURAPIKEY');
$folder_count = $api->invokeMethod('countFolders', 'file', $search_criteria);

JSON Request

{
    "id": 1,
    "method": "countFolders",
    "params": [
        "YOURAPIKEY",
        "file",
        [
            ["item_count", "exactly", 0]
        ]
    ]
}

JSON Response

{
    "id": 1,
    "result": 1,
    "error": null
}

Error Codes

This method may return the following error codes in addition to the standard error codes:

Code Error Description
311 Invalid Search Parameter Format search_critera is not valid
302 Undefined Error: Invalid Folder Type folder_type is invalid. Must be list, message, or file

See Also