Package Exports
- dropbox-paper
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dropbox-paper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
dropbox-paper sdk
The Dropbox paper JavaScript SDK is a lightweight, promise based interface to the Dropbox Paper api.
Why Dropbox Paper sdk
- Easy and simple to use.
- Returns Doc Name along when used doc list sdk method where dropbox api only returns array of doc ids.
Quickstart
$ npm install --save dropbox-paper
var dropboxpaper = require("dropbox-paper");
// pass your access token
var paper = new dropboxpaper({accessToken: "Your dropbox paper access token"});
Available Methods
- paper.listDocs();
- paper.deleteDoc();
- paper.downloadDoc();
- paper.docUsersList();
- paper.docUsersAdd();
List Docs
This method accepts limit. The number of Docs you want to retrieve.
For optional parameters list see docs
paper.listDocs({limit: 10})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Delete Doc
Pass doc id to delete any particular doc.
This method will permanently delete the doc. see docs
paper.deleteDoc({doc_id: "atdn2KdIIiTyPPbBEjk5a"})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Download Doc
Pass doc id and export format. Export format must be "makrdown" or "html".
Downloads doc in current folder.
For more information see docs
// Recommends to specify "filename" to download doc. If filename is not pass default downloads it with name "download".
paper.downloadDoc({doc_id: "y5JzeuQrJBJNhlTfjlk2L", export_format: "markdown", filename: "my doc"})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Doc Users List
Pass doc id to see users of that doc.
For optional parameters see docs
paper.docUsersList({doc_id: "y5JzeuQrJBJNhlTfjlk2L"})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});
Doc Users Add
Pass doc id and members to add any user to the doc.
For more information see docs
paper.docUsersList({"doc_id":"zYsQe7JwyGV77Onbt2UJO","members":[{"member":{".tag":"email","email":"user email"},"permission_level":{".tag":"edit"}}]})
.then(function(result){
console.log(result);
})
.catch(function(error){
console.log(error);
});