Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.6
-
Component/s: Authentication & Authorization, Web API
-
Labels:None
Description
Request
URL is /api/users/search. Optional parameters are the boolean 'includeDeactivated' (default value is false) and 'logins' (comma-separated list of logins). Example : /api/users/search?logins=sbrandhof,fmallet
Response
Both JSON and XML formats are supported. Example of JSON response:
{ "users": [ { "login": "fmallet", "name": "Freddy Mallet" "active": true, "email": "f@m.com" }, { "login": "sbrandhof", "name": "Simon", "active": true } ] }
Java Client
import org.sonar.wsclient.SonarClient; import org.sonar.wsclient.user.*; SonarClient client = SonarClient.builder().url("http://localhost:9000").build(); List<User> users = sonar.userClient().find(UserQuery.create().logins("sbrandhof"));
Known limitations
Search by groups is not supported yet.