You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Snack vending machines in offices are the worst. They are stocked with snacks that either unhealthy or old and stale - and they are always in dire need of a restock. Nobody gets a say in which snacks are stocked or when they should be rotated or re-stocked. With Snackify - the office snack subscription service and app - send your office snacktime woes packing faster than Janet from HR did to your annoying cubicle-mate last week!
A POST request to the auth/login/organization endpoint expects to recieve an object as follows:
{"username": "username","password": "happytree"}
A POST request to the auth/login/employee endpoint expects to recieve an object as follows:
{"username": "username","password": "happytree"}
NOTE: If successful, a JSON Web Token will be returned. This must be stored and used as authentication for API calls to snacks, subscriptions and request endpoints.
A GET request to the auth/employees enpoint will return an object as follows:
NOTE: For PUT requests an object only containing the changed field is required, if the field is to remain the same it is not needed. An 'id' isn't needed for POST requests.
Field
Type
monthlyFee
Float
lengthOfSubscription
Datetime
nameOfSubscription
String
Snacks
A GET, PUT, POST request to the /snacks endpoint will return an object as follows:
NOTE: For PUT requests an object only containing the changed field is required, if the field is to remain the same it is not needed. An 'id' isn't needed for POST requests.
Field
Type
name
string
numberOfServings
Integer
totalWeight
Float
price
Float
Nutrition
A GET, PUT, POST request to the /snacks/nutrition endpoint will return an object as follows:
NOTE: For PUT requests an object only containing the changed field is required, if the field is to remain the same it is not needed. An 'id' isn't needed for POST requests.
Field
Type
calories
Float
totalFat
Float
totalSugars
Float
protein
Float
carbs
Float
allergens
string
Request
A GET, PUT, POST request to the /request endpoint will return an object as follows:
{"id": 2,"snackName": "Name","subId": 1}
NOTE: For PUT requests an object only containing the changed field is required, if the field is to remain the same it is not needed. An 'id' isn't needed for POST requests.
Purchase
A GET, PUT, POST request to the /purchase endpoint will return an object as follows:
{"id": 2,"snackName": "Name","subId": 1}
NOTE: For PUT requests an object only containing the changed field is required, if the field is to remain the same it is not needed. An 'id' isn't needed for POST requests.