Mailman3 People --
I am trying to manage subscriptions via the REST API. Most of my attempts at using the API work. For example, I can get the list of users: For example:
http GET request "http://localhost:8001/3.1/users" returns 200
However, attempting to get the "members" collection fails.
http GET request "http://localhost:8001/3.1/members" returns 400
The documentation here <https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/membership.html> suggests this should work. Any thoughts? Am I using the wrong URL to get the "members" collection?
I also tried using the domain URL/members, but that returned a 404 error code.
I've also tried posting a structure like this:
{ "list_id": "LISTNAME", "subscriber": "swd@pobox.com", "pre_verified": true, "pre_confirmed": true, "pre_Approved": true, "send_welcome_message": false, "delivery_mode": "regular", "delivery_status": "by_user" }
to the members collection, in an attempt to create a subscription. That got an error code 500
Thanks!
-- Stephen
My fault. After a lot of trial and error, I removed these two lines from my code:
req.Header.Add("Accept", "application/json") req.Header.Add("Content-Type", "application/json")
They are not needed. And now I can get the 'members' collection. Not sure why this messed up the get of members, but no other collection. Someone might care to make that consistent, but it is a small thing.
Thanks for reading this far!
-- Stephen
On Mon, Jan 17, 2022 at 10:40 AM Stephen Daniel <swd@pobox.com> wrote:
Mailman3 People --
I am trying to manage subscriptions via the REST API. Most of my attempts at using the API work. For example, I can get the list of users: For example:
http GET request "http://localhost:8001/3.1/users" returns 200
However, attempting to get the "members" collection fails.
http GET request "http://localhost:8001/3.1/members" returns 400
The documentation here <https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/membership.html> suggests this should work. Any thoughts? Am I using the wrong URL to get the "members" collection?
I also tried using the domain URL/members, but that returned a 404 error code.
I've also tried posting a structure like this:
{ "list_id": "LISTNAME", "subscriber": "swd@pobox.com", "pre_verified": true, "pre_confirmed": true, "pre_Approved": true, "send_welcome_message": false, "delivery_mode": "regular", "delivery_status": "by_user" }
to the members collection, in an attempt to create a subscription. That got an error code 500
Thanks!
-- Stephen
participants (1)
-
Stephen Daniel