GET:users

Overview

public. Retrieve list of users.

Uri Parameters

None

Query Parameters
NameTypeDescription
activatedfilterbool?Search for users by their active status
limitint?Number of entries to retrieve. Default: 100
offsetint?Number of entries to skip. Default: 0
rolefilterstring?Search for users by a role name
sortby{id, username, nick, email, fullname, date.lastlogin, status, role, service}?Sort field. Prefix value with '-' to sort descending. default: No sorting
usernamefilterstring?Search for users by name or part of a name
Return Codes
NameValueDescription
Forbidden403Read access is required
Forbidden403Read access is required
Ok200The request completed successfully
Ok200The request completed successfully

Message Format

Output: 

<users count="{int}" href="{uri}">
    <user id="{int}" href="{uri}">
        <nick>{text}</nick> 
        <username>{text}</username> 
        <email>{text}</email> 
        <page.home id="{int}" href="{int}">
            <title>{text}</title> 
            <path>{text}</path> 
        </page.home>
        <fullname /> 
        <status>{active|inactive}</status> 
        <date.lastlogin>{date}</date.lastlogin> 
        <service.authentication id="{int}" href="{uri]" /> 
        <permissions.user>
            <operations mask="{int}">{text}</operations> 
            <role id="{int}" href="{uri}">{text}</role> 
        </permissions.user>
        <permissions.effective>
            <operations mask="{int}">{text}</operations> 
        </permissions.effective>
        <groups count="{int}" href="{uri}">  
            <group id="{int}" href="{uri}">  
                <name>{text}</name>   
                <service.authentication id="{int}" href="{uri}" />   
                <users count="{int}" href="{uri}" />   
                <permissions.group>  
                    <operations mask="{int}">{text}</operations>   
                    <role id="{int}" href="{uri}">{text}</role>   
               </permissions.group>  
           </group>  
           ...
       </groups> 
    </user>
    ...
</users>

Implementation Notes

User POST:users to add or modify users.

Code Samples

The following code example retrieves a list of users:

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("users").Get();

Sample response indicating that there are two users, Admin and Anonymous:

<users count="2" href="http://deki-hayes/@api/deki/users">
    <user id="1" href="http://deki-hayes/@api/deki/users/1">
        <nick>Admin</nick>
        <username>Admin</username>
        <email>admin@mindtouch.com</email>
        <page.home id="30" href="http://deki-hayes/@api/deki/pages/30">
            <title>User:Admin</title>
            <path>User:Admin</path>
        </page.home>
        <fullname></fullname>
        <status>active</status>
        <date.lastlogin>2007-08-30T17:26:32Z</date.lastlogin>
        <service.authentication id="1" href="http://deki-hayes/@api/deki/site/services/1" />
        <permissions.user>
            <operations mask="9223372036854779903">LOGIN,BROWSE,READ,SUBSCRIBE,UPDATE,CREATE,DELETE,CHANGEPERMISSIONS,CONTROLPANEL,ADMIN</operations>
            <role id="5" href="http://deki-hayes/@api/deki/site/roles/5">Admin</role>
        </permissions.user>
        <permissions.effective>
            <operations mask="9223372036854779903">LOGIN,BROWSE,READ,SUBSCRIBE,UPDATE,CREATE,DELETE,CHANGEPERMISSIONS,CONTROLPANEL,ADMIN</operations>
        </permissions.effective>
        <groups />
    </user>
    <user id="2" href="http://deki-hayes/@api/deki/users/2">
        <nick>Anonymous</nick>
        <username>Anonymous</username>
        <email></email>
        <fullname>Anonymous User</fullname>
        <status>active</status>
        <date.lastlogin>2007-08-30T17:26:12Z</date.lastlogin>
        <service.authentication id="1" href="http://deki-hayes/@api/deki/site/services/1" />
        <permissions.user>
            <operations mask="15">LOGIN,BROWSE,READ,SUBSCRIBE</operations>
            <role id="3" href="http://deki-hayes/@api/deki/site/roles/3">Viewer</role>
        </permissions.user>
        <permissions.effective>
            <operations mask="15">LOGIN,BROWSE,READ,SUBSCRIBE</operations>
        </permissions.effective>
        <groups />
    </user>
</users>
Tag page
Viewing 1 of 1 comments: view all
There seems to be somewhat more to this API call than is documented. When I call it on my own wiki, I get two separate <users> blocks, apparently one each for local and single sign-on authentication. There are also additional fields in the <users> tag not documented here. My second one is for the single sign-on users, and it has count="0", and then assorted permissions and group info before the next <user>.
Posted 21:23, 20 Jun 2008
Viewing 1 of 1 comments: view all
You must login to post a comment.
Powered by MindTouch Deki Enterprise Edition v.8.08 RC2