Title: Mastodon API Tester
Author: Alex Kirk
Published: January 4, 2024
Last modified: January 5, 2024

---

# Mastodon API Tester

January 4, 2024

tldr: Use the [Mastodon API Tester](https://akirk.github.io/mastodon-api-tester/)
to play with the Client API of Mastodon.

I’ve created the WordPress plugin called [Enable Mastodon Apps](https://wordpress.org/plugins/enable-mastodon-apps/)
which does a seemingly small but powerful thing: it enables you to access your WordPress
blog using Mastodon apps like [Tusky](https://github.com/tuskyapp/Tusky/) or [Ivory](https://tapbots.com/ivory/).
This can be used to browse your own blog and post to it. If you also have the [Friends plugin](https://wordpress.org/plugins/friends/)
and the [ActivityPub plugin](https://wordpress.org/plugins/activitypub/) installed,
this will actually make your WordPress blog behave like a Mastodon instance.

It does this be re-implementing the [Mastodon API](https://docs.joinmastodon.org/api/)(
unfortunately, Mastodon didn’t opt to implement the [ActivityPub client-server API](https://www.w3.org/TR/activitypub/#client-to-server-interactions)
so this is not based on a standard) which can be tricky: it uses REST API endpoints
in the (virtual) directories `/oauth` and `/api` which are so generic that they 
are prone to conflicts.

Additionally, although [the API is well documented](https://docs.joinmastodon.org/api/),
many apps were created based on assumptions that are true for Mastodon itself (which
caused a lot–sometimes hard to reproduce–of [issues for the plugin](https://docs.joinmastodon.org/api/)).
For example, the id of a post or a user is defined as a string but many apps crash
when you put a non-number there. Or that a boosted toot needs to have a different
id than the virtual “wrapping” toot (Ivory!). In such cases, apps would crash but
work fine with Mastodon itself.

Even more complicated are interactions with other WordPress plugins. It can be hard
to understand if the plugin is working correctly, if another plugin is interfering,
the hosting provider acts quirky, or if the Mastodon app has an incompatibilty with
my implementation.

Thus I have created a simple one-page JS app called [Mastodon API Tester](https://akirk.github.io/mastodon-api-tester/)
hosted on Github pages ([source on Github](https://github.com/akirk/mastodon-api-tester)):

[[

I hope that this tool will help identify issues better in future, it can also be
used with [GotoSocial](https://github.com/superseriousbusiness/gotosocial) or a “
real” [Mastodon](https://github.com/mastodon/mastodon/) instance. Feel free to [report issues](https://github.com/akirk/mastodon-api-tester)
you might encounter.

PS: the [Enable Mastodon Apps plugin will be worked on at the Cloudfest Hackathon](https://hackathon.cloudfest.com/project/enable-mastodon-apps-for-wordpress-and-its-plugins/),
thanks [Matthias Pfefferle](https://notiz.blog/) for taking the lead on this! (Unfortunately,
I cannot make it there because [I’ll be speaking at WordCamp Asia in Taipei](https://asia.wordcamp.org/2024/speakers/)
just the weekend before that.)

PPS: [Happy Birthday, Matt!](https://ma.tt/2024/01/birthday-gift/)

[Enable Mastodon Apps](https://alex.kirk.at/category/wordpress/enable-mastodon-apps/),
[Open Web](https://alex.kirk.at/category/open-web/), [WordPress](https://alex.kirk.at/category/wordpress/)

[Mastodon](https://alex.kirk.at/tag/mastodon/)

Read this next

[Prototype: Create a Website from a Screenshot and Refine It, All in the Browser](https://alex.kirk.at/2023/12/21/prototype-create-a-website-from-a-screenshot-and-refine-it-all-in-the-browser/)

### Leave a Reply 󠀁[Cancel reply](https://alex.kirk.at/2024/01/04/mastodon-api-tester/?output_format=md#respond)󠁿

Only people in [my network](https://alex.kirk.at/friends/) can comment.

This site uses Akismet to reduce spam. [Learn how your comment data is processed.](https://akismet.com/privacy/)