-
Notifications
You must be signed in to change notification settings - Fork 7
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 }, ... ] |
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.
- 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.
Response formats | JSON |
Requires authentication? | Yes |
owner | integer |
Name | Required | Description | Default Value | Example |
---|---|---|---|---|
owner | required | The account owner's id | 2 |
curl -X GET \
'http://localhost:3000/accounts/?owner=2' \
-H 'Authorization: Bearer 123test123' \
-H 'Host: localhost:3000'
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"
}
]