Was this page helpful?

Retrieve User List

    Description of the code sample

    The following code example retrieves a list of users:

    Sample Code

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

    Sample Response from executing Code

    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>

    Implementation notes 

    Add notes about requirements or config values

    Was this page helpful?
    Tag page
    Viewing 1 of 1 comments: view all
    If you want the entire list, you have to set the limit to 'all'.

    DreamMessage results = plug.At("users").With("limit", "all").Get();
    Posted 05:53, 12 Apr 2012
    Viewing 1 of 1 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by