flexmeasures.api.v3_0.accounts

Classes

class flexmeasures.api.v3_0.accounts.AccountAPI
auditlog(id: int, account: Account)

API endpoint to get history of account actions. Example response

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

get(id: int, account: Account)

API endpoint to get an account.

This endpoint retrieves an account, given its id. Only admins, consultants and users belonging to the account itself can use this endpoint.

Example response

{
    'id': 1,
    'name': 'Test Account'
    'account_roles': [1, 3],
    'consultancy_account_id': 2,
}
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 and accounts you are a consultant for, or all accounts for admins.

Example response

An example of one account being returned:

[
    {
        'id': 1,
        'name': 'Test Account'
        'account_roles': [1, 3],
        'consultancy_account_id': 2,
    }
]
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