2

I am trying to use the REST api for Mailman3. I have installed the Mailman Bundler using the directions from here. And I'm following the instructions found here.

I have Postorius and HyperKitty running flawlessly. I have made a test mailing list using the UI located at localhost:8000.

From wiki.list.org/Mailman3 while speaking of the mailman client:

The official Python 2 and 3 bindings to the administrative REST API. Used by Postorius and HyperKitty, this provides a convenient, object-based API for programmatic access to the Core

Since my Postorius and HyperKitty are running and able to create lists, I know everything is installed and running correctly. The error is on my end, obviously.

When I try to access: localhost:9001/3.0/lists like stated on the pythonhosted site ( link is in my first paragraph ), I get an error in my browser saying:

The server localhost refused to allow this computer to make a connection.

I'm expecting to be returning JSON to the screen here. I've tried this in google's 'Postman' app, which is just an app that is used for testing REST api's requests and other GET/POST requests and I get a very similar error saying:

This seems to be an error connecting to http://localhost:9001/3.0/lists

Is there a step I'm missing? Maybe a step that is similar to starting the web interface/UI, but instead of starting the UI I initialize access and the ability to return data from port 9001?

For what it's worth. I intend to call this REST api from PHP using cURL. Connecting to the REST api is the final step in this whole setup, so I'd love to put the setup aside and move forward.

I'm partially python illiterate. Thanks for the help in advance.

2 Answers2

2

Despite what this documentation said, the port for the API is 8001 and you use basic auth to log in. Personally I used cURL to connect to the API.

0

Here's how to test mailman3 REST API on Debian:

eval $(grep REST_API /etc/mailman3/mailman-web.py |sed 's/ = /=/')
curl --user $MAILMAN_REST_API_USER:$MAILMAN_REST_API_PASS http://localhost:8001/3.0/system/versions

Or alternatively:

$ /usr/share/mailman3-web/manage.py mmclient
>>> client.system