Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-4323

New web service to search for users " /api/users/search"

    XMLWordPrintable

    Details

      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.

        Attachments

          Activity

            People

            Assignee:
            simon.brandhof Simon Brandhof (Inactive)
            Reporter:
            simon.brandhof Simon Brandhof (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: