REST API reference
This page lists all endpoints of the REST API of the openLCA IPC protocol, as
provided by the gdt-server (see
stand-alone servers and the routes in its
Server.java).
The paths are relative to the base URL of the server, e.g.
http://localhost:8080/. Request and response bodies are JSON documents
following the openLCA Schema.
The following placeholders are used in the paths:
| Placeholder | Value |
|---|---|
{type} | the type of a data set, see the table below |
{id} | the ID of a data set |
{name} | the URL-encoded name of a data set |
{result-id} | the ID of a result |
{tech-flow} | a technosphere flow: <provider-id>::<flow-id> |
{envi-flow} | an intervention flow: <flow-id> or <flow-id>::<location-id> |
{impact-category} | the ID of an impact category |
The {type} path segments of the data set types are:
| Type | {type} | Type | {type} |
|---|---|---|---|
Actor | actors | Parameter | parameters |
Currency | currencies | Process | processes |
DQSystem | dq-systems | ProductSystem | product-systems |
Epd | epds | Project | projects |
Flow | flows | Result | results |
FlowProperty | flow-properties | SocialIndicator | social-indicators |
ImpactCategory | impact-categories | Source | sources |
ImpactMethod | impact-methods | UnitGroup | unit-groups |
Location | locations | Category | categories |
The server also accepts the singular forms of these path segments (e.g.
process instead of processes) as well as method(s) for impact methods and
model(s) for product systems.
Server
| Request | Returns |
|---|---|
GET api/version | the API version of the server |
Working with data
| Request | Body | Returns | Documentation |
|---|---|---|---|
GET data/{type} | List[Ref] | Get descriptors | |
GET data/{type}/all | List[{type}] | Get all | |
GET data/{type}/{id} | {type} | Get by ID | |
GET data/{type}/name/{name} | {type} | Get by name | |
GET data/{type}/{id}/info | Ref | Get descriptor | |
GET data/{type}/{id}/parameters | List[Parameter] or List[ParameterRedef] | Get parameters | |
GET data/providers | List[TechFlow] | Get providers | |
GET data/providers/{id} | List[TechFlow] | Get providers for flow | |
PUT data/{type} | the data set | Ref | Insert or update |
POST data/create-system | {process: Ref, config: LinkingConfig} | Ref | Create a product system |
DELETE data/{type}/{id} | Ref | Delete a data set |
Calculations
| Request | Body | Returns | Documentation |
|---|---|---|---|
POST result/calculate | CalculationSetup | ResultState | Calculate |
POST result/simulate | CalculationSetup | ResultState | Monte Carlo simulations |
GET result/{result-id}/state | ResultState | Get state | |
POST result/{result-id}/simulate/next | ResultState | Monte Carlo simulations | |
POST result/{result-id}/dispose | ResultState | Dispose result | |
DELETE result/{result-id} | ResultState | Dispose result |
Results
All result requests start with result/{result-id}/, which is omitted in the
table below. Except of the upstream trees and the Sankey graph, all result
requests are GET requests without a request body.
| Request | Returns | Documentation |
|---|---|---|
tech-flows | List[TechFlow] | Result elements |
envi-flows | List[EnviFlow] | Result elements |
impact-categories | List[Ref] | Result elements |
total-flows | List[EnviFlowValue] | Total results |
total-flow-value-of/{envi-flow} | EnviFlowValue | Total results |
total-impacts | List[ImpactValue] | Total results |
total-impact-value-of/{impact-category} | ImpactValue | Total results |
total-impacts/normalized | List[ImpactValue] | Total results |
total-impacts/weighted | List[ImpactValue] | Total results |
total-costs | CostValue | Total results |
demand | TechFlowValue | Technosphere requirements |
scaling-factors | List[TechFlowValue] | Technosphere requirements |
total-requirements | List[TechFlowValue] | Technosphere requirements |
total-requirements-of/{tech-flow} | TechFlowValue | Technosphere requirements |
scaled-tech-flows-of/{tech-flow} | List[TechFlowValue] | Technosphere requirements |
unscaled-tech-flows-of/{tech-flow} | List[TechFlowValue] | Technosphere requirements |
flow-contributions-of/{envi-flow} | List[TechFlowValue] | Direct contributions |
direct-interventions-of/{tech-flow} | List[EnviFlowValue] | Direct contributions |
direct-intervention-of/{envi-flow}/{tech-flow} | EnviFlowValue | Direct contributions |
impact-contributions-of/{impact-category} | List[TechFlowValue] | Direct contributions |
direct-impacts-of/{tech-flow} | List[ImpactValue] | Direct contributions |
direct-impact-of/{impact-category}/{tech-flow} | ImpactValue | Direct contributions |
cost-contributions | List[TechFlowValue] | Direct contributions |
direct-costs-of/{tech-flow} | number | Direct contributions |
flow-intensities-of/{tech-flow} | List[EnviFlowValue] | Intensities |
flow-intensity-of/{envi-flow}/{tech-flow} | EnviFlowValue | Intensities |
impact-intensities-of/{tech-flow} | List[ImpactValue] | Intensities |
impact-intensity-of/{impact-category}/{tech-flow} | ImpactValue | Intensities |
cost-intensities-of/{tech-flow} | number | Intensities |
total-interventions-of/{tech-flow} | List[EnviFlowValue] | Total process results |
total-intervention-of/{envi-flow}/{tech-flow} | EnviFlowValue | Total process results |
total-impacts-of/{tech-flow} | List[ImpactValue] | Total process results |
total-impact-of/{impact-category}/{tech-flow} | ImpactValue | Total process results |
total-costs-of/{tech-flow} | number | Total process results |
total-cost-values | List[TechFlowValue] | Total process results |
impact-factors-of/{impact-category} | List[EnviFlowValue] | Impact factors |
impact-factor-of/{impact-category}/{envi-flow} | EnviFlowValue | Impact factors |
flow-impacts-of/{impact-category} | List[EnviFlowValue] | Impact factors |
flow-impact-of/{impact-category}/{envi-flow} | EnviFlowValue | Impact factors |
POST upstream-interventions-of/{envi-flow} | List[UpstreamNode] | Upstream trees |
POST upstream-impacts-of/{impact-category} | List[UpstreamNode] | Upstream trees |
POST upstream-costs-of | List[UpstreamNode] | Upstream trees |
POST sankey | SankeyGraph | Sankey graphs |
The upstream tree requests take the path in the upstream tree as body
{"path": "<path>"}, see upstream trees.
The Sankey request takes a
SankeyRequest
as body.
Deprecated routes
For backwards compatibility with older API versions, the server still provides the following routes. They should not be used anymore:
| Deprecated route | Replacement |
|---|---|
POST results/calculate | POST result/calculate |
GET results/{id}/state | GET result/{result-id}/state |
GET results/{id}/total-impacts | GET result/{result-id}/total-impacts |
POST results/{id}/dispose | POST result/{result-id}/dispose |
DELETE results/{id} | DELETE result/{result-id} |
Not available via REST
The following methods of the JSON-RPC protocol have no REST endpoint:
data/get/usage(Get usage)data/put/source-fileresult/totality-factorsandresult/totality-factor-of(Technosphere requirements)- the grouped results (Grouped results)
- the tag results (Tag results)
export/json-ldruntime/shutdown