Patch EPD
curl --request PATCH \
--url https://api.realtimelca.com/epd/api/material \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"updateFieldPaths": [
"DeclaredUnit.Mass",
"DeclaredUnit.MassUnit"
],
"materials": [
{
"internalId": "c3cc340f-01ad-4149-9d7b-111ea48700be",
"internalVersionNumber": 1,
"tenantId": "2",
"isPublic": true,
"isCustom": false,
"isConstruction": false,
"tags": [
"Zink"
],
"lciaResultCompleteness": 1,
"basedOnMaterialIds": [],
"epdInfo": {
"epdSpecificationForm": 0,
"epdProductIndustryType": 2,
"validTo": "2023-01-01T00:00:00.0000000",
"epdVersion": "1.0",
"publicationDate": "2022-05-22T00:00:00.0000000",
"fileEntityId": "00000000-0000-0000-0000-000000000000",
"declarationOwnerId": "00000000-0000-0000-0000-000000000000",
"datasourceId": "cf1bca75-0e00-40f1-8666-a72e6b501e07",
"declarationNumber": "",
"link": "https://www.retsinformation.dk/eli/lta/2022/1464"
},
"lciaResults": [
{
"moduleTypeEnum": 0,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 2.09
}
]
},
{
"moduleTypeEnum": 15,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 0
}
]
},
{
"moduleTypeEnum": 16,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 0.00068207
}
]
},
{
"moduleTypeEnum": 17,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": -1.81062
}
]
},
{
"moduleTypeEnum": 1,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 2,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 3,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 4,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 5,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 6,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 7,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 8,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 9,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 10,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 11,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 12,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 13,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 14,
"moduleStatusEnum": 1,
"indicators": []
}
],
"declaredUnit": {
"declaredUnit": 1,
"declaredValue": 1,
"mass": 7200,
"massUnit": 2
},
"expectedLifespan": 0,
"name": "Zink, patineret",
"description": "Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015",
"datasourceName": "Tabel7",
"declarationOwnerName": "Tabel 7",
"newestVersion": true,
"id": "0e62c058-a6e0-4c25-a1eb-13647aef66c5",
"createdAt": "2023-04-19T12:05:40.0244540+02:00"
}
]
}
'import requests
url = "https://api.realtimelca.com/epd/api/material"
payload = {
"updateFieldPaths": ["DeclaredUnit.Mass", "DeclaredUnit.MassUnit"],
"materials": [
{
"internalId": "c3cc340f-01ad-4149-9d7b-111ea48700be",
"internalVersionNumber": 1,
"tenantId": "2",
"isPublic": True,
"isCustom": False,
"isConstruction": False,
"tags": ["Zink"],
"lciaResultCompleteness": 1,
"basedOnMaterialIds": [],
"epdInfo": {
"epdSpecificationForm": 0,
"epdProductIndustryType": 2,
"validTo": "2023-01-01T00:00:00.0000000",
"epdVersion": "1.0",
"publicationDate": "2022-05-22T00:00:00.0000000",
"fileEntityId": "00000000-0000-0000-0000-000000000000",
"declarationOwnerId": "00000000-0000-0000-0000-000000000000",
"datasourceId": "cf1bca75-0e00-40f1-8666-a72e6b501e07",
"declarationNumber": "",
"link": "https://www.retsinformation.dk/eli/lta/2022/1464"
},
"lciaResults": [
{
"moduleTypeEnum": 0,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 2.09
}
]
},
{
"moduleTypeEnum": 15,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 0
}
]
},
{
"moduleTypeEnum": 16,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 0.00068207
}
]
},
{
"moduleTypeEnum": 17,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": -1.81062
}
]
},
{
"moduleTypeEnum": 1,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 2,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 3,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 4,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 5,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 6,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 7,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 8,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 9,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 10,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 11,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 12,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 13,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 14,
"moduleStatusEnum": 1,
"indicators": []
}
],
"declaredUnit": {
"declaredUnit": 1,
"declaredValue": 1,
"mass": 7200,
"massUnit": 2
},
"expectedLifespan": 0,
"name": "Zink, patineret",
"description": "Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015",
"datasourceName": "Tabel7",
"declarationOwnerName": "Tabel 7",
"newestVersion": True,
"id": "0e62c058-a6e0-4c25-a1eb-13647aef66c5",
"createdAt": "2023-04-19T12:05:40.0244540+02:00"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updateFieldPaths: ['DeclaredUnit.Mass', 'DeclaredUnit.MassUnit'],
materials: [
{
internalId: 'c3cc340f-01ad-4149-9d7b-111ea48700be',
internalVersionNumber: 1,
tenantId: '2',
isPublic: true,
isCustom: false,
isConstruction: false,
tags: ['Zink'],
lciaResultCompleteness: 1,
basedOnMaterialIds: [],
epdInfo: {
epdSpecificationForm: 0,
epdProductIndustryType: 2,
validTo: '2023-01-01T00:00:00.0000000',
epdVersion: '1.0',
publicationDate: '2022-05-22T00:00:00.0000000',
fileEntityId: '00000000-0000-0000-0000-000000000000',
declarationOwnerId: '00000000-0000-0000-0000-000000000000',
datasourceId: 'cf1bca75-0e00-40f1-8666-a72e6b501e07',
declarationNumber: '',
link: 'https://www.retsinformation.dk/eli/lta/2022/1464'
},
lciaResults: [
{
moduleTypeEnum: 0,
moduleStatusEnum: 2,
indicators: [{type: 0, unit: '', originalIdentifier: 'gwp', value: 2.09}]
},
{
moduleTypeEnum: 15,
moduleStatusEnum: 2,
indicators: [{type: 0, unit: '', originalIdentifier: 'gwp', value: 0}]
},
{
moduleTypeEnum: 16,
moduleStatusEnum: 2,
indicators: [{type: 0, unit: '', originalIdentifier: 'gwp', value: 0.00068207}]
},
{
moduleTypeEnum: 17,
moduleStatusEnum: 2,
indicators: [{type: 0, unit: '', originalIdentifier: 'gwp', value: -1.81062}]
},
{moduleTypeEnum: 1, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 2, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 3, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 4, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 5, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 6, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 7, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 8, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 9, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 10, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 11, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 12, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 13, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 14, moduleStatusEnum: 1, indicators: []}
],
declaredUnit: {declaredUnit: 1, declaredValue: 1, mass: 7200, massUnit: 2},
expectedLifespan: 0,
name: 'Zink, patineret',
description: 'Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015',
datasourceName: 'Tabel7',
declarationOwnerName: 'Tabel 7',
newestVersion: true,
id: '0e62c058-a6e0-4c25-a1eb-13647aef66c5',
createdAt: '2023-04-19T12:05:40.0244540+02:00'
}
]
})
};
fetch('https://api.realtimelca.com/epd/api/material', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.realtimelca.com/epd/api/material",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'updateFieldPaths' => [
'DeclaredUnit.Mass',
'DeclaredUnit.MassUnit'
],
'materials' => [
[
'internalId' => 'c3cc340f-01ad-4149-9d7b-111ea48700be',
'internalVersionNumber' => 1,
'tenantId' => '2',
'isPublic' => true,
'isCustom' => false,
'isConstruction' => false,
'tags' => [
'Zink'
],
'lciaResultCompleteness' => 1,
'basedOnMaterialIds' => [
],
'epdInfo' => [
'epdSpecificationForm' => 0,
'epdProductIndustryType' => 2,
'validTo' => '2023-01-01T00:00:00.0000000',
'epdVersion' => '1.0',
'publicationDate' => '2022-05-22T00:00:00.0000000',
'fileEntityId' => '00000000-0000-0000-0000-000000000000',
'declarationOwnerId' => '00000000-0000-0000-0000-000000000000',
'datasourceId' => 'cf1bca75-0e00-40f1-8666-a72e6b501e07',
'declarationNumber' => '',
'link' => 'https://www.retsinformation.dk/eli/lta/2022/1464'
],
'lciaResults' => [
[
'moduleTypeEnum' => 0,
'moduleStatusEnum' => 2,
'indicators' => [
[
'type' => 0,
'unit' => '',
'originalIdentifier' => 'gwp',
'value' => 2.09
]
]
],
[
'moduleTypeEnum' => 15,
'moduleStatusEnum' => 2,
'indicators' => [
[
'type' => 0,
'unit' => '',
'originalIdentifier' => 'gwp',
'value' => 0
]
]
],
[
'moduleTypeEnum' => 16,
'moduleStatusEnum' => 2,
'indicators' => [
[
'type' => 0,
'unit' => '',
'originalIdentifier' => 'gwp',
'value' => 0.00068207
]
]
],
[
'moduleTypeEnum' => 17,
'moduleStatusEnum' => 2,
'indicators' => [
[
'type' => 0,
'unit' => '',
'originalIdentifier' => 'gwp',
'value' => -1.81062
]
]
],
[
'moduleTypeEnum' => 1,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 2,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 3,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 4,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 5,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 6,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 7,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 8,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 9,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 10,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 11,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 12,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 13,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 14,
'moduleStatusEnum' => 1,
'indicators' => [
]
]
],
'declaredUnit' => [
'declaredUnit' => 1,
'declaredValue' => 1,
'mass' => 7200,
'massUnit' => 2
],
'expectedLifespan' => 0,
'name' => 'Zink, patineret',
'description' => 'Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015',
'datasourceName' => 'Tabel7',
'declarationOwnerName' => 'Tabel 7',
'newestVersion' => true,
'id' => '0e62c058-a6e0-4c25-a1eb-13647aef66c5',
'createdAt' => '2023-04-19T12:05:40.0244540+02:00'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.realtimelca.com/epd/api/material"
payload := strings.NewReader("{\n \"updateFieldPaths\": [\n \"DeclaredUnit.Mass\",\n \"DeclaredUnit.MassUnit\"\n ],\n \"materials\": [\n {\n \"internalId\": \"c3cc340f-01ad-4149-9d7b-111ea48700be\",\n \"internalVersionNumber\": 1,\n \"tenantId\": \"2\",\n \"isPublic\": true,\n \"isCustom\": false,\n \"isConstruction\": false,\n \"tags\": [\n \"Zink\"\n ],\n \"lciaResultCompleteness\": 1,\n \"basedOnMaterialIds\": [],\n \"epdInfo\": {\n \"epdSpecificationForm\": 0,\n \"epdProductIndustryType\": 2,\n \"validTo\": \"2023-01-01T00:00:00.0000000\",\n \"epdVersion\": \"1.0\",\n \"publicationDate\": \"2022-05-22T00:00:00.0000000\",\n \"fileEntityId\": \"00000000-0000-0000-0000-000000000000\",\n \"declarationOwnerId\": \"00000000-0000-0000-0000-000000000000\",\n \"datasourceId\": \"cf1bca75-0e00-40f1-8666-a72e6b501e07\",\n \"declarationNumber\": \"\",\n \"link\": \"https://www.retsinformation.dk/eli/lta/2022/1464\"\n },\n \"lciaResults\": [\n {\n \"moduleTypeEnum\": 0,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 2.09\n }\n ]\n },\n {\n \"moduleTypeEnum\": 15,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0\n }\n ]\n },\n {\n \"moduleTypeEnum\": 16,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0.00068207\n }\n ]\n },\n {\n \"moduleTypeEnum\": 17,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": -1.81062\n }\n ]\n },\n {\n \"moduleTypeEnum\": 1,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 2,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 3,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 4,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 5,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 6,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 7,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 8,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 9,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 10,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 11,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 12,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 13,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 14,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n }\n ],\n \"declaredUnit\": {\n \"declaredUnit\": 1,\n \"declaredValue\": 1,\n \"mass\": 7200,\n \"massUnit\": 2\n },\n \"expectedLifespan\": 0,\n \"name\": \"Zink, patineret\",\n \"description\": \"Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015\",\n \"datasourceName\": \"Tabel7\",\n \"declarationOwnerName\": \"Tabel 7\",\n \"newestVersion\": true,\n \"id\": \"0e62c058-a6e0-4c25-a1eb-13647aef66c5\",\n \"createdAt\": \"2023-04-19T12:05:40.0244540+02:00\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.realtimelca.com/epd/api/material")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"updateFieldPaths\": [\n \"DeclaredUnit.Mass\",\n \"DeclaredUnit.MassUnit\"\n ],\n \"materials\": [\n {\n \"internalId\": \"c3cc340f-01ad-4149-9d7b-111ea48700be\",\n \"internalVersionNumber\": 1,\n \"tenantId\": \"2\",\n \"isPublic\": true,\n \"isCustom\": false,\n \"isConstruction\": false,\n \"tags\": [\n \"Zink\"\n ],\n \"lciaResultCompleteness\": 1,\n \"basedOnMaterialIds\": [],\n \"epdInfo\": {\n \"epdSpecificationForm\": 0,\n \"epdProductIndustryType\": 2,\n \"validTo\": \"2023-01-01T00:00:00.0000000\",\n \"epdVersion\": \"1.0\",\n \"publicationDate\": \"2022-05-22T00:00:00.0000000\",\n \"fileEntityId\": \"00000000-0000-0000-0000-000000000000\",\n \"declarationOwnerId\": \"00000000-0000-0000-0000-000000000000\",\n \"datasourceId\": \"cf1bca75-0e00-40f1-8666-a72e6b501e07\",\n \"declarationNumber\": \"\",\n \"link\": \"https://www.retsinformation.dk/eli/lta/2022/1464\"\n },\n \"lciaResults\": [\n {\n \"moduleTypeEnum\": 0,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 2.09\n }\n ]\n },\n {\n \"moduleTypeEnum\": 15,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0\n }\n ]\n },\n {\n \"moduleTypeEnum\": 16,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0.00068207\n }\n ]\n },\n {\n \"moduleTypeEnum\": 17,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": -1.81062\n }\n ]\n },\n {\n \"moduleTypeEnum\": 1,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 2,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 3,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 4,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 5,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 6,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 7,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 8,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 9,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 10,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 11,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 12,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 13,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 14,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n }\n ],\n \"declaredUnit\": {\n \"declaredUnit\": 1,\n \"declaredValue\": 1,\n \"mass\": 7200,\n \"massUnit\": 2\n },\n \"expectedLifespan\": 0,\n \"name\": \"Zink, patineret\",\n \"description\": \"Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015\",\n \"datasourceName\": \"Tabel7\",\n \"declarationOwnerName\": \"Tabel 7\",\n \"newestVersion\": true,\n \"id\": \"0e62c058-a6e0-4c25-a1eb-13647aef66c5\",\n \"createdAt\": \"2023-04-19T12:05:40.0244540+02:00\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.realtimelca.com/epd/api/material")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updateFieldPaths\": [\n \"DeclaredUnit.Mass\",\n \"DeclaredUnit.MassUnit\"\n ],\n \"materials\": [\n {\n \"internalId\": \"c3cc340f-01ad-4149-9d7b-111ea48700be\",\n \"internalVersionNumber\": 1,\n \"tenantId\": \"2\",\n \"isPublic\": true,\n \"isCustom\": false,\n \"isConstruction\": false,\n \"tags\": [\n \"Zink\"\n ],\n \"lciaResultCompleteness\": 1,\n \"basedOnMaterialIds\": [],\n \"epdInfo\": {\n \"epdSpecificationForm\": 0,\n \"epdProductIndustryType\": 2,\n \"validTo\": \"2023-01-01T00:00:00.0000000\",\n \"epdVersion\": \"1.0\",\n \"publicationDate\": \"2022-05-22T00:00:00.0000000\",\n \"fileEntityId\": \"00000000-0000-0000-0000-000000000000\",\n \"declarationOwnerId\": \"00000000-0000-0000-0000-000000000000\",\n \"datasourceId\": \"cf1bca75-0e00-40f1-8666-a72e6b501e07\",\n \"declarationNumber\": \"\",\n \"link\": \"https://www.retsinformation.dk/eli/lta/2022/1464\"\n },\n \"lciaResults\": [\n {\n \"moduleTypeEnum\": 0,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 2.09\n }\n ]\n },\n {\n \"moduleTypeEnum\": 15,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0\n }\n ]\n },\n {\n \"moduleTypeEnum\": 16,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0.00068207\n }\n ]\n },\n {\n \"moduleTypeEnum\": 17,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": -1.81062\n }\n ]\n },\n {\n \"moduleTypeEnum\": 1,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 2,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 3,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 4,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 5,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 6,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 7,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 8,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 9,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 10,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 11,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 12,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 13,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 14,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n }\n ],\n \"declaredUnit\": {\n \"declaredUnit\": 1,\n \"declaredValue\": 1,\n \"mass\": 7200,\n \"massUnit\": 2\n },\n \"expectedLifespan\": 0,\n \"name\": \"Zink, patineret\",\n \"description\": \"Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015\",\n \"datasourceName\": \"Tabel7\",\n \"declarationOwnerName\": \"Tabel 7\",\n \"newestVersion\": true,\n \"id\": \"0e62c058-a6e0-4c25-a1eb-13647aef66c5\",\n \"createdAt\": \"2023-04-19T12:05:40.0244540+02:00\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyLibrary
Patch EPD
Partially updates one or more materials in the EPD (Environmental Product Declaration) database. Only the fields specified in updateFieldPaths will be modified — all other fields on the material records remain unchanged.
PATCH
/
material
Patch EPD
curl --request PATCH \
--url https://api.realtimelca.com/epd/api/material \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"updateFieldPaths": [
"DeclaredUnit.Mass",
"DeclaredUnit.MassUnit"
],
"materials": [
{
"internalId": "c3cc340f-01ad-4149-9d7b-111ea48700be",
"internalVersionNumber": 1,
"tenantId": "2",
"isPublic": true,
"isCustom": false,
"isConstruction": false,
"tags": [
"Zink"
],
"lciaResultCompleteness": 1,
"basedOnMaterialIds": [],
"epdInfo": {
"epdSpecificationForm": 0,
"epdProductIndustryType": 2,
"validTo": "2023-01-01T00:00:00.0000000",
"epdVersion": "1.0",
"publicationDate": "2022-05-22T00:00:00.0000000",
"fileEntityId": "00000000-0000-0000-0000-000000000000",
"declarationOwnerId": "00000000-0000-0000-0000-000000000000",
"datasourceId": "cf1bca75-0e00-40f1-8666-a72e6b501e07",
"declarationNumber": "",
"link": "https://www.retsinformation.dk/eli/lta/2022/1464"
},
"lciaResults": [
{
"moduleTypeEnum": 0,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 2.09
}
]
},
{
"moduleTypeEnum": 15,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 0
}
]
},
{
"moduleTypeEnum": 16,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 0.00068207
}
]
},
{
"moduleTypeEnum": 17,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": -1.81062
}
]
},
{
"moduleTypeEnum": 1,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 2,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 3,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 4,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 5,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 6,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 7,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 8,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 9,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 10,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 11,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 12,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 13,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 14,
"moduleStatusEnum": 1,
"indicators": []
}
],
"declaredUnit": {
"declaredUnit": 1,
"declaredValue": 1,
"mass": 7200,
"massUnit": 2
},
"expectedLifespan": 0,
"name": "Zink, patineret",
"description": "Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015",
"datasourceName": "Tabel7",
"declarationOwnerName": "Tabel 7",
"newestVersion": true,
"id": "0e62c058-a6e0-4c25-a1eb-13647aef66c5",
"createdAt": "2023-04-19T12:05:40.0244540+02:00"
}
]
}
'import requests
url = "https://api.realtimelca.com/epd/api/material"
payload = {
"updateFieldPaths": ["DeclaredUnit.Mass", "DeclaredUnit.MassUnit"],
"materials": [
{
"internalId": "c3cc340f-01ad-4149-9d7b-111ea48700be",
"internalVersionNumber": 1,
"tenantId": "2",
"isPublic": True,
"isCustom": False,
"isConstruction": False,
"tags": ["Zink"],
"lciaResultCompleteness": 1,
"basedOnMaterialIds": [],
"epdInfo": {
"epdSpecificationForm": 0,
"epdProductIndustryType": 2,
"validTo": "2023-01-01T00:00:00.0000000",
"epdVersion": "1.0",
"publicationDate": "2022-05-22T00:00:00.0000000",
"fileEntityId": "00000000-0000-0000-0000-000000000000",
"declarationOwnerId": "00000000-0000-0000-0000-000000000000",
"datasourceId": "cf1bca75-0e00-40f1-8666-a72e6b501e07",
"declarationNumber": "",
"link": "https://www.retsinformation.dk/eli/lta/2022/1464"
},
"lciaResults": [
{
"moduleTypeEnum": 0,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 2.09
}
]
},
{
"moduleTypeEnum": 15,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 0
}
]
},
{
"moduleTypeEnum": 16,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": 0.00068207
}
]
},
{
"moduleTypeEnum": 17,
"moduleStatusEnum": 2,
"indicators": [
{
"type": 0,
"unit": "",
"originalIdentifier": "gwp",
"value": -1.81062
}
]
},
{
"moduleTypeEnum": 1,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 2,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 3,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 4,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 5,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 6,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 7,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 8,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 9,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 10,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 11,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 12,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 13,
"moduleStatusEnum": 1,
"indicators": []
},
{
"moduleTypeEnum": 14,
"moduleStatusEnum": 1,
"indicators": []
}
],
"declaredUnit": {
"declaredUnit": 1,
"declaredValue": 1,
"mass": 7200,
"massUnit": 2
},
"expectedLifespan": 0,
"name": "Zink, patineret",
"description": "Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015",
"datasourceName": "Tabel7",
"declarationOwnerName": "Tabel 7",
"newestVersion": True,
"id": "0e62c058-a6e0-4c25-a1eb-13647aef66c5",
"createdAt": "2023-04-19T12:05:40.0244540+02:00"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updateFieldPaths: ['DeclaredUnit.Mass', 'DeclaredUnit.MassUnit'],
materials: [
{
internalId: 'c3cc340f-01ad-4149-9d7b-111ea48700be',
internalVersionNumber: 1,
tenantId: '2',
isPublic: true,
isCustom: false,
isConstruction: false,
tags: ['Zink'],
lciaResultCompleteness: 1,
basedOnMaterialIds: [],
epdInfo: {
epdSpecificationForm: 0,
epdProductIndustryType: 2,
validTo: '2023-01-01T00:00:00.0000000',
epdVersion: '1.0',
publicationDate: '2022-05-22T00:00:00.0000000',
fileEntityId: '00000000-0000-0000-0000-000000000000',
declarationOwnerId: '00000000-0000-0000-0000-000000000000',
datasourceId: 'cf1bca75-0e00-40f1-8666-a72e6b501e07',
declarationNumber: '',
link: 'https://www.retsinformation.dk/eli/lta/2022/1464'
},
lciaResults: [
{
moduleTypeEnum: 0,
moduleStatusEnum: 2,
indicators: [{type: 0, unit: '', originalIdentifier: 'gwp', value: 2.09}]
},
{
moduleTypeEnum: 15,
moduleStatusEnum: 2,
indicators: [{type: 0, unit: '', originalIdentifier: 'gwp', value: 0}]
},
{
moduleTypeEnum: 16,
moduleStatusEnum: 2,
indicators: [{type: 0, unit: '', originalIdentifier: 'gwp', value: 0.00068207}]
},
{
moduleTypeEnum: 17,
moduleStatusEnum: 2,
indicators: [{type: 0, unit: '', originalIdentifier: 'gwp', value: -1.81062}]
},
{moduleTypeEnum: 1, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 2, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 3, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 4, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 5, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 6, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 7, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 8, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 9, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 10, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 11, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 12, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 13, moduleStatusEnum: 1, indicators: []},
{moduleTypeEnum: 14, moduleStatusEnum: 1, indicators: []}
],
declaredUnit: {declaredUnit: 1, declaredValue: 1, mass: 7200, massUnit: 2},
expectedLifespan: 0,
name: 'Zink, patineret',
description: 'Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015',
datasourceName: 'Tabel7',
declarationOwnerName: 'Tabel 7',
newestVersion: true,
id: '0e62c058-a6e0-4c25-a1eb-13647aef66c5',
createdAt: '2023-04-19T12:05:40.0244540+02:00'
}
]
})
};
fetch('https://api.realtimelca.com/epd/api/material', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.realtimelca.com/epd/api/material",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'updateFieldPaths' => [
'DeclaredUnit.Mass',
'DeclaredUnit.MassUnit'
],
'materials' => [
[
'internalId' => 'c3cc340f-01ad-4149-9d7b-111ea48700be',
'internalVersionNumber' => 1,
'tenantId' => '2',
'isPublic' => true,
'isCustom' => false,
'isConstruction' => false,
'tags' => [
'Zink'
],
'lciaResultCompleteness' => 1,
'basedOnMaterialIds' => [
],
'epdInfo' => [
'epdSpecificationForm' => 0,
'epdProductIndustryType' => 2,
'validTo' => '2023-01-01T00:00:00.0000000',
'epdVersion' => '1.0',
'publicationDate' => '2022-05-22T00:00:00.0000000',
'fileEntityId' => '00000000-0000-0000-0000-000000000000',
'declarationOwnerId' => '00000000-0000-0000-0000-000000000000',
'datasourceId' => 'cf1bca75-0e00-40f1-8666-a72e6b501e07',
'declarationNumber' => '',
'link' => 'https://www.retsinformation.dk/eli/lta/2022/1464'
],
'lciaResults' => [
[
'moduleTypeEnum' => 0,
'moduleStatusEnum' => 2,
'indicators' => [
[
'type' => 0,
'unit' => '',
'originalIdentifier' => 'gwp',
'value' => 2.09
]
]
],
[
'moduleTypeEnum' => 15,
'moduleStatusEnum' => 2,
'indicators' => [
[
'type' => 0,
'unit' => '',
'originalIdentifier' => 'gwp',
'value' => 0
]
]
],
[
'moduleTypeEnum' => 16,
'moduleStatusEnum' => 2,
'indicators' => [
[
'type' => 0,
'unit' => '',
'originalIdentifier' => 'gwp',
'value' => 0.00068207
]
]
],
[
'moduleTypeEnum' => 17,
'moduleStatusEnum' => 2,
'indicators' => [
[
'type' => 0,
'unit' => '',
'originalIdentifier' => 'gwp',
'value' => -1.81062
]
]
],
[
'moduleTypeEnum' => 1,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 2,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 3,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 4,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 5,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 6,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 7,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 8,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 9,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 10,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 11,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 12,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 13,
'moduleStatusEnum' => 1,
'indicators' => [
]
],
[
'moduleTypeEnum' => 14,
'moduleStatusEnum' => 1,
'indicators' => [
]
]
],
'declaredUnit' => [
'declaredUnit' => 1,
'declaredValue' => 1,
'mass' => 7200,
'massUnit' => 2
],
'expectedLifespan' => 0,
'name' => 'Zink, patineret',
'description' => 'Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015',
'datasourceName' => 'Tabel7',
'declarationOwnerName' => 'Tabel 7',
'newestVersion' => true,
'id' => '0e62c058-a6e0-4c25-a1eb-13647aef66c5',
'createdAt' => '2023-04-19T12:05:40.0244540+02:00'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.realtimelca.com/epd/api/material"
payload := strings.NewReader("{\n \"updateFieldPaths\": [\n \"DeclaredUnit.Mass\",\n \"DeclaredUnit.MassUnit\"\n ],\n \"materials\": [\n {\n \"internalId\": \"c3cc340f-01ad-4149-9d7b-111ea48700be\",\n \"internalVersionNumber\": 1,\n \"tenantId\": \"2\",\n \"isPublic\": true,\n \"isCustom\": false,\n \"isConstruction\": false,\n \"tags\": [\n \"Zink\"\n ],\n \"lciaResultCompleteness\": 1,\n \"basedOnMaterialIds\": [],\n \"epdInfo\": {\n \"epdSpecificationForm\": 0,\n \"epdProductIndustryType\": 2,\n \"validTo\": \"2023-01-01T00:00:00.0000000\",\n \"epdVersion\": \"1.0\",\n \"publicationDate\": \"2022-05-22T00:00:00.0000000\",\n \"fileEntityId\": \"00000000-0000-0000-0000-000000000000\",\n \"declarationOwnerId\": \"00000000-0000-0000-0000-000000000000\",\n \"datasourceId\": \"cf1bca75-0e00-40f1-8666-a72e6b501e07\",\n \"declarationNumber\": \"\",\n \"link\": \"https://www.retsinformation.dk/eli/lta/2022/1464\"\n },\n \"lciaResults\": [\n {\n \"moduleTypeEnum\": 0,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 2.09\n }\n ]\n },\n {\n \"moduleTypeEnum\": 15,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0\n }\n ]\n },\n {\n \"moduleTypeEnum\": 16,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0.00068207\n }\n ]\n },\n {\n \"moduleTypeEnum\": 17,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": -1.81062\n }\n ]\n },\n {\n \"moduleTypeEnum\": 1,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 2,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 3,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 4,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 5,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 6,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 7,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 8,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 9,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 10,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 11,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 12,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 13,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 14,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n }\n ],\n \"declaredUnit\": {\n \"declaredUnit\": 1,\n \"declaredValue\": 1,\n \"mass\": 7200,\n \"massUnit\": 2\n },\n \"expectedLifespan\": 0,\n \"name\": \"Zink, patineret\",\n \"description\": \"Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015\",\n \"datasourceName\": \"Tabel7\",\n \"declarationOwnerName\": \"Tabel 7\",\n \"newestVersion\": true,\n \"id\": \"0e62c058-a6e0-4c25-a1eb-13647aef66c5\",\n \"createdAt\": \"2023-04-19T12:05:40.0244540+02:00\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.realtimelca.com/epd/api/material")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"updateFieldPaths\": [\n \"DeclaredUnit.Mass\",\n \"DeclaredUnit.MassUnit\"\n ],\n \"materials\": [\n {\n \"internalId\": \"c3cc340f-01ad-4149-9d7b-111ea48700be\",\n \"internalVersionNumber\": 1,\n \"tenantId\": \"2\",\n \"isPublic\": true,\n \"isCustom\": false,\n \"isConstruction\": false,\n \"tags\": [\n \"Zink\"\n ],\n \"lciaResultCompleteness\": 1,\n \"basedOnMaterialIds\": [],\n \"epdInfo\": {\n \"epdSpecificationForm\": 0,\n \"epdProductIndustryType\": 2,\n \"validTo\": \"2023-01-01T00:00:00.0000000\",\n \"epdVersion\": \"1.0\",\n \"publicationDate\": \"2022-05-22T00:00:00.0000000\",\n \"fileEntityId\": \"00000000-0000-0000-0000-000000000000\",\n \"declarationOwnerId\": \"00000000-0000-0000-0000-000000000000\",\n \"datasourceId\": \"cf1bca75-0e00-40f1-8666-a72e6b501e07\",\n \"declarationNumber\": \"\",\n \"link\": \"https://www.retsinformation.dk/eli/lta/2022/1464\"\n },\n \"lciaResults\": [\n {\n \"moduleTypeEnum\": 0,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 2.09\n }\n ]\n },\n {\n \"moduleTypeEnum\": 15,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0\n }\n ]\n },\n {\n \"moduleTypeEnum\": 16,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0.00068207\n }\n ]\n },\n {\n \"moduleTypeEnum\": 17,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": -1.81062\n }\n ]\n },\n {\n \"moduleTypeEnum\": 1,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 2,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 3,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 4,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 5,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 6,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 7,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 8,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 9,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 10,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 11,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 12,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 13,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 14,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n }\n ],\n \"declaredUnit\": {\n \"declaredUnit\": 1,\n \"declaredValue\": 1,\n \"mass\": 7200,\n \"massUnit\": 2\n },\n \"expectedLifespan\": 0,\n \"name\": \"Zink, patineret\",\n \"description\": \"Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015\",\n \"datasourceName\": \"Tabel7\",\n \"declarationOwnerName\": \"Tabel 7\",\n \"newestVersion\": true,\n \"id\": \"0e62c058-a6e0-4c25-a1eb-13647aef66c5\",\n \"createdAt\": \"2023-04-19T12:05:40.0244540+02:00\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.realtimelca.com/epd/api/material")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updateFieldPaths\": [\n \"DeclaredUnit.Mass\",\n \"DeclaredUnit.MassUnit\"\n ],\n \"materials\": [\n {\n \"internalId\": \"c3cc340f-01ad-4149-9d7b-111ea48700be\",\n \"internalVersionNumber\": 1,\n \"tenantId\": \"2\",\n \"isPublic\": true,\n \"isCustom\": false,\n \"isConstruction\": false,\n \"tags\": [\n \"Zink\"\n ],\n \"lciaResultCompleteness\": 1,\n \"basedOnMaterialIds\": [],\n \"epdInfo\": {\n \"epdSpecificationForm\": 0,\n \"epdProductIndustryType\": 2,\n \"validTo\": \"2023-01-01T00:00:00.0000000\",\n \"epdVersion\": \"1.0\",\n \"publicationDate\": \"2022-05-22T00:00:00.0000000\",\n \"fileEntityId\": \"00000000-0000-0000-0000-000000000000\",\n \"declarationOwnerId\": \"00000000-0000-0000-0000-000000000000\",\n \"datasourceId\": \"cf1bca75-0e00-40f1-8666-a72e6b501e07\",\n \"declarationNumber\": \"\",\n \"link\": \"https://www.retsinformation.dk/eli/lta/2022/1464\"\n },\n \"lciaResults\": [\n {\n \"moduleTypeEnum\": 0,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 2.09\n }\n ]\n },\n {\n \"moduleTypeEnum\": 15,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0\n }\n ]\n },\n {\n \"moduleTypeEnum\": 16,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": 0.00068207\n }\n ]\n },\n {\n \"moduleTypeEnum\": 17,\n \"moduleStatusEnum\": 2,\n \"indicators\": [\n {\n \"type\": 0,\n \"unit\": \"\",\n \"originalIdentifier\": \"gwp\",\n \"value\": -1.81062\n }\n ]\n },\n {\n \"moduleTypeEnum\": 1,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 2,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 3,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 4,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 5,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 6,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 7,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 8,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 9,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 10,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 11,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 12,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 13,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n },\n {\n \"moduleTypeEnum\": 14,\n \"moduleStatusEnum\": 1,\n \"indicators\": []\n }\n ],\n \"declaredUnit\": {\n \"declaredUnit\": 1,\n \"declaredValue\": 1,\n \"mass\": 7200,\n \"massUnit\": 2\n },\n \"expectedLifespan\": 0,\n \"name\": \"Zink, patineret\",\n \"description\": \"Generic environmental data published in the Danish Building Code January 2023 - Tabel 7, with the following ID: #G0015\",\n \"datasourceName\": \"Tabel7\",\n \"declarationOwnerName\": \"Tabel 7\",\n \"newestVersion\": true,\n \"id\": \"0e62c058-a6e0-4c25-a1eb-13647aef66c5\",\n \"createdAt\": \"2023-04-19T12:05:40.0244540+02:00\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
default
Response schema not yet documented in the upstream Postman spec.
⌘I

