If you follow and/or curate a tag long enough, you'll probably notice that there's some questions that just get asked over and over. Usually these are confusing aspects of some commonly used feature that newbies keep tripping over.
Having a gold tag badge, after I close these repeated duplicates, I also proceed to edit the duplicate list with more similar Q&As that are relevant to the issue1. For several very common duplicates, I often find myself editing the same duplicate list in every time. This is a repetitive and time-consuming task. I would like to automate it instead.
I would like to make an API call to cast a close vote as duplicate with a list of duplicate targets.
I'm aware of the API /questions/{id}/flags/add
which can be used to cast close votes, however it's not clear to me how duplicate closure happens in this case. Where do I set the ID of the dupe target? There are examples in the options page but I don't understand how the available "Duplicate Free Form" and "Duplicate Pre-Filled" relate to my goal. Also testing the API requires an API key, which I don't have.
I also tried inspecting the network activity when closing a dupe from the GUI, though the endpoint used is different: /flags/questions/{id}/close/add
. However this does have a closeReasonId: Duplicate
and duplicateOfQuestionId: {id}
form fields which look closer to my goal.
Can I call the internal endpoints in a userscript, with an array of (comma-separated?) items in duplicateOfQuestionId
? Or is there a way to accomplish this with the public API and some flag option?
Footnotes:
1: One could argue that if those dupe targets consistently appear together in dupe lists, they are also dupes of each other and therefore should be merged. This may or may not be true, but it's beside the point.