Reference for the delivery. If multiple deliveries are made as part of one delivery they should use the same delivery reference
Menu
API Docs : Delivery Table
- August 26, 2022
- 10:51 am
How To Read From Delivery
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/delivery?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/delivery?venue=Example"&"key=recKgh89gvV7wBxpH
How To Write To Delivery
You can use any of the columns listed below when communicating with our database:
Date that the delivery was made
Which distributor supplied these products? If it came directly from a manufacturer you can select their address.
Which product was delivered?
Which Venue is uploading the data? (note for nick - can we add venue IDs automatically?)
How many products were delivered to site
Javascript Post Request Example
const axios = require('axios');
const data = JSON.stringify([
{
"fields": {
"Product Delivered": [
"recv2ZmpKPgfG92BZ"
],
"Delivery Reference": "1",
"Venue/Location": [
"rec6WP5bsnjLm5i18"
],
"QTY Products Delivered": 46020,
"Date": "2022-05-06",
"Distributor": [
"rec1XP9DWdKB9gBWu"
],
"Distance (km)": 20.166
}
},
{
"fields": {
"Product Delivered": [
"recHHcTrNBlqoj2mv"
],
"Delivery Reference": "1",
"Venue/Location": [
"rec6WP5bsnjLm5i18"
],
"QTY Products Delivered": 230021,
"Date": "2022-05-06",
"Distributor": [
"rec1XP9DWdKB9gBWu"
]
}
}
]);
const options = {
headers: {"content-type": "application/json"}
}
axios.post(' https://3f8ni4ce9j.execute-api.eu-central-1.amazonaws.com/rubbish-tracker/api/table/delivery?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' ]