KM to trigger sending URL bookmark to Raindrop

I want to be able to send a bookmark URL to Raindrop (via Raindrop APO) by using KM.

Here it says the API is dandy but no examples of code whatsoever.

If I understand right, the API requires authentication even to send (POST) data... which kind of makes sense.. but it requires a properly formatted script.

GPT gave this result... (attached).

I looked at the support files in Raindrop but I am not very clear how to structure the JS code.

The Raindrop chrome extension seems to me also fails short here, I don't need to send the whole page, just need to be able to send the URL/Name.

PICTURE REMOVED

Just can't really use JavaScript from Keyboard Maestro like that, because it's outside the web page.

You could use JXA, but you can also just use curl as shown in the Raindrop API, eg:

curl -X "POST" "https://raindrop.io/oauth/access_token" \
     -H 'Content-Type: application/json' \
     -d $'{
  "code": "c8983220-1cca-4626-a19d-801a6aae003c",
  "client_id": "5e1c589cf6f48c0211311383",
  "redirect_uri": "https://oauthdebugger.com/debug",
  "client_secret": "c3363988-9d27-4bc6-a0ae-d126ce78dc09",
  "grant_type": "authorization_code"
}'
2 Likes

If that entails using their developer API then

registering an application
using "Oauth"

look like hurdles.

Please note that you must register your application and authenticate with OAuth when making requests. Before doing so, be sure to read our Terms & Guidelines to learn how the API may be used.


FWIW screenshots of approximate retrievals from GPT do use up bandwidth in this forum but don't have a good prospect of shedding light โ€“ anyone here in possession of the relevant concepts and experience would, of course, be able to make their own use of search tools.

(As it happens, the snippets composed by approximate retrieval in that screenshot are for Node.js โ€“ a bit off-target for Keyboard Maestro, unless you want to start grappling with browserify - npm)

I'm not familiar with raindrop, but if it's like any other web app with an API "registering your app" is usually a fairly easy process done via some developer portal. Typically you would 'create' an app, and then they give you a URL to hit, which then prompts you to authenticate. That exchange usually gets you a 'token' which you can use to authenticate subsequent API requests.

And, as @peternlewis said, those can be simple curl commands.

2 Likes

Removed that GPT screenshot.

I have no clue of programming but I looked now what I have for another KM flow from Airtable website, I see yes, now what you mean. Not being a programmer I couldn't even tell it's apples and bananas, ha-ha.

@peternlewis Thank you.

So I went here Raindrop.io and created an app under developers. That gave me the cliend_id and the secret and also I got the Test Token now.

image

Now, what?
Do I go to reqbin website? That is what I used before to test Airtable API.

Do I go and enter this in this box?

I tried to type out my client ID in the format they asking {"key": "value"} . .. there but it gave me red underline for error formatting

Do I entere there the two lines?


redirect_url
client_id

Or this?

Sorry, these are stupid questions so hope not too much annoying, I am sure you rolling your eyes there already LOL.

Try getting it working in the Terminal.

I suggest you create a new folder, create a plain text file using BBEdit with the JSON data as described in the API, including your client id and token stuff, and whatever you are trying to do, and then in the Terminal, cd to that folder and do something like:

curl -X "POST" "https://raindrop.io/whatever/url" -H 'Content-Type: application/json' -d @filename.json

Then once you get that working in the Terminal you can start looking at automating it.

You might have better luck getting support for using the raindrop API on the raidrop.io sub-reddit
https://www.reddit.com/r/raindropio/

1 Like

I came across a plugin for Alfred launcher. That works nicely for creating bookmarks in Raindrop. This is unexpected so I think I am going drop the KM way of doing it.

It does also require a manual copy past of the URL, but that's okay for me, I don't save too many.

It also allows searching for bookmarks and launching them.