Does Joplin Server have the API

We are trying to integrate with Joplin to have our notes trigger automation in NodeRed to save Web Clipper & Notes into our redmine project management systems.

Since Zapier is not supported we are focusing on the API, but don't really want to install NodeRed on the local computers so I'm wondering if Joplin Server has the API built-in so we can have NodeRed integrated with Joplin Server?

If the API is not in the Server, would a workaround be to run an instance of Joplin Client on our server and have it sync with Joplin Server installed on the same localhost with the Client? Once this was working, we should be able to access the API on the localhost.

joplin cli should be installed on the server side, at least it contains data api

@rxliuli Hmmm, I'm not sure how the CLI would be useful to collect the note information and pass it to another software API programatically. Am I missing something?

@laurent @florider I know you guys are busy and contribute so much time already, but I would like to see if you can help wth this project that I have been trying to complete for months to replace EverNote & Zapier. I'm really getting to the point I seems easier to go back to the Evernote/Zapier solution, but would prefer to support Joplin.

I personally do not find much real use case scenarios for using the Joplin App itself. Often times the last thing we need is yet another application to maintain data in. It is not like I'm constantly in Joplin editing notes and I'm curious how many people do actually use the Joplin App for editing and maintenance vs those who just use the Web Clipper to collect research from the internet.

The main benefit that I see is useful to people is the collection of notes using the Web Clipper, but the data gets stuck in Joplin App. Nothing is really actionable once in Joplin so the workflow stops.

I feel the data is more useful when it can be imported into existing applications that are more mature for project management and taking action.

Would you guys be able to offer advice how we can ultimately get Web Clipper Notes into our project management system programmatically?

joplin is currently known as a very open note-taking application

1 Like

The CLI tool allows note access via an API. This would be the same as the workaround that you proposed in your first message, but the CLI is a lighter client then the desktop version.

From what I've observed (of forum users), the majority use Joplin as a note taking app primarily. Although for a decent chunk of users, web clipping is a core part of note taking. I'd say your use case is likely on the rarer side (you're the first I've seen) since it's not a workflow that Joplin was really designed for. You might find that a purpose-built tool like wallabag is easier to fit in to your workflow.

1 Like

@rxliuli Awww, that looks good... I guess my question comes back to how to access the API but not on the local client PC.

This is where I'm trying to figure out how to access the API.

@CalebJohn Thanks for your clarification.

I did look at Wallabag and it seems to be a less active project, and I fear a little over simplified, but I'll give it more consideration for sure.

There's a set of Node-RED nodes (node-red-contrib-joplin) that use the Joplin API to enable search, update, delete, get attachment, get, getby parent, and create. I've dabbled in using it to enable Home Assistant to "self-document" it's configuration and/or state information about my home in Joplin. To me, the integration of Node-RED and Joplin creates some amazing capabilities.

Using the nodes, you can access the API of the Joplin instance running on a different machine. Joplin's API has a security "feature" that only allows access from the same machine, but you can work around that by using a proxy to mirror the API requests received from a remote machine so they appear to the API as a local request.

Here are my notes on the procedure that I used, if it's any use:

Install node-red-joplin-contrib Nodes to the Node-RED Pallette

  1. Launch Node Red
  2. From the menu, select Manage Pallette
  3. Select the Install tab
  4. In the Search Modules field, enter node-red-contrib-joplin
  5. Click Install

Configure the Joplin Data API

  1. In Joplin, Tools - Options - Web Clipper
  2. If not already activated, activate the Web Clipper Service as it is required for the Jopln Data API to run.
  3. In the Web Clipper configuration section, copy your Authorization Token as it will be required to configure the Joplin Configuration node in Node-RED.

Configure Access to the Joplin Data API

The Joplin Data API listens on port 41184, but it only binds to 127.0.0.1 to accept traffic from the localhost only. Requests originating from other hosts will be refused. To circumvent this "security feature", implement a port proxy on the system hosting Joplin. The port proxy will listen for requests on a port other than 41184 from hosts other than the localhost and will retransmit the request to 41184 on the localhost.

For Windows 10, the built-in command, netsh, can perform this function.

  1. To activate a port proxy to listen for requests from any host on port 41185 and retransmit them to 41184 on the localhost, execute the following command
 netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=41185 connectaddress=127.0.0.1 connectport=41184
  1. Open port 41185 on the firewall, if present. If using the built-in Windows Defender, this can be accomplished one of two ways:
    1. Use netsh to add a new firewall rule: netsh advfirewall firewall add rule name="Open Port 41185" dir=in action=allow protocol=TCP localport=41185

    2. On modern Windows machines, this can also be done via PowerShell commands: New-NetFirewallRule -Name JoplinAPI -DisplayName "JoplinAPI 41185" -Direction Inbound -Protocol tcp -LocalPort 41185 -Action Allow -Enabled True

To deactivate the port proxy:

  1. Execute the following command
    netsh interface portproxy reset
    
  2. To close the previously opened firewall port either:
    1. Remove the firewall rule using netsh: netsh advfirewall firewall del rule name="Open Port 41185"
    2. Remove the firewall rule using PowerShell: Remove-NetFirewallRule -Name JoplinAPI 41185

I've been thinking about the same thing. I would like to be able to use any method (emacs, vim, cat) to create a note and then "push" that note to the server. I don't really want to have to install all the NPM stuff just to run the joplin terminal to get access to the cli...

If there was just documentation on the server API I could write some very simple linux tools to interact directly with the server and then the various Joplin Apps could sync with the new data on the server.

I don't think a 'simple tool' is really possible, in general.

Joplin Server supports End-to-end encryption. So in a common usage scenario, the server doesn't see the contents of the notes at all.
That of course means you'd then have to have more APIs to fetch the decryption keys, your app would have to download the encrypted resources and decrypt them, encrypt them before sending them back, etc.

I assume y'all want an API that would do things like 'add this note', 'scrape that URL' (and I get it, I use it the same way, locally.)
But for these reasons, I don't think it's going to be added anytime soon.
Granted, I'm not a dev, so I might be wrong. But unless Laurent comes out to say it's coming, I wouldn't hold my breath.


Post script: you might argue that in your specific case, you're not using E2EE. In that case, you might be able to cobble together your own API that interacts with the server's DB directly, reading/writing contents in the items table. But it won't be simple, and you'd have to take care not to break anything related to syncing....

2 Likes