Update, delete, and query the available Files in Box.
Table Specific Information
If you search for files without specifying any condition in the WHERE Clause, by default only the files that are at most 5 levels deep from the root folder will be returned. You can change the default depth value in the connection string; e.g. DirectoryRetrievalDepth=10.
SELECT * FROM Files
To search all the Files in your enterprise, query the Files table with the column SearchTerms.
SELECT * FROM Files WHERE SearchTerms LIKE '%untitled%'
To search all the Files within a specific folder, query the Files table with a filter on the relevant folder's Id in the ParentId column.
SELECT * FROM Files WHERE ParentId = '12'
You must at least specify a value for Path, which represents the local file path.
INSERT INTO Files (Path) VALUES ("c:/file.txt")
Any column where ReadOnly=False can be updated.
UPDATE Files SET Description = 'example description', Sharedlink='http://sharedlink.com', OwnedbyId='321', ParentId='12', Name = 'updated file name' WHERE Id = '123'
Files can be deleted by providing an Id and issuing a DELETE statement. This file is then moved to TrashedItems
DELETE FROM Files WHERE Id = '100'
Query to search the files database.
The Id of the file.
The name of the file.
The SHA-1 encryption of the file.
The Etag of the file
The sequence Id of the file.
The description of the file.
The size of the file.
The date the file was created at.
The date the file was modified at.
The date the file was trashed at.
The date the file was purged at.
The date the content of the file was created at.
The date the content of the file was modified at.
The Id of the user that created the file.
The Name of the user that created the file.
The Login of the user that created the file.
The shared url of the file.
The Id of the user that last modified the file.
The Name of the user that last modified the file.
The Login of the user that last modified the file.
The Id of the user that owns the file.
The Name of the user that owns the file.
The Login of the user that owns the file.
The Id of the folder that contains the file.
The status of the file.
The full path of the file.
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
The scope of the search.
The extension of the file.
The content to search the query at, separated by commas. This can contain a mixture of the following: name, file_content, description, comments, tags.
The Ids of the owners to limit the search to, separated by a comma.
The Ids of the folders to limit the search to, separated by a comma.
The Id of the user you want to impersonate. Only works with Admin, Co-Admin and Service Accounts.