A client library for Mastodon instances.
This is a client library implementing the full v1 REST API protocol for Mastodon.
Before you start, you'll need an account on some Mastodon instance. For the purposes of this documentation we'll simply pick mastodon.social. Once you've got Tooter loaded you'll first need to create a
(defvar *client* (make-instance 'tooter:client
:name "My Tooter Test App"))
Once you have a client set up, you need to authorise it against your account so that you can make requests on your behalf.
This will return an URL as its secondary value. Visit this URL in your browser, click on the authorize button, and copy the code it displays. Then call
authorize again using this code.
(tooter:authorize *client* "...")
If everything goes well this should return a fully authorised client instance.
From here on out you can make use of the full API Mastodon API. See the definition index below.
(tooter:make-status *client* "Tooter works, woah nelly!")
Persisting Client Settings
Once you have authorised your client, you will probably want to save the information somewhere so that the user doesn't need to re-authorise every time. To do this, simply save the
access-token values from the client instance. If those are set, the
authorize steps are not needed.
Writing an Application Library
If you write an application on top of Mastodon and would like to offer this as another re-usable library, you should create a subclass of
client that automatically provides the proper initargs for the
:name and so forth. This ensures that your application is known under the correct name, but still lets the user specify the correct