On 12/8/20 2:01 AM, Krešimir Mihalj wrote:
Hi ! I need simple add/delete member to list using rest ..... but all documentation is for python and not helpfull for me, .... and I need these in CLI using curl command ....
Have you seen <https://docs.mailman3.org/projects/mailman/en/latest/src/mailman/rest/docs/r...>
To add member using CLI i tried this command:
curl -d "{'list_id' : 'list.domain.com', 'subscriber' : 'user@email.com'}" -H 'Content-Type: application/json' --user restadmin:restpass http://localhost:8001/3.0/members
Try this:
curl --user restadmin:restpass --data-raw 'list_id=list.domain.com&subscriber=user@email.com' http://localhost:8001/3.0/members
Also, if someone is willing to give example: delete user: user@email.com from list: list@domain.com
First find the member_id with something like
curl -urestadmin:restpass http://localhost:8001/3.0/lists/list.domain/member/user@email.com
which will return json including the value of member_id
Then you can do
curl -urestadmin:restpass -X DELETE http://localhost:8001/3.0/members/xxxx
where xxx is the member_id.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan