mastodon / mastodon

Your self-hosted, globally interconnected microblogging community
https://joinmastodon.org
GNU Affero General Public License v3.0
46.71k stars 6.89k forks source link

Moderation API: create/read/update/delete notes in reports #11399

Open bclindner opened 5 years ago

bclindner commented 5 years ago

Pitch

The current Moderation API implementation appears to be missing one major part of the moderation API - notes. Ideally, /api/v1/admin/reports and /api/v1/admin/reports/:id should return a list of report notes, and some POST/PUT facility should be added to allow adding, editing, and deleting notes.

Motivation

We use notes extensively when moderating mastodon.technology, and I'm sure we're not alone. Apps and other tools will likely want to provide an interface for these as a result. My automoderation tool in particular uses notes to log what an automated action was taken for.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ykzts commented 4 years ago

neeeeeeeeeeeeed!!!

teknetia commented 4 years ago

I'd also be keen to see the admin APIs, especially for moderation functions, be better fleshed out so we can linked it to email replies in our suppler system and the like as well as there isn't an on-platform way for users to respond to an action.

tubia commented 3 years ago

I agree, this is very much needed.

Hey @bclindner what is the automodoeration tool you mentioned in the first post? That would be really interesting to develop :)

isosphere commented 1 year ago

@bclindner

My automoderation tool in particular uses notes to log what an automated action was taken for.

Could you share how you're handling this with your automoderation tool? I am currently developing my own and want to automatically add notes to a user's account, and the API seems to not provide for that. Are you constructing HTTP requests? Is authentication a pain for that?

Reviewing the HTTP request myself, here's what I can gather:

The POST parameters do not appear to be sufficient for adding a note (returns 422 Unprocessable Entity), it looks like you might need a valid cookie too.

bclindner commented 1 year ago

Code's at https://github.com/bclindner/ivory - I don't maintain it much anymore since I left my position as admin at mastodon.technology (RIP) but it should still do the job. Forks welcome at this point, I'm probably going to archive it soon

ThisIsMissEm commented 5 days ago

Implementation Note: For adding/managing reports notes via the API, use the route /api/v1/admin/reports/:id/notes instead of a top-level report_notes (the moderation UI did it this way for legacy reasons).

I'm not sure GET /api/v1/admin/reports/:id should return the notes in their entirety, however, it may make sense to include pagination and summary info, so like return the URL to the report notes and how many notes exist on a report.

@renchap thoughts on marking this as api and good first issue or help wanted — I'd be happy to guide and review work by a developer wanting to implement this.