Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Folder Collections
The following user permissions are needed to access this resource.
POST:
- Create Dashboard Folders (for dashboard folders)
- Create Report Folders (for report folders)
GET:
- View access to the folder
Syntax
URI: /services/data/v43.0/folders/
Formats: JSON
HTTP methods
| Method | Description |
|---|---|
| POST | Creates a new folder with the specified name, label, and type. |
| GET | Gets the list of folders. |
POST
Creates a new folder with the specified name, label, type, and parent ID (subfolders only).
/services/data/v43.0/folders/
Request Body
| Query Parameter Name | Group | Available Version | Values | Description |
|---|---|---|---|---|
| folder | Object | 42.0, 43.0 | FolderInputRepresentation | Specifies the folder name, label, type, and parent ID. |
| Code | Type | Available Version | Description |
|---|---|---|---|
| label | String | 42.0 | Folder display name. |
| name | String | 42.0 | Folder unique name. This is a mandatory field for admins; for non-admins, it is auto-generated. |
| type | ConnectFolderTypeEnum | 42.0 | Defined by the type of entity the folder contains. |
| parentId | String | 43.0 | ID of the parent folder. This field is valid only for subfolders. |
| Type | Description |
|---|---|
| Dashboard | Dashboard folders. |
| Document | Document folders. |
| Email folders. | |
| Insights | Insights folders. |
| Reports | Reports folders. |
Sample Request Body
1{
2 "label": "report_folder",
3 "name": "report_folder1",
4 "type": "report"
5 "parentId": "00lxx000000fffffff"
6}Sample Output Response
1{
2 "id" : "00lxx000000flSFAAY",
3 "label" : "report_folder",
4 "name" : "report_folder1",
5 "shareRecipientsUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/share-recipients?shareType=User&limit=100",
6 "sharesUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/shares",
7 "supportedShareTypes" : [ "user", "role", "roleandsubordinates", "roleandsubordinatesinternal", "group", "portalrole", "portalroleandsubordinates", "customerportaluser" ],
8 "type" : "report"
9 "parentId" : "00lxx000000fffffff"
10
11}GET
Gets the list of report and dashboard folders.
/services/data/v43.0/folders/
Parameters
| Field | Type | Available Version | Description |
|---|---|---|---|
| type | ConnectFolderTypeEnum | 43.0 | Defined by the type of entity the folder contains. If not specified, returns all visible folders. If specified, returns visible folders of the specified type. |
| page | Integer | 43.0 | Integer that indicates which page of results to return. Default is 1. |
| pageSize | Integer | 43.0 | Integer that indicates how many results to return per page. Default is 10. |
Output Payload
FolderCollectionRepresentation
FolderCollectionRepresentation
| Field | Type | Available Version | Description |
|---|---|---|---|
| folders | FolderSummaryRepresentation | 43.0 | Collection of folders. |
| totalSize | Integer | 43.0 | Size of the folder collection. |
| url | ConnectUri | 43.0 | URL of the folder collection. |
| nextPageurl | ConnectUri | 43.0 | URL to the next page in the collection. |
| previousPageurl | ConnectUri | 43.0 | URL to the next page in the collection. |
| Field | Type | Available Version | Description |
|---|---|---|---|
| id | ID | 43.0 | Unique identifier. |
| label | String | 43.0 | Display label. |
| name | String | 43.0 | Folder unique name. |
| namespace | String | 43.0 | Namespace prefix to differentiate custom object and field names from those in use by other organizations. |
| type | ConnectFolderTypeEnum | 43.0 | Defined by the type of entity the folder contains. |
| parentId | ID | 43.0 | ID of the parent folder. |
| url | ConnectUri | 43.0 | URL of the folder. |
| childrenUrl | ConnectUri | 43.0 | URL that represents the first level subfolders of the specified folder. |
| depth | Int | 43.0 | Depth of the folder in the tree. A folder with depth 0 is the root folder. |
Sample Output Response
1{
2 "folders" : [ {
3 "childrenUrl" : "/services/data/v43.0/folders/00lRM000000jCWjYAM/children",
4 "id" : "00lRM000000jCWjYAM",
5 "label" : "Asia Sales",
6 "name" : "Asia_Sales",
7 "type" : "report",
8 "url" : "/services/data/v43.0/folders/00lRM000000jCWjYAM"
9 }, {
10 "childrenUrl" : "/services/data/v43.0/folders/00lRM000000jDmNYAU/children",
11 "id" : "00lRM000000jDmNYAU",
12 "label" : "Europe Sales",
13 "name" : "Europe_Sales",
14 "type" : "report",
15 "url" : "/services/data/v43.0/folders/00lRM000000jDmNYAU"
16 }, {
17 "childrenUrl" : "/services/data/v43.0/folders/00lRM000000jHKXYA2/children",
18 "id" : "00lRM000000jHKXYA2",
19 "label" : "North America Sales",
20 "name" : "North_America_Sales",
21 "type" : "report",
22 "url" : "/services/data/v43.0/folders/00lRM000000jHKXYA2"
23 } ],
24 "totalSize" : 3,
25 "url" : "/services/data/v43.0/folders?page=1&pageSize=10"
26}