Newer Version Available
Folders Resources
| Resource | Description |
|---|---|
| /chatter/folders/folderId | Get information about the specified folder. Move, rename, and delete a folder. Sync the root folder. |
| /chatter/folders/folderId/items | Get information about the contents of a folder. Add a file to a folder and create a folder. Sync the root folder. |
Folder Information
Get information about the specified folder. Move, rename, and delete a folder. Sync the root folder. Deleting a folder deletes all the folders within that folder and removes all files from the deleted folders so they are no longer synced.
- Resource
-
1/chatter/folders/folderId - Available since version
- 30.0
- Requires Chatter
- Yes
- 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. Setting isInMyFileSync is valid only for the root folder. Once set to true, isInMyFileSync can’t be set to false.
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. Setting isInMyFileSync is valid only for the root folder. Once set to true, isInMyFileSync can’t be set to false.
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. Sync the root 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 add a file to the Files tab, use /chatter/users/me/files.
- Resource
-
1/chatter/folders/folderId/items - Available since version
- 30.0
- Requires Chatter
- Yes
- HTTP methods
- GET, HEAD, POST
- Request parameters for GET
-
Parameter Type Description Required or Optional Available Version filter String Specifies a filter for items within a folder. The value IsInMyFileSync filters out the items that aren’t synced in 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. Setting isInMyFileSync is valid only for the root folder. Once set to true, isInMyFileSync can’t be set to false.
Optional 33.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. Setting isInMyFileSync is valid only for the root folder. Once set to true, isInMyFileSync can’t be set to false.
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}