Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bclindner opened this issue Jul 23, 2019 · 6 comments
Open

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

bclindner opened this issue Jul 23, 2019 · 6 comments
Labels
suggestion Feature suggestion

Comments

@bclindner
Copy link
Contributor

bclindner commented Jul 23, 2019

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.

@Gargron Gargron added the suggestion Feature suggestion label Aug 5, 2019
@stale
Copy link

stale bot commented Oct 26, 2019

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.

@stale stale bot added the status/wontfix This will not be worked on label Oct 26, 2019
@ykzts
Copy link
Sponsor Member

ykzts commented Oct 26, 2019

neeeeeeeeeeeeed!!!

@stale stale bot removed the status/wontfix This will not be worked on label Oct 26, 2019
@teknetia
Copy link

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
Copy link

tubia commented Dec 10, 2020

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
Copy link

isosphere commented Nov 6, 2022

@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:

  • Adding a note is a POST request to /admin/account_moderation_notes
  • The request includes _session_id and _mastodon_session cookies
  • Request parameters include:
    • authenticity_token - this is a CSRF token that comes from the form, it changes every time
    • account_moderation_note[target_account_id] which is set to the account the note should be added to
    • account_moderation_note[content] which is set to an encoded version of the note message
    • button, 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.

@bclindner
Copy link
Contributor Author

bclindner commented Nov 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

6 participants