How much stock has NOT been used?
Menu
API Docs : Product Stock Table
- August 26, 2022
- 10:51 am
How To Read From Product Stock
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-stock?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-stock?venue=Example"&"key=recKgh89gvV7wBxpH
How To Write To Product Stock
You can use any of the columns listed below when communicating with our database:
The name of the product which stock is being recorded for
Javascript Post Request Example
const axios = require('axios');
const data = JSON.stringify([
{
"fields": {
"Date": ""2022-02-28"",
"Product": ["rec8116cdd76088af"],
"Stock Remaining": 5000
}
},
{
"fields": {
"Date": ""2022-02-28"",
"Product": ["rec8116cdd76088af"],
"Stock Remaining": 3000
}
}
]);
const options = {
headers: {"content-type": "application/json"}
}
axios.post(' https://3f8ni4ce9j.execute-api.eu-central-1.amazonaws.com/rubbish-tracker/api/table/product-stock?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' ]