The discussion revolves around programmatically calling the Merge Users plugin in Discourse using the API. mpemburn initially asks for help with the API call, and riking suggests using the browser developer tools to reverse-engineer the request.
mpemburn attempts to replicate the request in Postman, providing details on the method, endpoint, headers, and parameters used. However, they encounter a “not found” error. riking suggests checking if the target username exists, which mpemburn confirms is the case.
mpemburn also mentions that removing the headers results in an HTML page with a “page doesn’t exist or is private” message. Another user, artur, joins the discussion, seeking a solution to automate merging users via the API for their Discourse instance.
I started a topic yesterday (now closed) about calling the Merge Users plugin programmatically, and Rafael kindly referred me to the release notes, which feature a mention of the plugin now having a UI (Discourse 2.5.0.beta3 Release Notes). Sadly, my skills with the Discourse API are not such that I can translate this into an API call. This is something that we will need to do from our application on a fairly regular basis. Can you help me out, please?
Thanks for the tip! It took me a while to be able to create some users in my sandbox Discourse, but I was able to do so today. I took what I gleaned from the dev tools Network panel and attempted to duplicate it via Postman. These are the values:
Yes, both source and target are current users. If I remove the headers, I get back an HTML page that says “Oops! That page doesn’t exist or is private.” The “page doesn’t exist” part is understandable for a 404 error, but I’m not sure what “private” implies here.
I’m migrating some mailing lists to a discourse instance. Since many people used different emails the transfer creates many staged users per real person. I would like to automate the merging of users via the API.