How much recycled content is included in the product?
Menu
API Docs : Product List Table
- August 26, 2022
- 10:51 am
How To Read From Product List
You can use any of the columns listed below when communicating with our database:
Javascript Get Request Example
const axios = require('axios');
axios
.get('https://3f8ni4ce9j.execute-api.eu-central-1.amazonaws.com/rubbish-tracker/api/table/product-list?venue=Example&key=recKGDfugvV46BxpH'
)
.then(res => {
console.log(res.data.Retrieved);
})
.catch(error => {
console.error(error);
});
Get Request ‘curl’ Example
curl https://3f8ni4ce9j.execute-api.eu-central-1.amazonaws.com/rubbish-tracker/api/table/product-list?venue=Example"&"key=recKgh89gvV7wBxpH
How To Write To Product List
You can use any of the columns listed below when communicating with our database:
The name of the product being added to the venue based on our product list
How much
Type of product, with a selection of choices from "Bottle", "Can", "Cup", "Lid", "Tray" or "Reusable Cup"
Product code used by the manufacturer to identify the item. Check we don't already have your product in our database before you add a new one!
What material is the product made from? Choose from "rPET", "Aluminium", "Glass"," PET", "PLA", "PS" or "PP"
What is the colour grade? choose from the options "Clear", "Red", "Blue", "Green", or "Pink".
What is the capacity in milliliters (ml) of the product?
Javascript Post Request Example
const axios = require('axios');
const data = JSON.stringify([
{
"fields": {
"Product Type": "Bottle",
"Capacity (ml)": 300,
"Material": "rPET",
"Colour Grade": "Clear",
"Recycled Content": 0.5,
"Carbon Rate": [
"recIEtBRWDXTKquwL"
]
}
},
{
"fields": {
"Product Type": "Bottle",
"Capacity (ml)": 330,
"Material": "Glass"
}
}
]);
const options = {
headers: {"content-type": "application/json"}
}
axios.post(' https://3f8ni4ce9j.execute-api.eu-central-1.amazonaws.com/rubbish-tracker/api/table/product-list?venue=Example&key=recKGDlu45gyBxpH', data, options)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
Javascript Post Response Data Example
[ 'recgj7rzZ9SeuZdmZ', 'recpsw3rdaMeHPWJy' ]