Listing Files

The fileListing API call will return a full nested list of all the folders and files, either for your company's entire root folder or in a specified path within it.

This will only show files that have been added by either the user or your company. Files added by other companies are not visible to you.

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.
path: [optional] used to limit to just part of the root folder.
{
  "action": "fileListing",
  "uid": 1001
}

JSON response

Success:

{
  "error": "",
  "status": "success",
  "data": "-- Base64 encoded AES-256-CBC encrypted JSON --",
  "action": "fileListing",
  "version": "1.07",
  "proc_time": 1651430257,
  "proc_id": 100
}

-- With NO path set or set to '/' -- 
"data" (decrypted)
{
  "path": "/",
  "list": {
    "/": [
      {
        "squid_id": 16,
        "display_name": "estate_summary.xlsx",
        "type": "File",
        "ext": "xlsx",
        "mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "modified": 1663417454,
        "filesize": 29380,
        "dimensions": "",
        "metaTags": "{\"matter\":23456,\"lead\":\"peter baker\",\"team\":\"probate\",\"estate\":\"Mr William Johnson\"}",
        "user_file": "false"
      },
      {
        "squid_id": 14,
        "display_name": "planning_application.doc",
        "type": "File",
        "ext": "doc",
        "mime": "application/msword",
        "modified": 1663417165,
        "filesize": 4767232,
        "dimensions": "",
        "metaTags": "{\"matter\":12345,\"lead\":\"janise smith\",\"team\":\"conveyancing\",\"property\":\"5 James St. KT6 7FG\"}",
        "user_file": "false"
      }
    ],
    "/my_pictures/": [
      {
        "squid_id": 10,
        "display_name": "car_damage.jpg",
        "type": "Image",
        "ext": "jpg",
        "mime": "image/jpeg",
        "modified": 1217592000,
        "filesize": 6179805,
        "dimensions": "2160x3840",
        "metaTags": "",
        "user_file": "true"
      }
    ]
  }
}

-- With path set to '/my_pictures' -- 
"data" (decrypted)
{
  "path": "/my_pictures",
  "list": {
    "/my_pictures": [
      {
        "squid_id": 10,
        "display_name": "car_damage.jpg",
        "type": "Image",
        "ext": "jpg",
        "mime": "image/jpeg",
        "modified": 1217592000,
        "filesize": 6179805,
        "dimensions": "2160x3840",
        "metaTags": "",
        "user_file": "true"
      }
    ]
  }
}

Failure:

{
  "error": "invalid path",
  "data": "-- Base64 encoded AES-256-CBC encrypted JSON --",
  "status": "failure",
  "action": "fileListing",
  "version": "1.07",
  "proc_time": 1651431873,
  "proc_id": 108
}

"data" (decrypted)
{
  "path": "/accnts"
}

Decrypted Data Fields

path: The root folder used for the listing.

list: A list of the folders found each with an array of the files they contain. The files are listed with the following details:

squid_id: SquidVault's internal unique ID for this file.

display_name: The name of the file. This is editable by the user and so it may not be the original name of the uploaded file.

type: The type either 'Image' or 'File'.

ext: The file's extension.

mime: The file's mime-type.

modified: The original file's last modified date as a unix timestamp.

filesize: The file's size in bytes.

dimensions: If the type is 'Image', this is the width and height in pixels.

metaTags: If provided during a call to fileCreate, a stringified json object containing a list of key value pairs.

user_file: This is "true" is the user uploaded the file themselves, otherwise "false".

Common errors

no uid: The uid is missing from the API call.

invalid uid: The uid is not owned by you.

invalid path: The folder path doesn't exist.

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

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

    /*############### OUTPUT ##################

	Array(
		[error] => 
		[status] => success
		[data] => {"path":"\/","list":{"\/":[{"squid_id":16,"display_name":"estate_summary.xlsx","type":"File","ext":"xlsx","mime":"application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet","modified":1663417454,"filesize":29380,"dimensions":"","metaTags":"{\"matter\":12345,\"lead\":\"janise smith\",\"team\":\"conveyancing\",\"property\":\"5 James St. KT6 7FG\"}","user_file":"false"},{"squid_id":14,"display_name":"planning_application.doc","type":"File","ext":"doc","mime":"application\/msword","modified":1663417165,"filesize":4767232,"dimensions":"","metaTags":"{\"matter\":23456,\"lead\":\"peter baker\",\"team\":\"probate\",\"estate\":\"Mr William Johnson\"}","user_file":"false"}],"\/my_pictures\/":[{"squid_id":10,"display_name":"car_damage.jpg","type":"Image","ext":"jpg","mime":"image\/jpeg","modified":1217592000,"filesize":6179805,"dimensions":"2160x3840","metaTags":"","user_file":"true"}]}}
		[action] => fileListing
		[version] => 1.07
		[proc_time] => 1663417897
		[proc_id] => 36
	)

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

	print_r(
		request(
			['action'=>'fileListing', 'uid'=>1001, 'path'=>'/my_pictures' ]
		)
	);

   /*############### OUTPUT ##################

    Array(
		[error] => 
		[status] => success
		[data] => {"path":"\/my_pictures","list":{"\/my_pictures":[{"squid_id":10,"display_name":"car_damage.jpg","type":"Image","ext":"jpg","mime":"image\/jpeg","modified":1217592000,"filesize":6179805,"dimensions":"2160x3840","metaTags":"","user_file":"true"}]}}
		[action] => fileListing
		[version] => 1.07
		[proc_time] => 1663417897
		[proc_id] => 37
	)

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

?>
Copy Code