How can I add / delete users using the REST API?
Can users be added / deleted using REST API? If so what is the request URL and parameters for add/delete user? I can add users using the command line tool but I do not see in the documentation how to add / delete users using REST API.
Added by Andrzej Wójcik about 4 years ago
You can add / delete users using REST API. To do so you need to send proper request to REST endpoint.
I assume that all REST scripts are in place - default installation should placed them in proper locations.
To add user with jid
email@example.com you need to send HTTP PUT request to
http://localhost:firstname.lastname@example.org with following XML as a payload:
which will create user
email@example.com with password set to @test12345@.
To delete user with jid
firstname.lastname@example.org you need to send HTTP DELETE request to
http://localhost:email@example.com without any payload.
To be able to execute both requests you need to have admin permission and may need to authenticate, ie. using HTTP BASIC authentication.