Items

Items Entities: File, Folder, Note, Link and SymbolicLinks

Get HomeFolder for Current User

GET https://account.sf-api.com/sf/v3/Items 

Returns home folder for current user. Note that home folders are not available for client users, or if the account doesn't have the "My Files & Folders" feature enabled.

Returns: home folder for current user

Get Item by ID or TreeView

GET https://account.sf-api.com/sf/v3/Items(id)?includeDeleted=false&treemode=mode&sourceId=id&canCreateRootFolder=false 

Returns a single Item or a folder list structure tailored for TreeView navigation - used by clients to create folder trees for specific operations. If a TreeMode is entered then a treeview is returned, otherwise a single item is returned. Special Id's:home, favorites, allshared, connectors, box, top. home - Return home folder. favorites - Return parent favorite item; use .../Items(favorites)/Children to get the favorite folders. allshared - Return parent Shared Folders item; use .../Items(allshared)/Children to get the shared folders. connectors - Return parent Connectors item; use .../Items(connectors)/Children to get indiviual connectors. box - Return the FileBox folder. top - Returns the Top item; use .../Items(top)/Children to get the home, favorites, and shared folders as well as the connectors

idString Item identifier
includeDeletedBoolean Specifies whether or not a deleted item should be returned
treeModeTreeMode? Specifies the type of operation for the tree. The mode determines the condition to calculate the TreeModeOperationAllowed property of ItemInfo. Allowed values are copy, move, manage
sourceIdString The source object considered for this operation - for example, in a Copy operation, the sourceId represent the source Item being copied, and the tree renders the target
canCreateRootFolderBoolean Specifies whether users can create root folders
fileBoxBoolean

Returns:

Get Item by ID

GET https://account.sf-api.com/sf/v3/Items(id)?includeDeleted=false 

Returns a single Item. Special Id's:home, favorites, allshared, connectors, box, top. home - Return home folder. favorites - Return parent favorite item; use .../Items(favorites)/Children to get the favorite folders. allshared - Return parent Shared Folders item; use .../Items(allshared)/Children to get the shared folders. connectors - Return parent Connectors item; use .../Items(connectors)/Children to get indiviual connectors. box - Return the FileBox folder. top - Returns the Top item; use .../Items(top)/Children to get the home, favorites, and shared folders as well as the connectors

idString Item identifier
includeDeletedBoolean Specifies whether or not a deleted item should be returned

Returns: a single Item

Get TreeView

GET https://account.sf-api.com/sf/v3/Items(id)?treemode=mode&sourceId=id&canCreateRootFolder=false 

Retrieves a folder list structure tailored for TreeView navigation - used by clients to create folder trees for specific operations. This operation will enforce a specific $select and $expand operators. You can provide additional $expand, for example Children, which is not added by default. The $select operator will apply to the expanded objects as well. You can also specify additional $select elements.

idString ID of top-level Folder to retrieve
treeModeTreeMode Specifies the type of operation for the tree. The mode determines the condition to calculate the TreeModeOperationAllowed property of ItemInfo. Allowed values are copy, move, manage
sourceIdString The source object considered for this operation - for example, in a Copy operation, the sourceId represent the source Item being copied, and the tree renders the target
canCreateRootFolderBoolean Specifies whether users can create root folders
fileBoxBoolean

Returns: A tree root element.

Get TreeView

GET https://account.sf-api.com/sf/v3/Items(id)/TreeView?treemode=mode&sourceId=id&canCreateRootFolder=false 

Retrieves a folder list structure tailored for TreeView navigation - used by clients to create folder trees for specific operations. This operation will enforce a specific $select and $expand operators. You can provide additional $expand, for example Children, which is not added by default. The $select operator will apply to the expanded objects as well. You can also specify additional $select elements. [swagger-compliant]

idString ID of top-level Folder to retrieve
treeModeTreeMode Specifies the type of operation for the tree. The mode determines the condition to calculate the TreeModeOperationAllowed property of ItemInfo. Allowed values are copy, move, manage
sourceIdString The source object considered for this operation - for example, in a Copy operation, the sourceId represent the source Item being copied, and the tree renders the target
canCreateRootFolderBoolean Specifies whether users can create root folders
fileBoxBoolean

Returns: A tree root element.

Get Stream

GET https://account.sf-api.com/sf/v3/Items(id)/Stream?includeDeleted=false 

Retrieves the versions of a given Stream. The ID parameter must be a StreamID, otherwise an empty list is returned. StreamID is a property of all Items, representing the "Stream", ie., the collection of all versions of a file. In contrast, an Item ID represents a single version of a file. For example, when users upload or modify an existing file, a new Item is created with the same StreamID. All default Item enumerations return only the latest version of a given stream. Use this method to retrieve previous versions of a given stream. This method carries a default OData $top parameter of 20. If more versions are required, specify the $top query option with the desired parameter.

idString Stream ID
includeDeletedBoolean Include expired items to the feed

Returns:

Get Item by Path

GET https://account.sf-api.com/sf/v3/Items/ByPath?path=/folder1/folder2/folder3 

Retrieves an item from its path. The path is of format /foldername/foldername/filename This call may redirect the client to another API provider, if the path contains a symbolic link.

pathString Path to retrieve

Returns: An item identified by a path

Get Item by relative Path from ID

GET https://account.sf-api.com/sf/v3/Items(id)/ByPath?path=/folder1/folder2/folder3 

Retrieves an item from its path, relative to the provided ID. The path is of format /foldername/foldername/filename This call may redirect the client to another API provider, if the path contains a symbolic link.

idString Root for the relative path
pathString Path to retrieve

Returns: An item identified by a path

Get Parent Item

GET https://account.sf-api.com/sf/v3/Items(id)/Parent 

Retrieves the Parent navigation property of a single Item.

idString Item identifier

Returns: the Parent Item of the give object ID.

Get Children

GET https://account.sf-api.com/sf/v3/Items(id)/Children?includeDeleted=false 

Handler for the Children navigation property of a given Item. A 302 redirection is returned if the folder is a SymbolicLink. The redirection will enumerate the children of the remote connector

idString Item identifier
includeDeletedBoolean Specifies whether or not the list of items returned should include deleted children
orderingModeItemOrderingMode Allows for specifying sort priorities in addition to $orderby, for example, ItemOrderingMode.FoldersFirst. Default is to use FoldersFirst if no $oderby is specified.

Returns: the list of children under the given object ID

Get Folder Access Info

GET https://account.sf-api.com/sf/v3/Items(id)/Info 

Returns the effective Access Controls for the current authenticated user for the selected folder - i.e., the resulting set of Access Controls for the Item/User context.

This operation applies to Folders only, will return an error for other Item types.

idString Item identifier

Returns: The Folder Access Control Information

Download Item Content

GET https://account.sf-api.com/sf/v3/Items(id)/Download?includeallversions=false&includeDeleted=false&forQurantinedFiles=false 

Initiate the download operation for an item. It will return 302 redirection to the actual download link. For Folders, the download link will retrieve a ZIP archive with the contents of the Folder.

idString Item identifier
redirectBoolean Redirect to download link if set to true (default), or return a DownloadSpecification object if set to false
includeAllVersionsBoolean For folder downloads only, includes old versions of files in the folder in the zip when true, current versions only when false (default)
includeDeletedBoolean For FINRA or other archive enabled account only, Super User can set includeDelete=true to download archived item. The default value of includeDeleted is false
forQuarantinedFilesBoolean For QuarantinedFiles Page in WebApp only, Master Admin can download infected items included ones recently deleted which are on RecycleBinDays

Returns: the download link for the provided item content.

Download Multiple Items

POST https://account.sf-api.com/sf/v3/Items(id)/BulkDownload?redirect=true 
            ["id1","id2"] 

Initiate the download operation for items. It will return 302 redirection to the actual download link.

parentidString Id of Parent item
idsString[] List of items to download.
redirectBoolean Redirect to download link if set to true (default), or return a DownloadSpecification object if set to false

Returns: the download link for the provided item content.

Create Folder

POST https://account.sf-api.com/sf/v3/Items(parentid)/Folder?overwrite=false&passthrough=false 
            { 
              "Name":"Folder Name", 
              "Description":"Description", 
              "Zone":{ "Id":"ZoneId" }, 
              "ExpirationDate": "9999-12-31T23:59:59.9999999Z" 
            } 

Creates a new Folder. The POST body must contain the serialized object. For top-level folders, use Items/Folder. The Zone object may only be provided for top-level folders. The Zone object must contain a zone ID.

parentidString Parent ID Identifier
folderFolder
overwriteBoolean Indicates whether an object with the same name must be overwritten or not. Default is false. If false, then an existing item with the same name will return an error.
passthroughBoolean ?

Returns: the new Folder

Create Note

POST https://account.sf-api.com/sf/v3/Items(parentid)/Note 
            { 
              "Name":"Note Name", 
              "Description":"Description" 
            } 

Creates a new Note.

parentidString Parent ID Identifier
noteNote

Returns: the new Note

Update Item

PATCH https://account.sf-api.com/sf/v3/Items(id)?overwrite=false 
            { 
              "Name":"Name", 
              "FileName":"FileName", 
              "Description":"Description", 
              "ExpirationDate": "date", 
              "Parent": { "Id": "parentid" }, 
              "Zone": { "Id": "zoneid" } 
            } 

Updates an Item object. Please note that for a Folder, the Name and FileName properties must be consistent. If a new Name is provided, the FileName will also be updated with the new name, and viceversa. If both Name and FileName are provided, FileName is disregarded and Name will be used to update both properties.

idString ID of the Item object
itemItem
batchidString BatchID for Async Operation
batchSizeInBytesInt64 Async Operation size in bytes
forceSyncBoolean Indicates whether operation is to be executed synchronously
scheduleAsyncBoolean Indicates whether operation is to be scheduled for Bot processing
resolveFolderNameConflictBoolean Rename the folder if there is a conflict
notifyBoolean Indicates whether an email should be sent to users subscribed to Upload Notifications

Returns: A modified Item object. If the item Zone or Parent Zone is modified, then this method will return an Asynchronous operation record instead. Note: the parameters listed in the body of the request are the only parameters that can be updated through this call.

Update Note

PATCH https://account.sf-api.com/sf/v3/Items/Note(id)?notify=false 
            { 
              "Name":"Name", 
              "Description":"Description", 
              "Parent": { "Id": "parentid" } 
            } 

Updates a Note object

idString ID of the Note object
noteNote
notifyBoolean Inidicate whether notifications will be sent to listeners in the note's folder

Returns: The modified Note object

Delete Item

DELETE https://account.sf-api.com/sf/v3/Items(id)?singleversion=false&forceSync=false 

Removes an item

idString Item identifier
singleversionBoolean True will delete only the specified version rather than all sibling files with the same filename
forceSyncBoolean True will block the operation from taking place asynchronously

Delete Multiple Items

POST https://account.sf-api.com/sf/v3/Items(parentid)/BulkDelete?forcesync=false&deletePermanently=false 
            ["id1","id2"] 

All items in bulk delete must be children of the same parent, identified in the URI

parentidString Id of Parent item
idsString[] List of items to delete. StreamIDs can be passed, which will delete all versions.
forceSyncBoolean If false, an operation over a certain size will be rescheduled asynchronously
deletePermanentlyBoolean If true, the items will be removed from the Recycle Bin or bypass it entirely

Get Thumbnail

GET https://account.sf-api.com/sf/v3/Items(id)/Thumbnail?size=75&redirect=true 

Retrieve a thumbnail link from the specified Item.

idString ID of the target object
sizeInt32 Thumbnail size. Only 75px and 600px are supported. Default is 75px
redirectBoolean If set to true, the response will be a 302 to the thumbnail URL. Otherwise, it returns 200 OK with a Redirection object in payload

Returns: A 302 redirection to the Thumbnail link

Get Breadcrumbs

GET https://account.sf-api.com/sf/v3/Items(id)/Breadcrumbs?path=path&bubbleSharedPassthroughs=false 

Retrieves the path from an item from the root. The return list is a Feed of Items, with the top-level folder at the first position. If this item is in a Connection path, the breadcrumbs may contain URL reference back to the parent account - and the Item in the feed will contain just the URL reference.

idString ID of target object
pathString Path to the Root
bubbleSharedPassthroughsBoolean Allow bubbling of passthrough folders

Returns: A feed containing the path of folders from the specified root to the item, in order

Copy Item

POST https://account.sf-api.com/sf/v3/Items(id)/Copy?targetid=itemid&overwrite=true 

Copies an item to a new target Folder. If the target folder is in another zone, the operation will return an AsyncOperation record instead. Clients may query the /AsyncOperation Entity to determine operation progress and result.

idString Source item identifier
targetidString Target item identifier
overwriteBoolean Indicates whether existing item in the target folder should be overwritten or not in case of name conflict. Default is false.

Returns: the modified source object

Unlock File

POST https://account.sf-api.com/sf/v3/Items(id)/CheckIn 

Unlock a locked file. This operation is only implemented in Sharepoint providers (/sp)

idString Item ID
messageString

Lock File

POST https://account.sf-api.com/sf/v3/Items(id)/CheckOut 

Locks a file. This operation is only implemented in Sharepoint providers (/sp)

idString Item ID

Discard CheckOut

POST https://account.sf-api.com/sf/v3/Items(id)/DiscardCheckOut 

Discards the existing lock on the file This operation is only implemented in Sharepoint providers (/sp)

idString Item ID

Get Redirection endpoint Information

GET https://account.sf-api.com/sf/v3/Items(id)/Redirection 

Returns the redirection endpoint for this Item.

This operation applies to Folders and SymbolicLinks only, will return an error for other Item types.

idString Item identifier

Returns: The Redirection endpoint Information

Get a collection of recoverable/deleted items in a folder

GET https://account.sf-api.com/sf/v3/Items(parentid)/DeletedChildren 
idString The ID of the parent folder to load deleted items for

Get a collection of recoverable/deleted items for a user

GET https://account.sf-api.com/sf/v3/Items/UserDeletedItems?userid=xxxxx&zone=zxxxxx 
useridString The ID of the user to load deleted items for
zoneString Gets deleted items for the specified zone only

Restore expired items to their original locations

POST https://account.sf-api.com/sf/v3/Items/BulkRestore 
idsString[] An array of item IDs to be restored

Permanently delete multiple items

POST https://account.sf-api.com/sf/v3/Items/BulkDeletePermanently 
idsString[] An array of item IDs to be deleted permanently

Create a one-time use login Uri for the Web App.

POST https://account.sf-api.com/sf/v3/Items(id)/WebAppLink 

The user will be logged in and routed to the parent folder of the Item.

If the Item is a Folder, the user will be routed to that Folder.

idString Item identifier

Returns: Redirection populated with link in Uri field

Remove folder template association from folder

POST https://account.sf-api.com/sf/v3/Items(parentid)/RemoveTemplateAssociation 
idString The folder ID to remove the template assocation from

Check if template is already part of an existing template structure

POST https://account.sf-api.com/sf/v3/Items(parentid)/CheckTemplateOwned 
idString The folder ID

Check if a versioning change would result in file deletions

POST https://account.sf-api.com/sf/v3/Items(parentid)/CheckVersioningViolation 
idString The folder ID
newMaxVersionsInt32 The new number of maximum file versions

Check if Items would be previewable when created with a specific Parent

POST https://account.sf-api.com/sf/v3/Items(parentid)/CheckIfPreviewable 
            [ { "FileName":"file01.txt", "FileSizeBytes":256 }, { "FileName":"file02.txt", "FileSizeBytes":256 } ] 
parentidString ID of Parent
itemsItem[] Items with values for FileName and FileSizeBytes

Get Items by Data Loss Prevention scan status

GET https://account.sf-api.com/sf/v3/Items/ByDlpStatus?status=Unscanned&zone=z3c74dec-166f-47b9-bac2-0d85b629e57a&enddate=2015-07-10T01:47:22.82Z 
statusDlpStatus Only return Items with this DlpStatus (Unscanned, ScannedOK, or ScannedRejected)
zoneString The ID of the Zone to get the Items from
enddateDateTime? Only return Items with a CreationDate older than this DateTime (optional)

Upload File

POST https://account.sf-api.com/sf/v3/Items(id)/Upload?method=method&various... 
            POST https://account.sf-api.com/sf/v3/Items(id)/Upload2 
            { 
                "Method":"Method", 
                "Raw": false, 
                "FileName":"FileName", 
                "FileSize": 2048 
            } 

Prepares the links for uploading files to the target Folder. This method returns an Upload Specification object. The fields are populated based on the upload method, provider, and canResume parameters passed to the upload call. The Method determines how the URLs must be called.

There are two different URLs for upload: /sf/v3/Items(id)/Upload accepts parameters through the URL query string, while /sf/v3/Items(id)/Upload2 uses the HTTP POST message body. If using 'Upload2', the parameters must be capitalized.

Standard uploads use a single HTTP POST message to the ChunkUri address provided in the response. All other fields will be empty. Standard uploads do not support Resume.

Streamed uploads use multiple HTTP POST calls to the ChunkUri address. For each call, the client must append the parameters index, byteOffset and hash to the ChunkUri address. Index is a sequential number (zero-based) identifying the position of the chunk relative to others; byteOffset represents how many bytes precede the chunk relative to the beginning of the file; and hash contains the MD5 hash of the chunk. The last HTTP POST must also include the parameters finish=true and filehash=[MD5 hash of entire file].

Threaded uploads use multiple HTTP POST calls to ChunkUri, and can have a number of threads issuing chunks in parallel. Clients must append index, byteOffset and hash to the end of ChunkUri, as explained for Streamed uploads. After all chunks are sent, the client must call the FinishUri provided in the Upload Specification response.

If using the Threaded Uploader, the client can add the parameter fmt=json to the ChunkUri to retrieve the Item ID of the file after the upload is completed.

For all uploaders, the contents of the POST Body can either be "raw" (if the parameter raw=true is provided to the Uploader) or use MIME multi-part form encoding otherwise. Raw uploads provide the chunk content directly in the POST body and the Content-Length header specifies the size. Multi-part form encoding requires passing the file as a Form parameter named "Filedata".

For Streamed and Threaded uploads, if the CanResume parameter is specified in the call to Upload, then the fields IsResume, ResumeIndex, ResumeOffset and ResumeFileHash may be populated in the Upload Specification response. If they are, it indicates that the server has identified a partial upload with that specification and is ready to resume the upload process. The client can verify the file has not been modified based on the value of ResumeFileHash, then continue issuing calls to the ChunkUri starting from the position represented by the values of ResumeIndex and ResumeOffset. If the client decides to restart the upload, it should simply ignore the resume fields and send chunks starting from Index 0.

For all upload methods, successful HTTP POST calls to ChunkUri and FinishUri will return response code 200 with either no Content Body or with a Body of 'OK'. The response code for failed calls can be 401, indicating authentication is required; 4xx/5xx, indicating some kind of error; or 200 with Content Body of format 'ERROR:[message]'.

idString Target folder identifier
methodUploadMethod Upload method: one of: standard, streamed or threaded
rawBoolean If true, the uploader will send file contents directly in the POST body of the returned upload links. If false, the uploader will send contents in MIME format. Default is false
fileNameString Uploaded item file name. May be null if the metadata is contained in MIME body, or ZIP file upload, then filename may be null. Is mandatory for single file, raw uploads.
fileSizeInt64 Uploaded item file size. Same as filename - may be ignored if metadata is contained somewhere else.
batchIdString Inidicates that this upload is part of a batch. Batched uploads do not send notification until the whole batch is completed.
batchLastBoolean Indicates that this upload is the last in a batch. Upload notifications for the whole batch are sent after this upload.
canResumeBoolean Indicates that the uploader supports resume.
startOverBoolean Indicates that the uploader wants to restart the file - i.e., ignore previous failed upload attempts.
toolString Identifies the uploader tool. This parameter cannot be passed through the POST Request body and will default to "apiv3".
overwriteBoolean Indicates whether items with the same name will be overwritten or not.
titleString Item Title
detailsString Item description
isSendBoolean Indicates that this upload is part of a Send operation
sendGuidString Used if IsSend is true. Specifies which Send operation this upload is part of.
opidString Used for Asynchronous copy/move operations - called by Zones to push files to other Zones
threadCountInt32 Specifies the number of threads the threaded uploader will use. Only used is method is threaded, ignored otherwise
responseFormatString Configures the response format for the upload link calls. Default is json.This parameter cannot be passed through the POST Request body.
notifyBoolean Indicates whether users will be notified of this upload - based on folder preferences
clientCreatedDateUTCDateTime? client filesystem Created Date of this Item. "ClientCreatedDate" is used instead if the parameters are passed through the POST Request body.
clientModifiedDateUTCDateTime? client filesystem Modified Date of this Item. "ClientModifiedDate" is used instead if the parameters are passed through the POST Request body.
expirationDaysInt32? File expiration days
baseFileIdString BaseFileId is a used to check conflict in file during File Upload. BaseFileId is passed by client and contains value of their local copy itemId. API will check if the fileId passed is still current or someone else has updated file since clients last read.

Returns: an Upload Specification element, containing the links for uploading, and the parameters for resume. The caller must know the protocol for sending the prepare, chunk and finish URLs returned in the spec; as well as negotiate the resume upload.