Getting started using the API

The following text describes the use of the HTTP API. Using the .NET API will follow the same logic.

In an actual deployment, the proper endpoints should be used, but it is also possible to test through Swagger. Here we illustrate the intended flow of the service.

  1. POST /api/networks/n1 with a network JSON file in the request body to load a power network and name it n1.
  2. GET /api/networks/n1/analysis can optionally be called to analyse the loaded network and flag any issues with the network structure that might cause problems for the optimization.
  3. POST /api/sessions/s1 to create a session with id s1 and give a forecast JSON file in the request body. Here, a start configuration JSON file may also be given.
  4. PUT /api/sessions/s1/runOptimization with true in the request body to start the optimization.
  5. Wait a minute or so. The optimizer works iteratively, and the current state can be polled with GET /api/sessions/s1 or (for more details) GET /api/sessions/s1/bestSolutionInfo.
  6. When a solution is desired, it can be retrieved with GET /api/sessions/s1/bestSolution.
  7. To halt the solver work, PUT /api/sessions/s1/runOptimization with false in the request body.

API workflow

See also the full API reference.