Newer Version Available
Folders Resources
| Resource | Description |
|---|---|
| /connect/folders/folderId | Get information about the specified folder. Move, rename, and delete a folder. |
| /connect/folders/folderId/items | Get information about the contents of a folder. Add a file to a folder and create a folder. |
| /connect/folders/folderId/folder-shares/link | A folder shared as a link. Create, access, and delete a folder’s share link. |
Folder Information
Get information about the specified folder. Move, rename, and delete a folder. Deleting a folder deletes all the folders within that folder and removes all files from the deleted folders.
- Resource
-
1/connect/folders/folderId - Available since version
- 36.0
- In versions 30.0–35.0, use /chatter/folders/folderId, which requires Chatter.
- Requires Chatter
- No
- HTTP methods
- GET, HEAD, PATCH, DELETE
- Request body for PATCH
- Folder Input
- Request parameters for PATCH
-
Move a folder
Parameter Type Description Required or Optional Available Version isInMyFileSync Boolean true if the folder and all folders in this folder are synced with Salesforce Files Sync; false otherwise. Optional 33.0 parentFolderId String The ID of the new parent folder. If null, the folder is removed from its current folder. If the specified ID is root, the folder is moved to the root of the user’s folder hierarchy. Required 30.0 -
Rename a folder
Parameter Type Description Required or Optional Available Version isInMyFileSync Boolean true if the folder and all folders in this folder are synced with Salesforce Files Sync; false otherwise. Optional 33.0 name String The new name for the folder Required 30.0 - Response body for GET and PATCH
- Folder
Folder Contents
Get information about the contents of a folder. Add a file to a folder and create a folder.
To create a folder, you can use a request body or request parameters in a POST request.
To create a file, you must send it as a body part in a multipart/form-data POST request. You can send the description and title information in a JSON or XML rich input body in a part of the multipart/form-data request. Alternately, you can send the description, title, and type in request parameters. See Uploading Binary Files. To upload a file to the Files home, use /connect/files/users/me.
- Resource
-
1/connect/folders/folderId/items - Available since version
- 36.0
- In versions 30.0–35.0, use /chatter/folders/folderId/items, which requires Chatter.
- Requires Chatter
- No
- HTTP methods
- GET and POST
- Request parameters for GET
-
Parameter Type Description Required or Optional Available Version filter String Specifies a filter for items within a folder. Optional 33.0 page Integer An integer specifying a page of items. The default value is 0, which returns the first page. Optional 30.0 pageSize Integer Specifies the number of items per page. Valid values are from 1 through 100. If you don't specify a size, the default is 25. Optional 30.0 - Response body for GET
- Folder Item Page
- Request body for POST
- Request parameters for POST
-
Add a file to a folder
Parameter Type Description Required or Optional Available Version desc String The description of the file Optional 30.0 isInMyFileSync Boolean true if the folder and all folders in this folder are synced with Salesforce Files Sync; false otherwise. Optional 33.0 sharingOption String Sharing option of the file. Values are: - Allowed—Resharing of the file is allowed.
- Restricted—Resharing of the file is restricted.
Optional 35.0 sharingPrivacy String Sharing privacy of a file. Values are: - None—File is visible to anyone with record access.
- PrivateOnRecords—File is private on records.
Optional 41.0 title String The title of the file Optional 30.0 type String The item type. To add a file to a folder, the value must be File. Required 30.0 -
Create a folder
Parameter Type Description Required or Optional Available Version folderPath String The path to the folder Required 30.0 isInMyFileSync Boolean true if the folder and all folders in this folder are synced with Salesforce Files Sync; false otherwise. Optional 33.0 type String The item type. To create a folder, the value must be Folder. Required 30.0 - Response body for POST
- Folder Item
- Example for adding a file to a folder
-
1{ 2 "file" : 3 { 4 "description" : "Yearly Report for Universal Containers Box Division", 5 "title" : "Yearly.txt" 6 }, 7 "type" : "File" 8} - Example for creating a folder
-
1{ 2 "folder" : 3 { 4 "path" : "my_documents/my_folder" 5 }, 6 "type" : "Folder" 7}