Configure new list via REST API - trying to add moderators
I'm stepping into some existing code which creates a new list via the REST API. I know this works because I can shell into the mailman3 box and run mailman lists
and it shows the newly created list. We're also submitting list config options via the /lists/<list id>/config
endpoint, but there's a specific key that we have in our config map that doesn't appear in the REST API docs and I'm wondering about it. We have an array of strings called moderator
that appears to send successfully. But looking at the docs for "Mailing list configuration" (https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/l...) I don't see anything named moderator
The "Managing owners and moderators" docs (https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/commands/do...) indicate that we can perform add owners and moderators via a Python shell, but don't indicate that it's possible to do it via REST. Is this true?
On 9/11/24 11:47, Andy Matthews wrote:
But looking at the docs for "Mailing list configuration" (https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/l...) I don't see anything named
moderator
The "Managing owners and moderators" docs (https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/commands/do...) indicate that we can perform add owners and moderators via a Python shell, but don't indicate that it's possible to do it via REST. Is this true?
List members, nonmembers, moderators and owners are rosters. They are managed via REST at the /members endpoint. See https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/m... for documention of owners and moderators.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
One quick follow up. I'm making a subscribe request for a moderator. I'm passing in list_id, subscriber, and role (moderator). The request is returning a 201 response, but when I shell into the mailman server and inspect the list directly it shows there are no moderators. I've confirmed the list id, and I can see a list of regular members, but when I use the command line, the only version of the query which shows members is the default: mailman members <list name>
.
I assume I'm doing something wrong, but I'm not seeing it.
On 9/11/24 14:32, Andy Matthews wrote:
One quick follow up. I'm making a subscribe request for a moderator. I'm passing in list_id, subscriber, and role (moderator). The request is returning a 201 response, but when I shell into the mailman server and inspect the list directly it shows there are no moderators. I've confirmed the list id, and I can see a list of regular members, but when I use the command line, the only version of the query which shows members is the default:
mailman members <list name>
.
Does mailman members <list name> --role moderator
show the moderator?
The following works for me:
curl -urestadmin:restpass \
--request POST \
-H 'Content-Type: application/json' \
--data-binary '{"list_id": "list.example.com",
"subscriber": "someone@example.com",
"role": "moderator"}' \
http://localhost:8001/3.1/members
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Unfortunately no.
bash-5.1$ mailman members bravo-testing3.<redacted>
dev.tester+arti-admin1@<redacted>
dev.tester+arti-user1@<redacted>
dev.tester+user-4@<redacted>
bash-5.1$ mailman members bravo-testing3.<redacted>--role moderator
bravo-testing3.tena-sda.org has no members
bash-5.1$ mailman members bravo-testing3.<redacted> --role owner
bravo-testing3.tena-sda.org has no members
On 9/12/24 06:08, Andy Matthews wrote:
Unfortunately no.
What is different between what I show at https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/... and what you are doing?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Andy Matthews
-
Mark Sapiro