Send to Raindrop

Posted by Joshua Oliphant, Last update 5 months ago

This action allows you to send a Draft to Raindrop, a bookmark manager. It uses the same title for the bookmark title, and gets the first (assuming only) link as the link to bookmark.


  • script

    // Create a Raindrop credential
    let raindropCredential = Credential.create("", "Enter your API token.");
    raindropCredential.addTextField("token", "API Token");
    // Authorize the credential to prompt the user for input
    // Get the API token from the credential
    let token = raindropCredential.getValue("token");
    // Check if the token is available
    if (!token) {
        console.log("Error: Raindrop token not found. Please enter your API token.");;
    } else {
        let link = draft.processTemplate("[[body]]"); // Use the body content of the current draft as the link
        // Remove leading and trailing whitespace from the link, including newline characters
        link = link.trim();
        let title = draft.processTemplate("[[title]]");
        title = title.replace(/^#\s+/, '');
        // Create HTTP client
        let http = HTTP.create();
        // Define headers and payload
        const headers = { "Authorization": `Bearer ${token}` };
        const raindrop = {
            "link": link,
            "title": title
        // Log the raindrop
        console.log(`Posting raindrop: ${JSON.stringify(raindrop)}`);
        // Make the HTTP request
            "url": "",
            "method": "POST",
            "headers": headers,
            "data": raindrop,
            "timeout": 10000, // Adjust the timeout as needed
            "callback": function (error, response) {
                if (error) {
                    console.error("Error posting raindrop:", error);
                // Check if the response status is not 200
                if (response.statusCode !== 200) {
                    console.log(`Error posting raindrop: ${response.statusCode} ${response.error}`);
                console.log(`Raindrop posted: ${response.body}`);


  • 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.