The Dropbox paper JavaScript SDK is a lightweight, promise based interface to the Dropbox Paper api.
- Easy and simple to use.
- Returns Doc Name along when used doc list sdk method where dropbox api only returns array of doc ids.
$ npm install --save dropbox-paper
var dropboxpaper = require("dropbox-paper");
// pass your access token
var paper = new dropboxpaper({accessToken: "Your dropbox paper access token"});
This new version 1.1.0 contains two new method paper.docPolicySet() and paper.archiveDoc().
New update has been made in paper.listDocs() method, now you can also pass cursor in this method.
For more information have a go through.
$ npm update --save dropbox-paper
- paper.listDocs();
- paper.deleteDoc();
- paper.downloadDoc();
- paper.docUsersList();
- paper.docUsersAdd();
- paper.docPolicySet();
- paper.archiveDoc();
Since update of 1.1.0 this methods also accepts cursor value.
You can either pass limit with or with optional parameters see docs
Or a cursor value to retrieve docs from that cursor.
// Example
paper.listDocs({limit: 10})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Pass doc id to delete any particular doc.
This method will permanently delete the doc. see docs
// Example
paper.deleteDoc({doc_id: "atdn2KdIIiPYTPbBEjk5a"})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Pass doc id and export format. Export format must be "makrdown" or "html".
Downloads doc in current folder.
For more information see docs
// Example
// Recommends to specify "filename" to download doc. If filename is not pass default downloads it with name "download".
paper.downloadDoc({doc_id: "y5JzeuQrJBJlNHTfjlk2L", export_format: "markdown", filename: "my doc"})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Pass doc id to see users of that doc.
For optional parameters see docs
// Example
paper.docUsersList({doc_id: "y5JuezQrJBJNhlTfjlk2L"})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Pass doc id and members to add any user to the doc.
For more information see docs
// Example
paper.docUsersAdd({"doc_id":"zYsQe7JGywV77Onbt2UJO","members":[{"member":{".tag":"email","email":"user email"},"permission_level":{".tag":"edit"}}]})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Currently only supports public_sharing_policy.
Pass doc id on which you want to set policy.
For more information see docs
// Example
paper.docPolicySet({"doc_id":"P6evXjsBzf0l0ZZrbYVlf","sharing_policy":{"public_sharing_policy":{".tag":"people_with_link_can_view_and_comment"}}})
.then(function(result) {
console.log(result);
}).catch(function(error) {
console.log(error);
})
Pass doc id of doc you want to archive.
// Example
paper.archiveDoc({doc_id: "y5JzeuLkuBJNhlTfjXr2L"})
.then(function(result) {
console.log(result);
}).catch(function(error) {
console.log(error);
})