'.. http:get:: /api/1/accounts
Get a list of Accounts matching the given criteria
**Example Request**:
.. sourcecode:: http
GET /api/1/accounts HTTP/1.1
Host: example.com
Accept: application/json, text/javascript
**Example Response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
count: 1,
items: [
third_party: false,
name: "example_name",
notes: null,
role_name: null,
identifier: "111111111111",
active: true,
id: 1,
s3_name: "example_name"
total: 1,
page: 1,
auth: {
authenticated: true,
user: "user@example.com"
:statuscode 200: no error
:statuscode 401: Authentication failure. Please login.'

def get(self):

    self.reqparse.add_argument('count', type=int, default=30, location='args')
    self.reqparse.add_argument('page', type=int, default=1, location='args')
    self.reqparse.add_argument('order_by', type=str, default=None, location='args')
    self.reqparse.add_argument('order_dir', type=str, default='desc', location='args')
    self.reqparse.add_argument('active', type=str, default=None, location='args')
    self.reqparse.add_argument('third_party', type=str, default=None, location='args')
    args = self.reqparse.parse_args()
    page = args.pop('page', None)
    count = args.pop('count', None)
    order_by = args.pop('order_by', None)
    order_dir = args.pop('order_dir', None)
    for (k, v) in args.items():
        if (not v):
            del args[k]
    query = Account.query
    if ('active' in args):
        active = (args['active'].lower() == 'true')
        query = query.filter((Account.active == active))
    if ('third_party' in args):
        third_party = (args['third_party'].lower() == 'true')
        query = query.filter((Account.third_party == third_party))
    if (order_by and hasattr(Account, order_by)):
        if (order_dir.lower() == 'asc'):
            if (order_by == 'account_type'):
                query = query.join(Account.account_type).order_by(getattr(AccountType, 'name').asc())
            else:
                query = query.order_by(getattr(Account, order_by).asc())
        elif (order_by == 'account_type'):
            query = query.join(Account.account_type).order_by(getattr(AccountType, 'name').desc())
        else:
            query = query.order_by(getattr(Account, order_by).desc())
    else:
        query = query.order_by(Account.id)
    result = query.paginate(page, count, error_out=False)
    items = []
    for account in result.items:
        account_marshaled = marshal(account.__dict__, ACCOUNT_FIELDS)
        account_marshaled = dict((account_marshaled.items() + {'account_type': account.account_type.name}.items()))
        items.append(account_marshaled)
    marshaled_dict = {'total': result.total, 'count': len(items), 'page': result.page, 'items': items, 'auth': self.auth_dict}
    return (marshaled_dict, 200)
