I know that servers communicate by POSTing to an inbox and outbox. But what's the URL for the inbox and outbox?
The URL is whatever the implementing server says it is. So it's different for each ActivityPub server.
The inbox and outbox URL for an actor is defined in the JSON-LD document for an actor:
{
"@context": ["https://www.w3.org/ns/activitystreams",
{"@language": "ja"}],
"type": "Person",
"id": "https://kenzoishii.example.com/",
// Right here!
"inbox": "https://kenzoishii.example.com/inbox.json",
"outbox": "https://kenzoishii.example.com/feed.json",
...
}
This also means that the inbox and outbox can be actor-specific, not just server specific.
Some ActivityPub sites like Mastodon make use of Webfinger to standardize a URL that can be used to get an actor's JSON-LD doc:
/.well-known/webfinger?resource=acct:[email protected]
In this case, if you wanted to know the inbox for [email protected]
, you would first query the webfinger:
GET https://mastodon.technology/.well-known/webfinger?resource=acct:[email protected]
That would give you a JSON object like this:
{
subject: "acct:[email protected]",
links: [
{
rel: "self",
type: "application/activity+json",
href: "https://mastodon.technology/users/Flaque"
}
]
}
With that href: https://mastodon.technology/users/Flaque
, you can get the JSON representation with:
https://mastodon.technology/users/Flaque.json
(Note the .json
!)
That would then give you a full actor object, which would include the inbox
and outbox
:
{
"inbox": "https://mastodon.technology/users/Flaque/inbox",
"outbox": "https://mastodon.technology/users/Flaque/outbox",
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With