const url = 'https://api.maalbar.dk/v1/screenings/{screeningPublicId}/packaging/{screeningMaterialPublicId}';
const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
functionalUnitValue: 0,
designedForDisassembly: false,
amount: 1,
fields: [
{
publicId: {},
locationPublicId: {},
additional: {proportion: 123, recycleShare: 123, materialUnits: {DTex: 123}}
}
],
functionalUnitKilogramValue: 123,
productionWaste: 123,
width: 123,
height: 123,
depth: 123
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));