Posting to Pleroma inbox

HTTP Signatures are for servers. Also the endpoint you want to use is /users/:nickname/outbox.

Here is a working setup with curl that I use for some real-life tests:

In create_note.json:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "type": "Create",
  "to": [
    "https://www.w3.org/ns/activitystreams#Public",
    "https://queer.hacktivis.me/users/lanodan/followers"
  ],
  "actor": "https://queer.hacktivis.me/users/lanodan",
  "object": {
    "attributedTo": "https://queer.hacktivis.me/users/lanodan",
    "type": "Note",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public",
      "https://queer.hacktivis.me/users/lanodan/followers"
    ],
    "content": "Dayum~"
  }
}

curl -v -XPOST -H 'Content-Type: application/activity+json' -d @create_note.json -u "lanodan:$(pass show queer.hacktivis.me/lanodan)" https://queer.hacktivis.me/users/lanodan/outbox | tee create_note_response.json

Notes:

  • I am using HTTP Basic Auth via -u here, and OAuth is also possible, just a bit harder to do (tested it via curl scripts as well).
  • I grab my password via my pass(1) storage you can also consider it the same as $REDACTED
2 Likes