getFolderContentsById
getFolderContentById(options)
Method Description | This method allows you to retrieve a specific folders contents by a specific ID. It can also retrieve files and get full access of sub-folders. |
Returns | |
Supported Script Types | SuiteScript 2.1 |
Limitations | File size capacity is limited to files 10MB or smaller |
Module | b4cd-file-api-lib.js |
Since | FileSync 0.5.2 |
Parameters
Note: The options
parameter is a JavaScript object.
Parameter | Type | Required | Description | Since |
---|---|---|---|---|
options.folderUniqueId | string | required | The unique ID of the folder for which the content is being requested. This value is generally retrieved by making a call to the getRecordFolderContents or the getFolderContentsByPath method. | 0.5.2 |
options.recordTypeConfigId | integer | required | Internal ID of the FileSync Record Type Configuration record (customrecord_b4cd_record_type_config). * Either the recordTypeConfigId or the connectionId can be provided. At least one of them is required. | 0.5.2 |
| boolean | optional | Set the value to true to include sub-folder contents in the result. Default value: false | 0.5.2 |
Returns
Property | Type | Description | Since |
---|---|---|---|
| string | The file or folder name | 0.5.2 |
| string | The unique ID of the file or folder as assigned by the file hosting service. | 0.5.2 |
| string | Possible Values: "file", "folder" | 0.5.2 |
| integer | File size in bytes. | 0.5.2 |
| string | The URI used to access the file or folder via the API. | 0.5.2 |
| string | The relative file or folder path on the file hosting service starting from the base directory. | 0.5.2 |
| string | The user-navigable URI for the folder or file on the file hosting platform. This can be used to construct hyperlinks for users to reach the file or folder externally. | 0.5.2 |
| string | file contents as encoded Base64 content | 0.5.2 |
DirectoryItem.parentFolderName | string | If options.includeSubfolders is true this value will return the parent folder name of the directory item. | 0.5.2 |
DirectoryItem.parentFolderUniqueId | string | If options.includeSubfolders is true this value will return the parent folder unique ID of the directory item. | 0.5.2 |
Errors
Error Code | Details |
---|---|
| A required argument is missing or undefined. |
Example Usage
var params = {
'folderUniqueId': "5e433228-d3d6-4452-bc37-d2f8867dde29",
'recordTypeConfigId':35,
'includeSubFolders'
}
var content = fileapi.getFolderContentById(params)