Thank you for your response. I am sorry for getting confused
between two lists mailman-users and mailman-developers. Developers may be busy and my question may be basic but still there is a space for more politeness at your end to advice me.
Apart from that, you have given a lot much of useful
information which is really and honestly helpful for me to the maximum extent. Now I shall take the help of members of mailman-users only.
Team, I have installed Mailman Version 3.3 and running in
production. Our development team developed another application which requires the access of the REST API and do changes over the MM3 DB automatically without manual intervention. That application would be connecting to REST API over http or https protocol
To achieve this I have enabled the REST API to run at all the IP
addresses of my MM3 Server by editing the mailman/src/mailman/config/schema.cfg file. I was able to run few commands like creation of domains, lists, list configuration changes for testing using the CURL (GET, POST, PATCH, DELTE) and got succeeded.
But for every operation I need to write a different URL for CURL
command to work. Out of many operations I require, addition of members to a list and removal of members from a list are most important tasks.
So, I request herewith, from the URL
https://mailman.readthedocs.io/en/latest/src/mailman/rest/docs/rest.html, I could see many URLs but they are executed at python prompt (>>>) only. I require URLs usable at the CURL command. Is there any way I could generate the URLs or any where documented regarding the URLs usable with CURL for the addition and removal of subscribers ?
On Sat, Apr 25, 2020 at 8:04 PM Stephen J. Turnbull < email@example.com> wrote:
This whole thread is off-topic for the developers list. This list is for development of Mailman, not for teaching people to use it. Read the whole recommended documentation before you ask busy developers to tutor you in very basic things. There's a firstname.lastname@example.org list for users to help each other. All of the Mailman developers who might be willing to answer your questions are there as well, but there are also many experienced users, some of whom have experimented with the REST API who will also help. Please reply there for further help. (Reply-To is set.)
That said, there are plenty of URLs in the API documentation. Here's a hint: search for "dump_json". That function takes an URL. You may want https: instead of http: in your URLs, and you may need to change the port from 9001, depending on the configuration of your REST server. Try it with simple GET requests for information first, such as for domains or lists. You can also do these requests with an ordinary web browser, though I don't know what it will do with the JSON-formatted reply.
If you don't have domains and lists configured, I suppose the informational requests will come back as empty JSON objects. It should be safe to make them. You can either use Postorius to bootstrap a few example domains, lists, and users, or (the hard way) figure out how to POST appropriate requests. I don't recommend trying to update the backend DBMS by hand; the schema is quite complicated. I don't know how to use curl to update Mailman's databases. That requires a POST request which I have never done with curl. The POST request needs to be valid JSON.
The more I think about this, the less I think your idea of using curl is worthwhile, because formatting JSON requests by hand is going to be a real annoyance and a great way to mess up your database with spurious information. You're really going to want programmatic support for this. But that's already all available in Python in the Mailman system.
It's up to you, but I feel a responsibility to warn you that using curl is not going to be simpler than learning enough Python to do these things.