As I’m getting back into reading, keeping track of books in micro.blog bookshelves has been useful.
I added a micro.blog connector into sync.crosspointreader.com which will add books to currently reading or finished bookshelves (moving them from want to read / currently reading if appropriate).
The upcoming crosspoint release will include “clippings” - the ability to save highlights from a book. These will get sync’d to crosspoint sync as well… so naturally, I’d like to sync them to micro.blog’s highlights. However, I can’t find an API to create highlights, only to read and delete them?
Sounds cool! There’s not a documented API for creating highlights yet. I was worried that because it uses offsets into the text of the post, it would be fragile and just be annoying to work with.
But if you want to use it anyway, this is what Micro.blog currently does when creating highlights. There are actually two flavors: one for bookmarked posts, and one for posts in Inkwell. I’ll assume you mean bookmarks, so it looks like this.
You’ll need the “link ID”, which you can find in one of two authenticated JSON Feeds:
GET /posts/bookmarks GET /posts/bookmarks/links
Then to create a highlight:
POST /bookmarks/{link_id}/highlights
And pass 3 parameters as either JSON or form-encoded fields: