I’m trying to make a shortcut to help me post reviews to my site. I’ve got some raw json that should work via the Micropub API but consistently fails with a message that there was no content. Has anyone got an example of a working iOS shortcut that lets me create a post with more than one category? Or perhaps point me to the right documentation that would have this info? As far as I recall, ℹ️ Posting API does not seem to cover that scenario.
That help page really only has the very basics for posting, and it doesn’t include a JSON example. JSON in Micropub is a little more verbose, often using arrays. There are some more examples in this chapter of my book, including how to set a category: Micropub · Indie Microblogging
The “no content” error basically means Micro.blog isn’t understanding the fields you are sending, so it’s not seeing the content or photos or anything.
Using JSON, the HTTP POST should look like this:
POST /micropub
Authorization: Bearer 123456789
Content-Type: application/json
{
"type": [ "h-entry" ],
"properties": {
"content": [ "Hello world." ],
"category": [ "Category 1", "Category 2" ]
}
}
Let us know if that doesn’t work.
1 Like
I was using the arrays, but I was doing it incorrectly in the shortcut. I missed adding the content as an array so it kept failing.
Thanks for the link to the book as well! I’m so glad micro.blog exists.
Thank you!