IntroductionBefore you beginTerminologyGetting started
Authorization
Accounts
Entities
User accounts
GroupsFilesFoldersTemplatesThe template objectTemplate typesRetrieve a templateCreate a templateUpdate a templateTemplate permissionsEmail templatesAppsErrors

Templates

Templates allow clients to easily store and organize files for an entity in the customer’s environment (Tax Engagement, Firm, Client, etc.).

Its management can be done using the /nodes/template resource.


Templates can include folders, vaults, and containers.
Templates also allow you to specify what documents should be automatically routed to each location within the template.
Users can create new templates and use and/or modify preexisting templates created by SmartVault.When a template is modified, the changes can be subsequently applied to existing folder templates created by those templates.


All the endpoints related to templates are case sensitive, so be careful when doing the request because if you don't specify the casing properly, you will get an error object as a result of the request.






The template object

Some of the template object attributes (vaults, folders, containers and groups) refers to the SmartVault types specified below.

Show Attributes




The TemplateVault object


This is the vault that will contain all of the data associated with this Entity. At most, there can only be one vault as the root.
Currently only SmartVault.Accounting.Client and SmartVault.Core.UserAssociation takes advantage of vaults.

Show vault attributes




The TemplateFolder object


This is the folder that will contain all of the data associated with the entity. At most, there can only be one folder as the root.
Currently only SmartVault.Accounting.TaxEngagement, as well as other engagements, take advantage of folders.

Show folder attributes


The FolderAssociation object

Folder associations consist of tags. Documents published to the template entity that include these tags will be routed to this location. Each routing rule should only occur at most once in the entire hierarchy.

Show folder association attributes


The Tag object

Show tag attributes


Possible tag values are

Show content




The TemplateContainer object


These containers are children of the account; in other words, there is automatically a storage element to contain the SmartVault.Accounting.Firm before the firm is created. Unlike the vaults and folders elements, there can be any amount of containers as the root for a template.

Show container attributes




The TemplateGroup object


A group specifies who has access to the templates. For usage in templates, permissions are restricted to group monikers.
These group monikers are resolved dynamically by the system to produce groups’ identities.

Show group attributes


These are the group monikers that are currently supported.

Show group monikers








Template types

The full list of templates available for an account can be fetched executing the request below.

https://rest.smartvault.com/nodes/template/SmartVault Account/My Templates?children=1

Example of template names retrieval response

Show templates








Retrieve a template

Templates are located in /nodes/template/account_name/My Templates.



Parameters


account_namestringThe user's account name.
entity_definitionstringThe template name.

Request


curl --include \
--header "Authorization: Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==" \
--header "Accept: application/json" \
'https://rest.smartvault.com/nodes/templates/{AccountName}/My Templates/{EntityDefinition}'

Response


Returns a node response object pointing to the template retrieved.

Show success object


Returns an error object if any of the required parameters are wrong.

Show error object








Create a template

SmartVault allows the creation of new templates for an account.
Create a template
PUT/nodes/templates/{account_name}/My Templates/{entity_definition}

Parameters


account_namestringThe user's account name.


Body parameters


The request expects a template object as its body request. Check the example request below for more information.


Request


In the following example the API retrieve information pertaining to the Employee template, located in “My Templates” for the account “SmartVault”.


Headers:
Authorization:Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==
Accept:application/json
Body:
{
"applies_to": "SmartVault.Accounting.TaxEngagement",
"api_name": "TaxEngagementCustomTemplate",
"label": "My Custom Tax Engagement Template",
"groups": [
{
"moniker": "FirmManager",
"name": "Firm Managers",
"rid": 8,
"create": true
},
{
"moniker": "AccountEmployees",
"name": "Employees",
"rid": 18,
"create": false
}
],
"folders": [
{
"name": "Tax Year 2012",
"acl": {
"aces": [
{
"principal": "AccountEmployees",
"permissions": 15
},
{
"principal": "FirmManager",
"permissions": 111
}
]
},
"id": "root",
"folders": [
{
"name": "Client Tax Returns",
"acl": {
"aces": [
{
"principal": "FirmEmployees",
"permissions": 15
}
]
},
"id": "client_tax_returns",
"folder_association": {
"tags": [
{
"value": "clientcopy.taxreturn.tags.accounting.smartvault.com"
}
]
}
}
]
}
]
}

Response


Returns a node response object pointing to the template retrieved.

Show success object









Update a template

SmartVault also allows the modification of user created templates with a POST method.
Update a template
POST/nodes/templates/{account_name}/My Templates/{entity_definition}

This endpoint can be used for multiple modifications of the template.

Copying templates
Moving template nodes
Merging template nodes
Deleting template nodes
Adding folders to templates
Setting notifications
Routing documents to template nodes (tags)

Find more information about each type of request below.


Parameters


account_namestringThe user's account name.
entity_definitionstringThe template name.


Body parameters


Use the following properties to make changes to a template

Show content



The UpdateTemplateRequest object


Use the update container to change the properties associated with a template (API name for the template, label for the template, who the template applies to, etc).

Show UpdateTemplateRequest




Copying Templates


When copying templates, you will need to provide the following body parameter.

dst_uristringDestination URI of the new copy of the template.



Modifying Template Information (The ApplyChangeSet object)


Use the change container to make changes to a template’s metadata. The properties for ApplyChangeSet are.

Show ApplyChangeSet attributes


To retrieve the current version (and know what value you should specify for the update) make a request to
/nodes/template/{account_name}/My Templates/{entity_definition}?eprop=true



The TemplateChange object

A TemplateChange is a union of possible changes made to a template.
Each change should apply at most one change to the template and most changes apply to one aspect of the template, specified by the ‘selector’ field.
One of the few exceptions is changing the template label, which is a global template change and does not require a selector.

Show TemplateChange attributes



For example, if you wanted to create a new nested folder on a template, you won't specify the "selector" value as "root", instead you can check for the current available selectors by making a request to the actual template.
GET request to /nodes/template/SmartVault Account/My Templates/SmartVault.Accounting.FinancialServicesEngagementTemplate?eprop=true

This will return the extra information of the template where you can check the selectors

Show template object




Tags

Using the folder_association element, you can add and delete routing rules from a template node.
Documents published to the template entity that include these tags will be routed to this location. Each routing rule should only occur at most once in the entire hierarchy.




Merging Template Nodes


The Merge operation merges the selected node to the destination node and combines associations, relationships, and contents of the source folder with the target.

Show merge properties




Setting notification for nodes


Property "set_notifications" updates the notifications of the target node. It consists of a property called "notifications", which is composed of an element also called "notifications", which houses the list of notifications to be updated.
A notification has the following properties:

Show merge properties



Request


Example of a call to add a new folder to a template

Show folder addition



Example of a call to modify folder permissions inside a template. More info about the permissions values here.

Show permissions modification



Example for a template modification request execution.


Headers:
Content-Type:application/json
Authorization:Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==
Accept:application/json
Body:
{
"update": {
"update_api_name": "true",
"api_name": "SmartVault.Core.UserTemplate",
"update_label": "true",
"label": "SmartVault Employee",
"update_plural_label": "true",
"plural_label": "SmartVault Employees"
},
"copy": {
"dst_uri": "/nodes/template/SmartVault/My Templates/Intuit.Accounting.DMS.TaxTemplate"
},
"change": {
"version": 5,
"comment": "Move Correspondence folder to My Folder",
"changes": [
{
"selector": "/root/correspondence",
"move": "/root/my_folder"
},
{
"selector": "/root/my_folder",
"merge": {
"destination": "/root/my_folder/correspondence"
}
},
{
"selector": "/root",
"add": {
"id": "personal_folder",
"name": "Personal Folder"
}
},
{
"selector": "/root/my_folder/correspondence",
"delete": "true"
},
{
"selector": "/root/my_folder",
"folder_association": {
"tags": {
"add": {
"tags": [
{
"value": " misc.tags.core.smartvault.com "
}
]
}
}
}
},
{
"selector": "/root/my_folder",
"set_notifications": {
"notifications": {
"notifications": [
{
"principal": "AccountAdmins",
"notifications": 2
}
]
}
}
}
]
}
}

Response


Returns a node response object pointing to the template updated.

Show success object


Returns an error object if the template trying to be updated doesn't exist.

Show error object









Template permissions

SmartVault allows the modification of the permissions in templates. You can find right below the required objects to update the permissions of a node as well as some examples for better understanding.


The UpdateContainer object

acesList<UpdateACE>List of access control entries.

The UpdateACE object

principalstringThe entity to which the permissions apply to.
permissionsintNew permissions value. Check table below.


Possible values for the permissions field of the UpdateACE. It can be each value individually or the sum of any of them.
e.g.: "permissions: 3" would be read (1) and write (2) access.

Show permissions value



Knowing this, if we wanted to add write, create and change access permission to a certain group member in a template, it'd be something like the following

More info about the rest of the body parameters here.

Show example