GET getFolderContentsByPath

GET getFolderContentsByPath

Method Description

This method gets all files and folders inside a specific folder. It can also retrieve files and folders from the first level of sub-folders.

Returns

DirectoryItem[]

Limitations

TBD


Usage

For notes on how to authenticate see NetSuite documentation.
General usage notes see: 
File Sync REST API

Since

FileSync 0.6.0

Request Parameters

ParameterTypeRequiredDescriptionSince
options.action
string

required

Static value that has to equal getFolderContentsByPath
0.6.0
options.script
stringrequiredStatic value that has to equal customscript_b4cd_fileapi_rl 0.6.0
options.deploy
string
required

Static value that has to equal customdeploy_b4cd_fileapi_rl

0.6.0
options.recordTypeConfigId

integer

required

Internal ID of the FileSync Record Type Configuration record (customrecord_b4cd_record_type_config).

0.6.0

options.folderPath

string

required

The path of the folder for which the content is being requested. This value is generally retrieved by making a call to the getRecordFolderContents or the getFolderContentsById method.

0.6.0

options.includeSubfolders

boolean

optional

Set the value to true to include sub-folder contents in the result.
Default value: false
Limitations: each sub-folder included will require another HTTP request to the file hosting platform and will thus count toward the NetSuite governance limits. It is not recommended to use this option on folders with a large number of child records. 

0.6.0 

Returns: DirectoryItem

PropertyTypeDescriptionSince
DirectoryItem.name

string

The file or folder name

0.6.0

DirectoryItem.uniqueId
stringThe unique ID of the file or folder as assigned by the file hosting service. 0.6.0
DirectoryItem.type
stringPossible Values: "file", "folder"0.6.0
DirectoryItem.fileSize
integerFile size in bytes.0.6.0
DirectoryItem.apiUri
stringThe URI used to access the file or folder via the API. 0.6.0
DirectoryItem.filePath
stringThe relative file or folder path on the file hosting service starting from the base directory. 0.6.0
DirectoryItem.uri
stringThe 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.6.0
DirectoryItem.parentFolderName
string
If options.includeSubfolders is true this value will return the parent folder name of the directory item.
0.6.0
DirectoryItem.parentFolderUniqueId
string
If options.includeSubfolders is true this value will return the parent folder unique ID of the directory item.
0.6.0

Errors

Error CodeDetails
SSS_MISSING_REQD_ARGUMENT

A required argument is missing or undefined.

MULTPLE_CONFIGS_FOUND
Multiple Record Type Configurations were found for the specified record type. Use the recordTypeConfigId parameter instead of the recordType parameter. 

Request Body Example Example

{
    script: "customscript_b4cd_fileapi_rl",
    deploy: "customdeploy_b4cd_fileapi_rl",
    action: "getFolderContentsByPath",
    folderPath: "/sites/FilesConnectorSite/Shared Documents/Vendors",
    recordTypeConfigId: 3,
    includeSubFolders: true
}

Was this article helpful?