Newer Version Available

This content describes an older version of this product. View Latest

Folders Resources

Information about a folder or the contents of a folder. Modify and delete folders, add items to folders, and sync root folders.
Available resources:
Resource Description
/connect/folders/folderId Get information about the specified folder. Move, rename, and delete a folder. Sync the root folder.
/connect/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/connect/folders/folderId

You can use root as the folderId.

Note

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
isInMy​FileSync 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
parent​FolderId 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
isInMy​FileSync 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 upload a file to the Files home, use /connect/files/users/me.

Resource
1/connect/folders/folderId/items

You can use root as the folderId.

Note

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, 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

Folder Item Input

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
isInMy​FileSync 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
sharing​Option 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
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
isInMy​FileSync 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}