Was this page helpful?

Retrieve List of Bans

    Description of the code sample

    The following command retrieves a list of all bans:

    Sample Code

    curl -u admin:password -i http://mindtouch.address/@api/deki/site/bans

    Sample Response from executing Code

    The following shows 1 user and 1 IP address banned forever:

    Content-Type: application/xml

    <bans>
      <ban id="44" href="http://192.168.59.128/@api/deki/site/bans/44">
        <user.createdby id="1" href="http://192.168.59.128/@api/deki/users/1">
          <nick>Admin</nick>
          <username>Admin</username>
          <email>admin@admin.com</email>
          <hash.email>64e1b8d34f425d19e1ee2ea7236d3028</hash.email>
          <uri.gravatar>http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028</uri.gravatar>
        </user.createdby>
        <date.modified>2010-01-30T08:32:53Z</date.modified>
        <description/>
        <date.expires>9999-12-31T23:59:59Z</date.expires>
        <permissions.revoked>
          <operations mask="9223372036854779198">BROWSE,READ,SUBSCRIBE,UPDATE,CREATE,DELETE,CHANGEPERMISSIONS,CONTROLPANEL,ADMIN</operations>
        </permissions.revoked>
        <ban.addresses>
          <address>256.256.256.256</address>
        </ban.addresses>
        <ban.users/>
      </ban>
      <ban id="43" href="http://192.168.59.128/@api/deki/site/bans/43">
        <user.createdby id="1" href="http://192.168.59.128/@api/deki/users/1">
          <nick>Admin</nick>
          <username>Admin</username>
          <email>admin@admin.com</email>
          <hash.email>64e1b8d34f425d19e1ee2ea7236d3028</hash.email>
          <uri.gravatar>http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028</uri.gravatar>
        </user.createdby>
        <date.modified>2010-01-30T08:32:37Z</date.modified>
        <description/>
        <date.expires>9999-12-31T23:59:59Z</date.expires>
        <permissions.revoked>
          <operations mask="9223372036854779198">BROWSE,READ,SUBSCRIBE,UPDATE,CREATE,DELETE,CHANGEPERMISSIONS,CONTROLPANEL,ADMIN</operations>
        </permissions.revoked>
        <ban.addresses/>
        <ban.users>
          <user id="83" href="http://192.168.59.128/@api/deki/users/83">
            <nick>test3</nick>
            <username>test3</username>
            <email>test3@test3.com</email>
            <hash.email>b7eb0bea5420aa6a566d3cebe69e2a15</hash.email>
            <uri.gravatar>http://www.gravatar.com/avatar/b7eb0bea5420aa6a566d3cebe69e2a15</uri.gravatar>
          </user>
        </ban.users>
      </ban>
    </bans>

    Implementation notes 

    curl flags

    -u
    Provides external user authentication.
    -i
    Outputs the HTTP response headers. Useful for debugging.

    Permissions

    ADMIN permission is required to execute above command.
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by