This is the ID we use to identify this collection
Menu
API Docs : Waste Collection Table
- August 26, 2022
- 10:51 am
How To Read From Waste Collection
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/waste-collection?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/waste-collection?venue=Example"&"key=recKgh89gvV7wBxpH
How To Write To Waste Collection
You can use any of the columns listed below when communicating with our database:
This is the collector facility which the material was delivered to.
The date that the collection occured
Stream captured as part of this collection
Which venue was the waste collected from?
Waste collector company who has picked up the material
Total weight (in tonnes) that was collected as part of this entry
Javascript Post Request Example
const axios = require('axios');
const data = JSON.stringify([
{
"fields": {
"Date": "2022-05-12",
"Venue/Location": [
"rec6WP5bsnjLm5i18"
],
"Waste Collector": [
"recDw2uSBfyc03dVQ"
],
"Distance (km)": 191.477,
"Weight Collected": 1.06,
"Stream Collected": [
"recxIURdHSYjlno99"
],
"Waste Stats Logbook": [
"rec9K6bRPLmkBfyr1"
],
"Collector Facility": [
"recnVCmOetcpZjwrY"
]
}
},
{
"fields": {
"Date": "2022-05-13",
"Venue/Location": [
"recXW58JYhzyM6Odn"
],
"Waste Collector": [
"recDw2uSBfyc03dVQ"
],
"Distance (km)": 311.441,
"Weight Collected": 0.8,
"Stream Collected": [
"rectLUOwQU94379ox"
],
"Waste Stats Logbook": [
"reckhZQN6GkpaCUQd"
],
"Collector Facility": [
"recnVCmOetcpZjwrY"
]
}
}
]);
const options = {
headers: {"content-type": "application/json"}
}
axios.post(' https://3f8ni4ce9j.execute-api.eu-central-1.amazonaws.com/rubbish-tracker/api/table/waste-collection?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' ]