Vision 6

deleteFile

Deletes the specified File.

deleteFile

Deletes the specified File.

Top ↑

Syntax

bool deleteFile( string api_key, int file_id );

Parameters

api_key (string)

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

file_id (int)

The ID of the File to delete.

Return Value

Returns true on success.

Examples

In the following code, File 1234567 is deleted.

PHP

$file_id = 1234567;          // can be obtained using searchFiles()

$api = new Api($url, 'YOURAPIKEY');
$api->invokeMethod('deleteFile', $file_id);

JSON Request

{
    "id": 1,
    "method": "deleteFile",
    "params": [
        "YOURAPIKEY",
        1234567
    ]
}

JSON Response

{
    "id": 4,
    "result": true,
    "error": null
}

Error Codes

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

Code Error Description
379 Internal filesystem error The system could not load file_id.
375 Internal filesystem error The system could not delete a File that is associated with file_id.
376 Internal filesystem error file_id does not exist in the system.
366 Internal filesystem error The system could not delete file_id.
367 Internal filesystem error The system could not delete file_id.

See Also