IntroductionBefore you beginTerminologyGetting started
Authorization
Accounts
Entities
User accounts
GroupsFilesFoldersThe Folder objectRetrieve folder informationCreate a folderDelete a folderCopy or move a folderTemplatesEmail templatesAppsErrors

Folders

With every new client created, a folder structure will be set automatically based on the type qualifier selected. Folders are managed using the /nodes/pth resource. This structure is key to integrating with SmartVault if you are using the generic integration model.
You can retrieve, create and delete folders as well as copy and move them.

There are special folders that are automatically created with a predefined structure. For example, when a user integrates their QuickBooks account in their SmartVault account using the QuickBooks app, a folder called "QuickBooks" will be created with a structure that imitates that of their QuickBooks account. SmartVault does not allow any user to modify the structure of these “custom” folders.







The Folder object

Show Attributes









Retrieve folder information

You can get the basic folder information by specifying the full path to the folder itself.
Also you can use some query parameters to get specific information about the files in that folder.

Get folder
GETnodes/pth/{path}

Parameters


pathstringThe full path where the folder is.


Query parameters


There are some optional query parameters that you can use to refine the output of the request.

Show query parameters



Request


curl --include \
--header "Authorization: Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==" \
--header "Accept: application/json" \
'https://rest.smartvault.com/nodes/pth/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction='

Response


Returns a folder object.

Show success object


Returns an error object if the folder doesn't exist.

Show error object








Create a folder

To create a new folder just use the full path of the folder, including the name of what would be the new created folder.

If this request is executed right under the account name like "/nodes/pth/SmartVault Account/New Folder", a vault will be created instead of a folder.

Create folder
PUTnodes/pth/{path}

Parameters


pathstringThe full path where the folder is going to be created.
e.g.: https://rest.smartvault.com/nodes/pth/Folder/NestedFolder/NewFolder

A PUT request to the url above would create a new folder called "NewFolder" on the "/Folder/NestedFolder/" route.



Request


curl --include \
--request PUT \
--header "Authorization: Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==" \
--header "Accept: application/json" \
'https://rest.smartvault.com/nodes/pth/{path}'

Response


Returns a folder object.

Show success object


Returns an error object if the folder doesn't exist.

Show error object








Delete a folder

Delete the folder at the given path. Be careful for all the content inside that folder will be deleted with the folder deletion.

Delete folder
DELETEnodes/pth/{path}

Parameters


pathstringThe full path pointing at the folder that will be deleted.


Request


curl --include \
--request DELETE \
--header "Authorization: Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==" \
--header "Accept: application/json" \
'https://rest.smartvault.com/nodes/pth/path'

Response


Show result object


Returns an error object if the folder doesn't exist.

Show error object








Copy or move a folder

To copy or move a folder, you need to POST to the url pointing at the folder you'd want to copy / move and pass the following parameters in the body of the request.

Copy or move a folder
POSTnodes/pth/{path}


Body parameters


dst_uristringThe destination URI starting from /nodes/pth. This should include the new folder name.
replacestringSets what to do if the folder already exists.Values can be "fail" or "replace"

For copying a folder the body of the request would need to be:

{
"copy": {
"dst_uri": "/nodes/pth/{path}",
"replace": "Replace"
}
}

Instead, if what you want is to move the folder:

{
"move": {
"dst_uri": "/nodes/pth/{path}",
"replace": "Replace"
}
}

Example


Show explicit example



Request


We'll use the "copy" keyword for the request body as default for the examples below. As it's specified above, the body of the request would need to change in case you'd wanted to move the folder instead.


Headers:
Content-Type:application/json
Authorization:Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==
Accept:application/json
Body:
{
"move": {
"dst_uri": "/nodes/pth/SmartVault/testing/OtherFolder/hello.txt",
"replace": "Replace"
}
}

Response


Returns a folder object if the folder has been copied or moved correctly.

Show success object


Returns an error object if the folder trying to be copied or moved can't be found.

Show error object