flexmeasures.api.v3_0.accounts
Classes
- class flexmeasures.api.v3_0.accounts.AccountAPI
- get(id: int, account: Account)
API endpoint to get an account.
This endpoint retrieves an account, given its id. Only admins or the user themselves can use this endpoint.
Example response
{ 'id': 1, 'name': 'Test Account' 'account_roles': [1, 3], }
- Reqheader Authorization:
The authentication token
- Reqheader Content-Type:
application/json
- Resheader Content-Type:
application/json
- Status 200:
PROCESSED
- Status 400:
INVALID_REQUEST, REQUIRED_INFO_MISSING, UNEXPECTED_PARAMS
- Status 401:
UNAUTHORIZED
- Status 403:
INVALID_SENDER
- Status 422:
UNPROCESSABLE_ENTITY
- index()
API endpoint to list all accounts accessible to the current user.
This endpoint returns all accessible accounts. Accessible accounts are your own account, or all accounts for admins. When the super-account concept (GH#203) lands, then users in such accounts see all managed accounts.
Example response
An example of one account being returned:
[ { 'id': 1, 'name': 'Test Account' 'account_roles': [1, 3], } ]
- Reqheader Authorization:
The authentication token
- Reqheader Content-Type:
application/json
- Resheader Content-Type:
application/json
- Status 200:
PROCESSED
- Status 400:
INVALID_REQUEST
- Status 401:
UNAUTHORIZED
- Status 403:
INVALID_SENDER
- Status 422:
UNPROCESSABLE_ENTITY