Action

Send to Dropbox Paper

Posted by agiletortoise, Last update over 5 years ago

Create Dropbox Paper document using content of the current draft. Assumes Markdown content format in draft.

Steps

  • script

    // setup content and format to use...
    let content = draft.content;
    let format = "markdown";
    
    // create Dropbox object and vars
    let db = Dropbox.create();
    let endpoint = "https://api.dropboxapi.com/2/paper/docs/create";
    let args = {
        "import_format": format
    };
    
    // make API request to create Paper doc
    let response = db.contentUploadRequest({
    	"url": endpoint,
    	"method": "POST",
    	"dropbox-api-args": args,
    	"data": content
    });
    
    if (response.statusCode != 200) {
    	console.log("Dropbox Error: " + response.statusCode + ", " + response.error);
    	context.fail();
    }
    else {
    	console.log("Dropbox Paper document created");
    }

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.