-
Notifications
You must be signed in to change notification settings - Fork 7
get accounts id
Harmun edited this page May 15, 2019
·
2 revisions
get | /accounts/:id | User | Return an account specified by id | None | { id, name, owner, deletedAt, lastUpdated, balance } |
Returns a single account specified by the id parameter. This will also calculate and return the account's balance.
See GET accounts for getting accounts in bulk.
Additionally see GET /accounts/?owner=[owner] to return accounts belonging to a specific owner.
- 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.
Response formats | JSON |
Requires authentication? | Yes |
curl -X GET \
http://localhost:3000/accounts/2 \
-H 'Authorization: Bearer 123testtoken' \
-H 'Host: localhost:3000'
A single account is returned as an object like this:
{
"id": 2,
"name": "infinityglove2",
"owner": 2,
"deletedAt": null,
"lastUpdated": "2019-05-15T09:20:29.000Z",
"balance": 600
}