Step by step example
In this example, we’ll take a step-by-step approach to obtaining the results of our energy bonus calculations.
Obtain a Bearer token
You ‘ll obtain a Bearer token by following authentication as described in introduction.
Then each time an API call is made, use token value in request header.
Retrieve FOST calculation data informations
Energy bonus may be calculated for both B2C and B2B contexts. Our API handle both contexts. Before obtaining the results, we need to determine the fost and the context involved.
In our example, we’ll use the FOST operation in b2b context.
GET /api/v2/simulation-inputs/bar-th-172/b2b
Will produce the following JSON response
The response lists every keys requested to fill the the payload of the calculation endpoint call. When an options
for a given key is set, it shows the set of accepted values. For example, for the operation.usage key, accepted values are heating and ecs.
Calculate FOST Energy Bonus
We use previous results to make the payload.
POST /api/v2/cee
Will respond with such results:
eurosMwHCumac
was added to the request. It is optional and it is used to fill euros
, eurosClassic
and eurosModest
values