HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Delete discussion programmatically
What is the best way to do this?
Thanks
0
What is the best way to do this?
Thanks
Comments
Hi @rloyola
You will need a custom plugin for that.
I am not sure maybe the “Archive” function still exists in Vanilla. But I guess that is not what you want to achieve.
The cleanest way is to use the models methods:
DiscussionModel::instance()->deleteID
will do the trickMaybe you would like to use the Vanilla Forums API, in Python you would request a http
DELETE
using requests to `https://[yousite.com]/api/v2/discussions/[discussion_id]`I think (obviously) you will need the authorizations for the request to be accepted, I never tinkered with the api yet, but I think you can manage to do it with this example (or translate it to whichever language you use)
Also, for security reasons maybe you would like to configure your webserver to restrict requests only for you specific IP address.