node-red-contrib-box-note
Features
Create collaboration Create folder Create new note box with template Create tag name Download file Get Infomation folder Upload file
Get Key
By far the more flexible way to use Box Platform is through a Custom App integration.
Custom Apps support OAuth 2.0 authentication. They allow the application to manipulate files and folders, as well as interact with tasks, legal holds, and other enterprise-level properties.
To get OAuth 2.0 authentication, follow to guideline: https://github.com/taminhhienmor/node-red-contrib-box-note/blob/master/guidelineGetKey.docx
Usage
Create collaboration
Adds a collaboration for a single user/ muiltiple users to a file or folder.
Input Parameters:
-
Url Share - The url of folder/file want to share. The url on Box is taken from the node Name Folder property or the
msg.[name]
property -
Collaborator - The name for the collaborator. The name on Box is taken from the node Collaborator property or the
msg.collaborator
property -
Role - The level of access granted. Value is one of "editor", "viewer", "previewer", "uploader", "previewer uploader", "viewer uploader", "co-owner". The role collaborator is taken from the node Url Folder property or the
msg.[name]
property
Return values:
- payload Will either be link url created or provide an error state
[{"id":"6686abdc.2778d4","type":"inject","z":"1d3bdf8d.565df","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":680,"wires":[["d276bcee.dbf6c"]]},{"id":"251b4747.e93ca8","type":"debug","z":"1d3bdf8d.565df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":680,"wires":[]},{"id":"d276bcee.dbf6c","type":"createCollaboration","z":"1d3bdf8d.565df","box":"","property":"https://app.box.com/notes/640671630660","propertyType":"str","collaborator":"hien.taminh@mor.com.vn","role":"editor","x":440,"y":680,"wires":[["251b4747.e93ca8"]]}]
Create folder
Creates a new empty folder within the specified parent folder.
Input Parameters:
-
Name Folder - The name for the new folder. The name on Box is taken from the node Name Folder property or the
msg.nameFolder
property -
Url Folder - The parent folder to create the new folder within. The url folder on Box is taken from the node Url Folder property or the
msg.[name]
property
Return values:
- payload Will either be link url created or provide an error state
[{"id":"bf42b73.2a79948","type":"inject","z":"1d3bdf8d.565df","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":140,"wires":[["e2a22742.9d3208"]]},{"id":"af785146.3ad42","type":"debug","z":"1d3bdf8d.565df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":140,"wires":[]},{"id":"e2a22742.9d3208","type":"Create a Box Note","z":"1d3bdf8d.565df","box":"","filename":"Test Create Box","localFilename":"","urlTemplate":"https://app.box.com/notes/626406500456","property":"https://app.box.com/folder/108099161365","propertyType":"str","propertyTemplate":"https://app.box.com/notes/640664677053","propertyTypeTemplate":"str","x":460,"y":140,"wires":[["af785146.3ad42"]]}]
Create new note box with template
Create new note box with template.
Input Parameters:
-
Filename - The name for the new folder. The name on Box is taken from the node Filename property or the
msg.filename
property -
Url Template - The url of file template. The url template on Box is taken from the node Url Template property or the
msg.[name]
property -
Url Folder - The parent folder to create the new file within. The url folder on Box is taken from the node Url Folder property or the
msg.[name]
property
Return values:
- payload Will either be link url file created or provide an error state
[{"id":"bf42b73.2a79948","type":"inject","z":"1d3bdf8d.565df","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":140,"wires":[["e2a22742.9d3208"]]},{"id":"af785146.3ad42","type":"debug","z":"1d3bdf8d.565df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":140,"wires":[]},{"id":"e2a22742.9d3208","type":"Create a Box Note","z":"1d3bdf8d.565df","box":"","filename":"Test Create Box","localFilename":"","property":"https://app.box.com/folder/108099161365","propertyType":"str","propertyTemplate":"https://app.box.com/notes/640664677053","propertyTypeTemplate":"str","x":460,"y":140,"wires":[["af785146.3ad42"]]}]
Create tag name
The tags for this item. These tags are shown in the Box web app and mobile apps next to an item. There is a limit of 100 tags per item, and 10,000 unique tags per enterprise.
Input Parameters:
-
Url - The folder/file wants to add tag/tags name. The url folder on Box is taken from the node Url property or the
msg.[name]
property -
Tag - The name of tag. The name tag is taken from the node Tag property or the
msg.tag
property . The name is splited by comma in property node or created from array string in property
msg.tag
.
Return values:
- payload Will either be link url created tag or provide an error state
[{"id":"796a0baa.769a34","type":"inject","z":"1d3bdf8d.565df","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":420,"wires":[["ae1328fb.df8e98"]]},{"id":"a95f8ae.91a9a78","type":"debug","z":"1d3bdf8d.565df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":420,"wires":[]},{"id":"ae1328fb.df8e98","type":"createTagName","z":"1d3bdf8d.565df","box":"","property":"https://app.box.com/folder/108099161365","propertyType":"str","tag":"tag1, tag2","x":440,"y":420,"wires":[["a95f8ae.91a9a78"]]}]
Download file
Download file to local.
Input Parameters:
-
Url File - The file wants to download. The url file on Box is taken from the node Url File property or the
msg.[name]
property -
Filename - The name for the file that save in local. The name on Box is taken from the node Name Folder property or the
msg.nameFolder
property
Return values:
- payload Will either be success or provide an error state
[{"id":"9376c3d3.2c4a3","type":"inject","z":"1d3bdf8d.565df","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":257,"y":613,"wires":[["14124899.d6e477"]]},{"id":"6b5a95b2.92344c","type":"debug","z":"1d3bdf8d.565df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":677,"y":613,"wires":[]},{"id":"14124899.d6e477","type":"downloadFile","z":"1d3bdf8d.565df","box":"","property":"https://app.box.com/notes/640664677053","propertyType":"str","filename":"testDownload","x":460,"y":614,"wires":[["6b5a95b2.92344c"]]}]
Get Infomation folder
Retrieves details for a folder or folder contain, including the first 100 entries in the folder.
Input Parameters:
-
Url Folder - The folder wants to get information. The url folder on Box is taken from the node Url Folder property or the
msg.[name]
property -
Options - Choose details for a folder or folder contain. "True" value is Folder Content (default), "False" value is Folder Infomation. The option is taken from the node Options property or the
msg.option
property
Return values:
- payload Will either be details for a folder/folder contain or provide an error state
[{"id":"88a39dac.5b916","type":"inject","z":"1d3bdf8d.565df","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":340,"wires":[["9acb1530.fdf298"]]},{"id":"2531c2e4.71d41e","type":"debug","z":"1d3bdf8d.565df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":340,"wires":[]},{"id":"9acb1530.fdf298","type":"getInfoFolder","z":"1d3bdf8d.565df","box":"","property":"0","propertyType":"str","option":"true","x":440,"y":340,"wires":[["2531c2e4.71d41e"]]}]
Upload file
Uploads a small file to Box. For file sizes over 50MB we recommend using the Chunk Upload APIs.
Input Parameters:
-
Filename - The name for the file upload. The name on Box is taken from the node Filename property or the
msg.payload
property -
Local File - The name for file in local. The name on Local is taken from the node Local File property or the
msg.localFilename
property -
Url Folder - The folder want to upload the this file. The url folder on Box is taken from the node Url Folder property or the
msg.[name]
property
Return values:
- payload Will either be link url uploaded or provide an error state
[{"id":"5afbd652.ad3d78","type":"inject","z":"1d3bdf8d.565df","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":520,"wires":[["3ec03ba2.4773b4"]]},{"id":"20d2c8e2.58c9a8","type":"debug","z":"1d3bdf8d.565df","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":520,"wires":[]},{"id":"3ec03ba2.4773b4","type":"uploadFile","z":"1d3bdf8d.565df","box":"","filename":"testUpload","localFilename":"testDownload","property":"https://app.box.com/folder/108099161365","propertyType":"str","x":450,"y":520,"wires":[["20d2c8e2.58c9a8"]]}]
Reference
node-red-node-box