Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

PlaceholderValue
{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}
ActoractorsParameterparameters
CurrencycurrenciesProcessprocesses
DQSystemdq-systemsProductSystemproduct-systems
EpdepdsProjectprojects
FlowflowsResultresults
FlowPropertyflow-propertiesSocialIndicatorsocial-indicators
ImpactCategoryimpact-categoriesSourcesources
ImpactMethodimpact-methodsUnitGroupunit-groups
LocationlocationsCategorycategories

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

RequestReturns
GET api/versionthe API version of the server

Working with data

RequestBodyReturnsDocumentation
GET data/{type}List[Ref]Get descriptors
GET data/{type}/allList[{type}]Get all
GET data/{type}/{id}{type}Get by ID
GET data/{type}/name/{name}{type}Get by name
GET data/{type}/{id}/infoRefGet descriptor
GET data/{type}/{id}/parametersList[Parameter] or List[ParameterRedef]Get parameters
GET data/providersList[TechFlow]Get providers
GET data/providers/{id}List[TechFlow]Get providers for flow
PUT data/{type}the data setRefInsert or update
POST data/create-system{process: Ref, config: LinkingConfig}RefCreate a product system
DELETE data/{type}/{id}RefDelete a data set

Calculations

RequestBodyReturnsDocumentation
POST result/calculateCalculationSetupResultStateCalculate
POST result/simulateCalculationSetupResultStateMonte Carlo simulations
GET result/{result-id}/stateResultStateGet state
POST result/{result-id}/simulate/nextResultStateMonte Carlo simulations
POST result/{result-id}/disposeResultStateDispose result
DELETE result/{result-id}ResultStateDispose 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.

RequestReturnsDocumentation
tech-flowsList[TechFlow]Result elements
envi-flowsList[EnviFlow]Result elements
impact-categoriesList[Ref]Result elements
total-flowsList[EnviFlowValue]Total results
total-flow-value-of/{envi-flow}EnviFlowValueTotal results
total-impactsList[ImpactValue]Total results
total-impact-value-of/{impact-category}ImpactValueTotal results
total-impacts/normalizedList[ImpactValue]Total results
total-impacts/weightedList[ImpactValue]Total results
total-costsCostValueTotal results
demandTechFlowValueTechnosphere requirements
scaling-factorsList[TechFlowValue]Technosphere requirements
total-requirementsList[TechFlowValue]Technosphere requirements
total-requirements-of/{tech-flow}TechFlowValueTechnosphere 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}EnviFlowValueDirect 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}ImpactValueDirect contributions
cost-contributionsList[TechFlowValue]Direct contributions
direct-costs-of/{tech-flow}numberDirect contributions
flow-intensities-of/{tech-flow}List[EnviFlowValue]Intensities
flow-intensity-of/{envi-flow}/{tech-flow}EnviFlowValueIntensities
impact-intensities-of/{tech-flow}List[ImpactValue]Intensities
impact-intensity-of/{impact-category}/{tech-flow}ImpactValueIntensities
cost-intensities-of/{tech-flow}numberIntensities
total-interventions-of/{tech-flow}List[EnviFlowValue]Total process results
total-intervention-of/{envi-flow}/{tech-flow}EnviFlowValueTotal process results
total-impacts-of/{tech-flow}List[ImpactValue]Total process results
total-impact-of/{impact-category}/{tech-flow}ImpactValueTotal process results
total-costs-of/{tech-flow}numberTotal process results
total-cost-valuesList[TechFlowValue]Total process results
impact-factors-of/{impact-category}List[EnviFlowValue]Impact factors
impact-factor-of/{impact-category}/{envi-flow}EnviFlowValueImpact factors
flow-impacts-of/{impact-category}List[EnviFlowValue]Impact factors
flow-impact-of/{impact-category}/{envi-flow}EnviFlowValueImpact factors
POST upstream-interventions-of/{envi-flow}List[UpstreamNode]Upstream trees
POST upstream-impacts-of/{impact-category}List[UpstreamNode]Upstream trees
POST upstream-costs-ofList[UpstreamNode]Upstream trees
POST sankeySankeyGraphSankey 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 routeReplacement
POST results/calculatePOST result/calculate
GET results/{id}/stateGET result/{result-id}/state
GET results/{id}/total-impactsGET result/{result-id}/total-impacts
POST results/{id}/disposePOST 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: