So other clients can be used!

Should live in a separate module. This shouldn't be enabled by default.

Uses rest resources to expose the endpoints.

Docs:
https://www.drupal.org/docs/drupal-apis/restful-web-services-api/restful...
https://docs.joinmastodon.org/client/public/#endpoints

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

swentel created an issue. See original summary.

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

Adds initial Mastodon-compatible API endpoints (`/api/v1/instance`, `/api/v1/accounts/verify_credentials`, `/api/v1/timelines/home`, `/api/v1/timelines/public`, `/api/v1/notifications`) so third-party Mastodon clients can connect to the Drupal ActivityPub instance. This is a starting point; additional endpoints (posting statuses, OAuth2 auth) can be added in follow-up issues.

swentel’s picture

Cool! One thing I've been wondering: is it possible to have discovery regarding the api endpoints? By which I mean: when you would connect with a (mobile) client where you enter the instance url, would we be able to tell 'ok, all endpoints are available at /route/x/whatever'.

The idea is that, for some reason, I'd rather would have a base path, e.g. example.com/activitypub/api instead of just example.com/api.

Not sure if that's an option, but would be nice I think.

swentel’s picture

Issue summary: View changes
swentel’s picture

Note: Should live in a separate module. This shouldn't be enabled by default. Updated the IS for that. Not sure if there's an existing library out there that would help us in some way, but that's something I haven't investigated yet.

swentel’s picture

Status: Needs review » Needs work
aleix’s picture

I second the separate module, I have started to make mastodon apps happy with us too, and found that it will make the module too much opinionated. I end up seeing that there must be a place for simplistic c2s compliant apps too (namely andstatus by now). I am on the way to provide this if I finally get funding.

swentel’s picture

Assigned: Unassigned » swentel
swentel’s picture

Status: Needs work » Active

Working on this now

swentel’s picture

Issue summary: View changes
swentel’s picture

Title: Add an API endpoint » Add a Mastodon-compatible API endpoint
swentel’s picture

Title: Add a Mastodon-compatible API endpoint » Add a Mastodon-compatible API module
swentel’s picture

Issue summary: View changes
swentel’s picture

Issue summary: View changes

swentel’s picture

Status: Active » Fixed

Version 1 is committed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

swentel’s picture

Component: Code » Api

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.