API Docs : Product List Table

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:

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"

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' ]