Skip to content

get accounts owner

Harmun edited this page May 16, 2019 · 3 revisions

get /accounts/?owner=[owner] Admin/User Return all accounts associated with specified owner as an array of objects None [ { id, name, owner, deletedAt, lastUpdated }, ... ]

GET accounts/?owner=[owner]

Returns all accounts associated with the owner specified in the parameter.

See get accounts for getting all accounts in bulk.
Additionally see get accounts/:id to return a specific account by id.

Restrictions

  • Users can only access accounts belonging to them, unless they have the admin user role.
  • The id parameter must be numeric.
  • Does not retrieve deleted accounts.
  • Balance in accounts are not calculated.

Resource Information

Response formats JSON
Requires authentication? Yes
owner integer

Parameters

Name Required Description Default Value Example
owner required The account owner's id 2

Example Request

curl -X GET \
  'http://localhost:3000/accounts/?owner=2' \
  -H 'Authorization: Bearer 123test123' \
  -H 'Host: localhost:3000'

Example Response

Accounts are returned as an array of objects like this:

[
    {
        "id": 2,
        "name": "scepterFixedDeposits,
        "owner": 2,
        "deletedAt": null,
        "lastUpdated": "2019-05-15T09:20:29.000Z"
    },
    {
        "id": 3,
        "name": "cliffsOfCredit",
        "owner": 2,
        "deletedAt": null,
        "lastUpdated": "2019-05-15T09:20:58.000Z"
    },
    {
        "id": 4,
        "name": "collectorSavings",
        "owner": 2,
        "deletedAt": null,
        "lastUpdated": "2019-05-15T09:20:59.000Z"
    }
    {
        "id": 5,
        "name": "novaTimeShare",
        "owner": 2,
        "deletedAt": null,
        "lastUpdated": "2019-05-15T09:21:58.000Z"
    },
    {
        "id": 6,
        "name": "visionTemporaryCreditAccount",
        "owner": 2,
        "deletedAt": null,
        "lastUpdated": "2019-05-15T09:22:59.000Z"
    },
    {
        "id": 7,
        "name": "debitOfAgamotto",
        "owner": 2,
        "deletedAt": null,
        "lastUpdated": "2019-05-15T09:22:59.000Z"
    }
]