Deleting Files

The fileDelete API call is used to remove files from your company's root folder. This can only be used to delete individual files that you have uploaded to a specific customer's Vault.

It is important to store the "squid_id"s that are returned during upload as these are the only way to target a file.

This is only possible if the user has approved your access.
(see Listing Accounts and Account Details)

JSON request

Parameters:
uid: the unique reference used when creating the account.
squid_id: SquidVault's internal unique ID for this file.
{
  "action": "fileDelete",
  "uid": 1001,
  "squid_id": "64"
}

JSON response

Success:

{
  "error": "",
  "status": "success",
  "data": "-- Base64 encoded AES-256-CBC encrypted JSON --",
  "action": "fileDelete",
  "version": "1.07",
  "proc_time": 1651428510,
  "proc_id": 86
}

"data" (decrypted)
{}

Failure:

{
  "error": "invalid squid_id",
  "status": "failure",
  "data": "-- Base64 encoded AES-256-CBC encrypted JSON --",
  "action": "fileDelete",
  "version": "1.07",
  "proc_time": 1651428362,
  "proc_id": 85
}

"data" (decrypted)
{}

Common errors

no uid: uid missing

invalid uid: account uid unauthorised or invalid

not approved: The the user hasn't approved your access.

no squid_id: squid_id empty or missing

invalid squid_id: squid_id unauthorised or invalid

<?php
	print_r(request([
		'action'=>'fileDelete',  
		'uid'=>1001,
		'squid_id'=>'64'
	]));

    /*############### OUTPUT ##################
	
	Array(
        [error] => 
        [status] => success
        [data] => {}
        [action] => fileDelete
        [version] => 1.07
        [proc_time] => 1651428510
        [proc_id] => 86
    )

    #########################################*/

?>
Copy Code