Chapter 3. The ActivityPub API

Now that you know all the ways to structure social-network data, it’s time to start using it. In this chapter, I’ll show you how to use the ActivityPub API, the social-network API defined in ActivityPub.

It’s a strange tradition that when authors introduce a new API, they feel the need to expand the acronym to its full definition, application programming interface, as if that would explain what an API is and does. I find this unhelpful but also cannot resist repeating it here.

An API is an interface that lets programs outside the main server create, read, and change objects inside the service. The programs, or apps, or applications (see?) can be the official mobile apps for the service, or they may be created by developers working for other companies, volunteers, hobbyists, or what have you. An API is a model of how the internals of the server work, but it’s also a set of permissions, defining what external programs can and can’t do.

The ActivityPub API is a web API. That means you can interact with ActivityPub servers over the internet, using HTTP as the transport protocol. If your device has access to the web (whether via a laptop, a phone, or a toaster), it can access ActivityPub servers by using the ActivityPub API.

ActivityPub is a RESTful API. REST is a term that comes from Roy Fielding’s 2000 PhD thesis about the architecture of the web. In case you don’t have it on your bedside table, REST stands for Representational State Transfer (though ...

Get ActivityPub now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.