Open bclindner opened 5 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.
neeeeeeeeeeeeed!!!
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.
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 :)
@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:
/admin/account_moderation_notes
_session_id
and _mastodon_session
cookiesauthenticity_token
- this is a CSRF token that comes from the form, it changes every timeaccount_moderation_note[target_account_id]
which is set to the account the note should be added toaccount_moderation_note[content]
which is set to an encoded version of the note messagebutton
, which is set to ""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.
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
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.
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.