editFolder

Renames the specified Folder.

editFolder

Renames the specified Folder.

Top ↑

Syntax

bool editFolder( string api_key, object folder_details );

Parameters

api_key (string)

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

folder_details (object)

An object of Folder details. See remarks below for a description of the values in the folder_details object.

Return Value

Returns true on success.

Examples

The following example renames a Folder:

$folder_details = array(
    'id'    => 12345,
    'name'  => 'Updated Folder Name',
);

// API Call
$api = new Api($url, 'YOURAPIKEY');
$folder_id = $api->invokeMethod('editFolder', $folder_details);
{
    "id": 1,
    "method": "editFolder",
    "params": [
        "YOURAPIKEY",
        {
            "id": 12345,
            "name": "Updated Folder Name"
        }
    ]
}
{
    "id": 1,
    "result": 12345,
    "error": null
}

Remarks

The following table shows the structure of the folder_details object.

Key Type Mandatory Description
id int Yes The ID of the Folder to edit.
name string Yes The new name for the Folder.

Error Codes

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

Code Error Description
306 Unable to Load Folder id is not a valid Folder
310 Invalid Method Parameters id is empty or missing from the folder_details array
310 Invalid Method Parameters name is empty or missing from the folder_details array
302 Undefined Error An internal error occurred while the system was trying to edit the Folder

See Also