Class UserResource


  • public class UserResource
    extends Object
    Non-admin user operations
    • Method Detail

      • getUser

        public Person getUser​(String key,
                              String username,
                              String expand)

        Get information about a user identified by either user key or username.

        Example request URI(s):

        • http://example.com/confluence/rest/api/user?username=jblogs
        • http://example.com/confluence/rest/api/user?key=402880824ff933a4014ff9345d7c0002
        Parameters:
        key - userkey of the user to request from this resource
        username - username of the user to request from this resource
        expand - properties to expand on the user
        Returns:
        the user identified by the key or username
      • getUsers

        public PageResponse<Person> getUsers​(String expand,
                                             int start,
                                             int limit,
                                             @Context
                                             javax.ws.rs.core.UriInfo uriInfo)
        Gets a paginated collection of all registered users, including but not limited to:
        • Disabled users
        • Enabled users
        • Enabled users which count towards the license count on the site
        • Enabled users which do not count towards the license count on the site
        • Enabled users which have "can use" global permissions
        • Enabled users which do not have "can use" global permissions

        Example request URI(s):

        • http://example.com/confluence/rest/api/user/list
        • http://example.com/confluence/rest/api/user/list?start=0
        • http://example.com/confluence/rest/api/user/list?start=0&limit=100
        • http://example.com/confluence/rest/api/user/list?start=0&limit=100&expand=status
        Parameters:
        expand - a comma separated list of properties to expand on the users. Default value is empty string.
        start - the start point of the collection to return. This must be non-negative. Default value is 0.
        limit - the limit of the number of users to return, this may be restricted by fixed system limits. This must be non-negative. Default value is 200.
        Returns:
        a paginated collection of users.
        Since:
        8.4.0
      • getCurrent

        public Person getCurrent​(String expand)
        Get information about the current logged in user.

        Example request URI(s):

        • http://example.com/confluence/rest/api/user/current
        Parameters:
        expand -
        Returns:
        the current logged in user, or anonymous if viewing is allowed by anonymous
      • getAnonymous

        public Person getAnonymous()
        Get information about the how anonymous is represented in confluence

        Example request URI(s):

        • http://example.com/confluence/rest/api/user/anonymous
        Returns:
        anonymous
      • getGroups

        public PageResponse<Group> getGroups​(String userKey,
                                             String username,
                                             String expand,
                                             int start,
                                             int limit,
                                             @Context
                                             javax.ws.rs.core.UriInfo uriInfo)
        Get a paginated collection of groups that the given user is a member of

        Example request URI(s):

        • http://example.com/confluence/rest/api/user/memberof?username=jblogs
        • http://example.com/confluence/rest/api/user/memberof?key=402880824ff933a4014ff9345d7c0002
        Returns:
        anonymous
      • changePassword

        public javax.ws.rs.core.Response changePassword​(PasswordChangeDetails passwordChangeDetails)
        Change the password for the current user

        Validation Rules : New password supplied cannot be null or blank

        Parameters:
        passwordChangeDetails - password change details
        Returns:
        Response
        Since:
        8.4.0