API Overview: using sFiles Client APIUse sFiles API to do more with SharePoint, like creating folders based on a trigger, and more.Jul 10, 2024Knowledge
TitleAPI Overview: using sFiles Client APIURL NameAPI-OverviewArticle BodyPrerequisites 1. Your organization has the sFiles Enterprise license.2. sFiles is set up in your org. Audience This document is intended to be used by a Salesforce Administrator with experience developing backend functionality with Apex. API Documentation Site This article is meant to provide a general overview of the capabilities offered by sFiles Enterprise API. For specific API Reference documentation, please view our API Documentation . Available Methods Copy a folder or file copyItem Copy a file or folder in SharePoint.Create a folder createFolder Create a folder within a specified parent folder. This method takes the parent folder's Id and the new folder's name as parameters. Create a sharing link createSharingLink Create a SharePoint link to share a folder or file. You can customize the link by specifying the type (view | edit), expiration date and time, a password, and the scope (anonymous | organization). Create a URL file createURLFile Create a URL file in SharePoint. When clicked in SharePoint, the file will navigate to the SharePoint item specified or external hyperlink specified.Delete a file or folder deleteItem Delete a file or folder in SharePoint. Download a file downloadFile This method takes a SharePoint file id and retrieves the file from SharePoint. It then saves the file in Salesforce Files as a ContentDocument. This method is limited to the Salesforce heap size limit. Get Document Libraries getDocumentLibraries This method lists all document libraries in a given site that is set in the ClientApi. Get Document Library Root Folder Id getDocumentLibraryRootFolderId This method returns the Id of the root folder of a document library. Get Download Link (Introduced in Summer '24 (v1.51)) getDownloadLink This method returns a temporary download link for a file. Get contents of a folder getFolderContents Query and list the contents of a folder. This method will return a list of SharePointFileInfo object of up to 200 results. If there are more results available after the query, the getNextPage parameter will allow a second query to bring back the next set of results. Get folder or file by Id getItemById Searches the Site and Document Library for a file by a specific SharePoint Id. Get folder or file by Id getItemByPath Searches the Site and Document Library for a file by a specific SharePoint path, for example "/Accounts/Bob\'s Account". Get Item by SharePoint Url getItemBySharePointURL When given a SharePoint Online URL to a file or folder, the method returns information concerning that item, including the Id of the file and SharePoint Site and Document Library Ids. Get folder or file by GUID getItemByGuid Searches the Site and Document Library for a file by a specific SharePoint GUID. Get item preview URL getItemPreviewUrl This call gets a temporary url for the preview of a file in SharePoint. Get the list item id of a Document Library getListItemIdFromLibraryId Retrieves the list item id of a document library, when given the document library id. Get Sites getSites This method retrieves the list of sites from a given SharePoint domain. Get Upload Session URL getUploadSessionURL Provides a one-time url to upload a file to the specified folder. Move a folder or file moveItem Move a file or folder in SharePoint. Rename a folder or file renameFile Changes the name of a file or folder in SharePoint. Search for Items (Introduced in Summer '24 (v1.51)) searchForItems Retrieves a list of all items that match a provided search term. Set up a folder setupFolder This method mimics the UI button functionality: "Set Up in SharePoint". Leverage this functionality to set up a folder for a given record exactly as is done in the UI. It will setup a folder according to the configuration of a specific SharePoint Object Settings record. Update custom field (SharePoint column) for a file or folder updateCustomFields Manually sets custom field/value combinations to a file or folder in SharePoint. For example, if you have a custom column in SharePoint called "SalesforceId", you can set that value from the linked Salesforce object's Id. Upload a file to SharePoint uploadFile A very simple upload method. This allows an upload of up to 4 MB and does not require a contentversion. This can be used to upload any blob as a file. uploadLargeFile Upload a file up to 11 MB but requires a ContentVersionId The file will be uploaded as a @future method. Write Debug Logs writeDebugInfo Captures logs from sFiles API calls in the sFiles Debug Log Object.