Skip to content

Publish Activity Works

given: "Alice" created an actor on "abel" called "Alice"

send.Alice.request.create_actor
{
  "base_url": "http://abel",
  "preferred_username": "Alice",
  "profile": {},
  "automatically_accept_followers": null,
  "name": null
}
receive.Alice.response.create_actor
{
  "attachment": null,
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "publicKey": {
    "id": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg#legacy-key-1",
    "owner": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwrYGP5c+gogETmYeN3lm\nniY2VK8p/a3qhJc8z+0mcWQYDcBtBkqU2sJ+CkQMBudnn2t+JQAVQSrSkQkRgG8I\nitLhj0jeu9h+spvwfxDQP48FJ9MiAnhoQbLBldNFtGrvkRyn4z3jkpA/HEVE4mpV\n7kASVlEGH0/U4Mmi0r1q/BXh8Z/UzAC5LUiZ4RWjs90agN7Om9KwFxbX0toB4pRa\nzrV/1OIUqwpCpyjmckodK0uXboYO5upYgW94JCsb7oJOeSvKeb88COa0OyOCfW2A\nEK2Gh4D40Pg77yBk3FtCs2KdbprceMdybRQN+1IHwTMimFJmI5sXU2Wo+O8HmNzA\nGQIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  "id": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
  "type": "Person",
  "inbox": "http://abel/inbox/wXxDEDxS8VBX4cOHk0WDGw",
  "outbox": "http://abel/outbox/axJ7BCsji-u1h1tfqsqv5g",
  "followers": "http://abel/followers/FAavvf0Bh1yCdjA4r07goQ",
  "following": "http://abel/following/VSiFV0wtbkBJeDE3D1B7mw",
  "preferredUsername": "Alice",
  "name": "Alice",
  "identifiers": [
    "acct:Alice@abel",
    "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
  ],
  "endpoints": {
    "sharedInbox": "http://abel/shared_inbox"
  }
}

given: "Bob" created an actor on "banach" called "Bob"

send.Bob.request.create_actor
{
  "base_url": "http://banach",
  "preferred_username": "Bob",
  "profile": {},
  "automatically_accept_followers": null,
  "name": null
}
receive.Bob.response.create_actor
{
  "attachment": null,
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "publicKey": {
    "id": "http://banach/actor/Mp4MZolxid3k50pxw89ipg#legacy-key-1",
    "owner": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6fyYZffJVWACcetVkDFP\n/O35M9JwCmMWsxDJqM8w7f0hoHp75qIhWmAkX/Ji7ZhP7u6VVASlcTVF6V8YBA8r\nNkj9Lu7qsk/ubeL9yMRQUuUny4CeRNVY4SDPavSfV91X061QKLPZeVBv0LdWP3LB\n4Rbf7vwXysywxzinus1DJTsVwk5o5/SUe3mlpm1kZ12oB+yVrLINcFUD0bBi4h3O\nGiooC9UMcEIGZz0jzlxc7alfI2SEOcb9vFSSJS1CdzMJpgHBTP/DSeHg6BuXc9Tg\nsu+E2vn74LYVAzwojwPduH4D8+NNjX2BtGuu5VLBnhA0yFj3uUdgzaU6R93sbcsq\n8wIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  "id": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
  "type": "Person",
  "inbox": "http://banach/inbox/nxcsmopoQQQc8xz5P2tUcg",
  "outbox": "http://banach/outbox/fAI4l1qpicLPLoSb_L5WOw",
  "followers": "http://banach/followers/Yf-Q5HzDggLSM7F8aEt5nA",
  "following": "http://banach/following/lxEa1ArPSbJ6Gv4xsQkwdg",
  "preferredUsername": "Bob",
  "name": "Bob",
  "identifiers": [
    "acct:Bob@banach",
    "http://banach/actor/Mp4MZolxid3k50pxw89ipg"
  ],
  "endpoints": {
    "sharedInbox": "http://banach/shared_inbox"
  }
}

when: "Bob" sends "Alice" a Follow Activity

send.Bob.trigger.send_message
{
  "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
  "data": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Follow",
    "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
    "to": [
      "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
    ],
    "id": "follow:d751d3bc-a454-4b69-a29a-bf1cbfa23138",
    "published": "2025-02-23T08:45:51Z",
    "object": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
  }
}
receive.Bob.outgoing
{
  "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
  "event_type": "outgoing",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Follow",
      "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
      "to": [
        "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
      ],
      "id": "follow:d751d3bc-a454-4b69-a29a-bf1cbfa23138",
      "published": "2025-02-23T08:45:51Z",
      "object": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
    },
    "recipients": {
      "recipients": [
        "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
      ],
      "public": false
    }
  }
}
receive.Alice.incoming
{
  "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
  "event_type": "incoming",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Follow",
      "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
      "to": [
        "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
      ],
      "id": "follow:d751d3bc-a454-4b69-a29a-bf1cbfa23138",
      "published": "2025-02-23T08:45:51Z",
      "object": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
    },
    "recipients": {
      "recipients": [
        "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg"
      ],
      "public": false
    }
  }
}

when: "Alice" sends an Accept to this Follow Activity

send.Alice.trigger.send_message
{
  "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
  "data": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Accept",
    "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
    "to": [
      "http://banach/actor/Mp4MZolxid3k50pxw89ipg"
    ],
    "published": "2025-02-23T08:45:51Z",
    "object": "follow:d751d3bc-a454-4b69-a29a-bf1cbfa23138",
    "id": "accept:153f8a39-d5dd-4e1a-b0a7-17e9aa2389e5"
  }
}
receive.Alice.outgoing
{
  "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
  "event_type": "outgoing",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Accept",
      "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
      "to": [
        "http://banach/actor/Mp4MZolxid3k50pxw89ipg"
      ],
      "published": "2025-02-23T08:45:51Z",
      "object": "follow:d751d3bc-a454-4b69-a29a-bf1cbfa23138",
      "id": "accept:153f8a39-d5dd-4e1a-b0a7-17e9aa2389e5"
    },
    "recipients": {
      "recipients": [
        "http://banach/actor/Mp4MZolxid3k50pxw89ipg"
      ],
      "public": false
    }
  }
}
receive.Bob.incoming
{
  "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
  "event_type": "incoming",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Accept",
      "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
      "to": [
        "http://banach/actor/Mp4MZolxid3k50pxw89ipg"
      ],
      "published": "2025-02-23T08:45:51Z",
      "object": "follow:d751d3bc-a454-4b69-a29a-bf1cbfa23138",
      "id": "accept:153f8a39-d5dd-4e1a-b0a7-17e9aa2389e5"
    },
    "recipients": {
      "recipients": [
        "http://banach/actor/Mp4MZolxid3k50pxw89ipg"
      ],
      "public": false
    }
  }
}

when: "Alice" publishes a "moo" animal sound to her follows

send.Alice.trigger.publish_activity
{
  "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
  "data": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "AnimalSound",
    "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
    "to": [
      "https://www.w3.org/ns/activitystreams#Public"
    ],
    "cc": [
      "http://abel/followers/FAavvf0Bh1yCdjA4r07goQ"
    ],
    "published": "2025-02-23T08:45:52Z",
    "content": "moo"
  }
}
receive.Alice.outgoing
{
  "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
  "event_type": "outgoing",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "AnimalSound",
      "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "cc": [
        "http://abel/followers/FAavvf0Bh1yCdjA4r07goQ"
      ],
      "published": "2025-02-23T08:45:52Z",
      "content": "moo",
      "id": "http://abel/simple_storage/019531fb-fb28-74e8-8df0-bd60bc58431b"
    },
    "recipients": {
      "recipients": [
        "https://www.w3.org/ns/activitystreams#Public",
        "http://abel/followers/FAavvf0Bh1yCdjA4r07goQ"
      ],
      "public": true
    }
  }
}
receive.Bob.incoming
{
  "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
  "event_type": "incoming",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "AnimalSound",
      "actor": "http://abel/actor/tlj9bp68yc_A8Wu7SktcKg",
      "to": [
        "https://www.w3.org/ns/activitystreams#Public"
      ],
      "cc": [
        "http://abel/followers/FAavvf0Bh1yCdjA4r07goQ"
      ],
      "published": "2025-02-23T08:45:52Z",
      "content": "moo",
      "id": "http://abel/simple_storage/019531fb-fb28-74e8-8df0-bd60bc58431b"
    },
    "recipients": {
      "recipients": [
        "https://www.w3.org/ns/activitystreams#Public",
        "http://abel/followers/FAavvf0Bh1yCdjA4r07goQ"
      ],
      "public": true
    }
  }
}

then: "Bob" receives an activity

then: the received activity is of type "AnimalSound"

then: "Bob" can retrieve the activity

send.Bob.request.fetch
{
  "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
  "uri": "http://abel/simple_storage/019531fb-fb28-74e8-8df0-bd60bc58431b"
}
receive.Bob.response.fetch
{
  "actor": "http://banach/actor/Mp4MZolxid3k50pxw89ipg",
  "uri": "http://abel/simple_storage/019531fb-fb28-74e8-8df0-bd60bc58431b",
  "data": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Tombstone",
    "id": "http://abel/simple_storage/019531fb-fb28-74e8-8df0-bd60bc58431b"
  }
}