- WhatsAMenu API
In the age of digital transformation, dining out has taken a new turn with technology at its forefront. Gone are the days of flipping through traditional paper menus or scanning QR codes only to be redirected to a plain PDF file. Now, with WhatsAMenu (What's a menu?), you can dive into the world of verbose menus, offering a detailed look at what's on your plate.
WhatsAMenu is a restaurant menu API that allows restaurants to describe their food items down to the finest details. Food category, ingredients, allergens, and associated images are all on display. You'll no longer have to guess what you're ordering. With this level of transparency, you can make informed choices about what you eat.
This API only returns data in a JSON format. It also accepts data in JSON format, unless otherwise specified.
Province | Description |
---|---|
EASTERN_CAPE | Eastern Cape |
WESTERN_CAPE | Western Cape |
NORTHERN_CAPE | Northern Cape |
NORTH_WEST | North West |
GAUTENG | Gauteng |
MPUMALANGA | Mpumalanga |
LIMPOMPO | Limpopo |
FREE_STATE | Free State |
KWAZULU_NATAL | KwaZulu-Natal |
These are the only response status codes to be expected from this API
Status |
---|
[200] - Ok |
[201] - Created |
[400] - BadRequest |
[401] - Unauthorized |
[403] - Forbidden |
[500] - InternalServerError |
- Bearer
- API Key
WhatsAMenu API currently supports Bearer token or the API Key for authentication. You receive a bearer token when you log into the system. You need the bearer token to generate the initial API key. Any subsequent API Keys can be generated using a bearer token or an API key.
The Bearer token is passed through the Authorization
header. And the API key can only be passed through the
X-API-Key
header.
Key | Allowed |
---|---|
Authorization | Bearer Token |
X-API-Key | API Key |
Content-Type | - application/json - multipart/form-data - text/event-stream |
These are all the version 1 /v1/
endpoints available to manage restaurants, accounts and menu.
Base Url: https://whatsamenu.core.wiredmartians.com
Action | Method | Resource | Current Status |
---|---|---|---|
Auth & Account | |||
Create New User Account | POST | v1/auth/sign-up |
DONE |
User Login | POST | v1/auth/sign-in |
DONE |
Create API Key | POST | v1/auth/api-key |
DONE |
Update API Key Data | PATCH | v1/auth/api-key/{id} |
DONE |
Get API Keys | GET | v1/auth/api-key |
DONE |
Get API Key By KeyAlias | GET | v1/auth/api-key/{id} |
DONE |
Forgot Password | POST | v1/auth/forgot-password |
DONE |
Reset Password | POST | v1/auth/reset-password |
DONE |
Restaurant | |||
List Restaurants | GET | v1/restaurants |
IN PROGRESS |
Create Restaurant | POST | v1/restaurants |
DONE |
Update Restaurant | PUT | v1/restaurants |
DONE |
Create Alias | POST | v1/restaurants/{id}/alias |
DONE |
Get Restaurant By Id | GET | v1/restaurants/{id} |
DONE |
Get Restaurant By Alias | GET | v1/restaurants/{alias}/alias |
DONE |
List Restaurant Menus | GET | v1/restaurants/{id}/menus |
DONE |
Delete Restaurant | DELETE | v1/restaurants/{id} |
DONE |
List Restaurants Near Me | POST | v1/restaurants/near-me |
DONE |
Search Restaurants | GET | v1/restaurants/search?query={term}&limit={limit} |
DONE |
List Restaurants By Owner | GET | v1/restaurants/owner |
DONE |
Create Restaurant Menu | POST | v1/restaurants/{id}/menu |
DONE |
Get Restaurant QR Code | GET | v1/restaurants/{id}/qrcode |
DONE |
Upload Restaurant Banner | PUT | v1/restaurants/{id}/upload |
DONE |
Menu | |||
Get Menu | GET | v1/menu/{id} |
DONE |
Ask About Menu | GET | v1/menu/enquire?menuId={menuId}&userId={userId}&prompt={query} |
IN PROGRESS |
Delete Menu | DELETE | v1/menu/{id} |
DONE |
Create Menu Group | POST | v1/menu/{id}/menu-group |
DONE |
List Menu Groups | GET | v1/menu/{id}/menu-group |
DONE |
Menu Group | |||
Update Menu Group | PUT | v1/menu-group/{id} |
DONE |
Delete Menu Group | DELETE | v1/menu-group/{id} |
DONE |
Create Grouped Menu Item | POST | v1/menu-group/{id}/menu-items |
DONE |
List Grouped Menu Items | GET | v1/menu-group/{id}/menu-items |
DONE |
Menu Item | |||
Get Menu Item | GET | v1/menu-item/{id} |
DONE |
Update Menu Item | PUT | v1/menu-item/{id} |
DONE |
Delete Menu Item | DELETE | v1/menu-item/{id} |
DONE |
Create Menu Item Allergen | POST | v1/menu-item/{id}/allergens |
DONE |
List Menu Item Allergens | GET | v1/menu-item/{id}/allergens |
DONE |
Delete Menu Item Allergen | DELETE | v1/menu-item/{id}/allergens/{allergenId} |
IN PROGRESS |
Create Menu Item Ingredient | POST | v1/menu-item/{id}/ingredients |
DONE |
List Menu Item Ingredients | GET | v1/menu-item/{id}/ingredients |
DONE |
Upload Menu Item Image | PUT | v1/menu-item/{id}/upload |
DONE |
Ingredient | |||
Update Ingredient | PUT | v1/ingredients/{id} |
DONE |
Delete Ingredient | DELETE | v1/ingredients/{id} |
DONE |
Upload Ingredient Image | PUT | v1/ingredients/{id}/upload |
DONE |
Allergen | |||
List Allergens | GET | v1/allergens |
DONE |
Get Allergen | GET | v1/allergens/{id} |
DONE |
Signing up for a new account
- Anonymous
POST v1/auth/sign-up
Password Policy:
- At least 8 characters long
- At least 1 special character (-+_!@#$%^&*.,?)
- At least one numeric character
- At least one lowercase and uppercase character
{
"email": "[email protected]",
"password": "#Sbu2@3$"
}
[201 - Created]
{
"message": "user account created"
}
[400 - Bad Request]
{
"error": "Email already exists"
}
{
"error": "password must at least be 8 characters"
}
Login user into the API
- Anonymous
POST v1/auth/sign-in
{
"email": "[email protected]",
"password": "#Sbu2@3$"
}
[200 - OK]
{
"token": "ey.............."
}
[401 - Unauthorized]
{
"error": "incorrect email or password"
}
Creates a new API key
- Bearer
POST v1/auth/api-key
The name
field is Optional
{
"name": "My iOS App Key"
}
[200 - OK]
{
"apiKey": "WM.NFrS_pfq4_R2_bda6ZUrph9w8QqV1hrIUGe1NJ1olQ8RTO3qD2Jy_dcSqFB-3zqp"
}
[400 - Bad Request]
[500 - InternalServerError]
{
"error": "Cannot perform this action at this time"
}
Gets the user's API Keys
- Bearer
- or API Key
GET v1/auth/api-keys
[200 - OK]
[
{
"name": "",
"keyAlias": "df6088dc-be04-4c9f-95d4-cf3ee0cbac63",
"userId": "18",
"status": "ENABLED"
},
{
"name": "my website",
"keyAlias": "f2124c83-489c-498c-8f02-373ebb9e4dc1",
"userId": "18",
"status": "DISABLED"
}
]
Gets the user's API Key by key alias
- Bearer
- or API Key
GET v1/auth/api-keys/{keyAlias}
[200 - OK]
{
"name": "app.wiredmartians.com",
"keyAlias": "df6088dc-be04-4c9f-95d4-cf3ee0cbac63",
"userId": "18",
"status": "ENABLED"
}
Updates API key data such as name and status
- API Key
PATCH v1/auth/api-keys/{keyAlias}
{
"name": "my website",
"status": "ENABLED"
}
[200 - OK]
{
"keyAlias": "10509d04-d865-4270-80b7-65c035d47f0c",
"name": "whatsamenu red website.io",
"status": "ENABLED"
}
[400 - Bad Request]
{
"error": "api key does not exist"
}
Sends an OTP (One-Time PIN) to the email inbox that will be used to reset the password
- Anonymous
POST v1/auth/forgot-password
{
"email": "[email protected]"
}
[200 - OK]
{
"message": "A One Time Pin has been sent to your email"
}
Resets the user's forgotten password
- Anonymous
POST v1/auth/reset-password
{
"email": "[email protected]",
"password": "P@$$w0rd!!",
"otp": "701950"
}
[200 - OK]
{
"message": "Password reset successful"
}
[400 - OK]
{
"message": "Incorrect One Time PIN (OTP)"
}
[400 - OK]
{
"message": "OTP has expired"
}
Endpoints to manage, search and filter restaurants
Creates a new restaurant
- API Key
POST - v1/restaurants
JSON BODY
Consists of restaurant information, and it's address including geo-coordinates (used to locate restaurant)
Key | Required | Description |
---|---|---|
line1 | true | Address Line 1 |
line2 | false | Optional Address Line 2 |
city | true | City |
state | true | Province (check supported enums) |
country | false | Optional country |
latitude | true | Latitude |
longitude | true | Longitude |
name | true | Restaurant name |
summary | true | Short restaurant headline |
{
"line1": "311 Peter Mokaba Rd",
"line2": "Morningside",
"city": "Durban",
"state": "KWAZULU_NATAL",
"country": "South Africa",
"latitude": 12.34385833,
"longitude": -13.238437,
"name": "Kota Place Restaurant",
"summary": "We sell the best kotas in Morningside"
}
[201 - Created]
{
"message": "restaurant created"
}
[401 - Unauthorized]
{
"error": "unable to get user claims"
}
[400 - Bad Request]
[500 - InternalServerError]
{
"error": "`Name` is a required field"
}
Updates an existing restaurant details
- API key
PUT - v1/restaurants/{restaurantId}
JSON BODY
Key | Required | Description |
---|---|---|
line1 | true | Address Line 1 |
line2 | false | Optional Address Line 2 |
city | true | City |
state | true | Province (check supported enums) |
country | false | Optional country |
latitude | true | Latitude |
longitude | true | Longitude |
name | true | Restaurant name |
summary | true | Short restaurant headline |
{
"line1": "311 Peter Mokaba Rd",
"line2": "Morning side",
"city": "Durban",
"state": "KWAZULU_NATAL",
"country": "South Africa",
"latitude": 12.34385833,
"longitude": -13.238437,
"name": "Kota Place",
"summary": "We sell the best kotas in Durban"
}
[200 - Ok]
{
"message": "restaurant updated"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
[400 - Bad Request]
{
"error": "`City` is a required field"
}
[500 - InternalServerError]
{
"error": "An error has occurred while updating restaurant"
}
Creates an alias for a restaurant. The alias is unique and formatted more like a username
- API key
POST - v1/restaurants/{id}/alias
JSON BODY
Key | Required | Description |
---|---|---|
alias | true | Restaurant id alias, e.g dukkah |
{
"alias": "Dukkah Durban"
}
[200 - Ok]
{
"data": "dukkah-durban"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
[400 - Bad Request]
{
"error": "entry already exists"
}
[500 - InternalServerError]
{
"error": "an unexpected error has occurred while processing request"
}
TODO
: refactor
Returns a list of unordered restaurants
- API key
GET v1/restaurants
[200 - OK]
[
{
"restaurantId": "134",
"name": "SALT Morningside",
"summary": "We make the best burgers in Morningside",
"distance": null,
"imageUrl": "public/restaurants/134-40a1afc36b3ee3a9d4164c3c0dc3ded5.png",
"address": {
"addressId": "1",
"line1": "Florida Morningside",
"line2": "311 Peter Mokaba Road",
"city": "Durban",
"state": "KWAZULU_NATAL",
"country": "South Africa",
"latitude": 12.088,
"longitude": 12.088
},
"updated": "",
"created": ""
}
]
[400 - Bad Request]
[500 - InternalServerError]
{
"error": "an unexpected error has occurred while processing request"
}
Gets a restaurant by its id
- API key
GET v1/restaurants/{id}
[200 - OK]
{
"restaurantId": "134",
"alias": "salt-morningside",
"name": "SALT Morningside",
"summary": "We make the best burgers in Morningside",
"distance": null,
"imageUrl": "public/restaurants/134-40a1afc36b3ee3a9d4164c3c0dc3ded5.png",
"address": {
"addressId": "1",
"line1": "Florida Morningside",
"line2": "311 Peter Mokaba Road",
"city": "Durban",
"state": "KWAZULU_NATAL",
"country": "South Africa",
"latitude": 12.088,
"longitude": 12.088
},
"updated": "2022-01-02 12:19:30",
"created": "2022-01-02 12:19:30"
}
[404 - Not Found]
{
"error": "Restaurant not found"
}
[400 - Bad Request]
[500 - InternalServerError]
{
"error": "an unexpected error has occurred while processing request"
}
Gets a restaurant by its alias, the alias is unique per restaurant, and it is a nullable field
- API key
GET v1/restaurants/{alias}/alias
[200 - OK]
{
"restaurantId": "134",
"alias": "salt-morningside",
"name": "SALT Morningside",
"summary": "We make the best burgers in Morningside",
"distance": null,
"imageUrl": "public/restaurants/134-40a1afc36b3ee3a9d4164c3c0dc3ded5.png",
"address": {
"addressId": "1",
"line1": "Florida Morningside",
"line2": "311 Peter Mokaba Road",
"city": "Durban",
"state": "KWAZULU_NATAL",
"country": "South Africa",
"latitude": 12.088,
"longitude": 12.088
},
"updated": "2022-01-02 12:19:30",
"created": "2022-01-02 12:19:30"
}
[404 - Not Found]
{
"error": "Restaurant not found"
}
[400 - Bad Request]
[500 - InternalServerError]
{
"error": "an unexpected error has occurred while processing request"
}
Lists restaurants found near specified geolocation coordinates. The distance
is in meters. The radius
is in kilometers
- API key
POST v1/restaurants/near-me
JSON BODY
{
"latitude": -29.791040,
"longitude": 31.028410,
"radius": 20
}
[200 - OK]
[
{
"restaurantId": "14",
"name": "The Ocean Terrace - The Oyster Box Hotel",
"summary": null,
"distance": 8.89917396396982,
"imageUrl": "public/restaurants/14-40a1afc36b3ee3a9d4164c3c0dc3ded5.png",
"address": {
"addressId": "33",
"line1": "Umhlanga",
"line2": "Oyter Box Hotel",
"city": "Durban",
"state": "KwaZulu-Natal",
"country": "",
"latitude": -29.727597,
"longitude": 31.087159
},
"updated": "2022-01-02 12:19:30",
"created": "2022-01-02 12:19:30"
}
]
[400 - Bad Request]
[500 - InternalServerError]
{
"error": "an unexpected error has occurred while processing request"
}
Marks a restaurant for deletion. NB Deleting a restaurant will also remove any items associated with it, such as a menu, address, menu items, groups, and ingredients.
- API Key
DELETE v1/restaurants/{id}
[200 - OK]
{
"message": "item deleted"
}
TODO
: Finish auth on this endpoint
Search for restaurants by name
- API key
GET v1/restaurants/search?query={searchTerm}&limit={limit}
- Query Params
Param | Required | Description |
---|---|---|
query | true | Search query, i.e restaurant name. NB: length must be >= 3 |
limit | false | Number of results to be returned, default: 10 |
[200 - OK]
[
{
"restaurantId": "1",
"name": "SALT Morningside",
"summary": "We make the best burgers in Morningside",
"distance": null,
"imageUrl": "public/restaurants/1-40a1afc36b3ee3a9d4164c3c0dc3ded5.png",
"address": {
"addressId": "1",
"line1": "Florida Morningside",
"line2": "311 Peter Mokaba Road",
"city": "Durban",
"state": "KwaZulu-Natal",
"country": "",
"latitude": 12.0881728,
"longitude": 12.019378
},
"updated": "2022-06-23 22:49:15",
"created": "2022-06-23 22:49:15"
}
]
[400 - Bad Request]
{
"error": "missing required search input"
}
[500 - InternalServerError]
{
"error": "an unexpected error has occurred while processing request"
}
Get a list of restaurant by owner (current authenticated user request)
- API key
GET v1/restaurants/owner
[200 - OK]
[
{
"restaurantId": "61",
"name": "Dukkah Florida",
"summary": "Hey",
"distance": null,
"imageUrl": "",
"address": {
"addressId": "80",
"line1": "Kensignton",
"line2": "2nd Beach road",
"city": "Durbz",
"state": "KWAZULU_NATAL",
"country": "",
"latitude": 0.16364,
"longitude": 1.92384872
},
"updated": "2023-08-11 19:18:05",
"created": "2023-07-29 19:47:26"
}
]
[401 - Bad Request]
{
"error": "cannot acquire user claims"
}
[500 - InternalServerError]
{
"error": "an unexpected error has occurred while processing request"
}
Creates a menu and associates it with a restaurant
- API Key
PUT - v1/restaurants/{id}/menu
JSON BODY
Key | Required | Description |
---|---|---|
name | true | Menu name |
summary | false | Brief summary of menu |
{
"name": "Steers Menu",
"summary": "Ultimate menu"
}
[201 - Created]
{
"message": "menu created"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
[400 - Bad Request]
{
"error": "`Name` is a required field"
}
Returns a list of restaurant menu, and no additional menu data such as menu items, groups or ingredients
- API key
GET v1/restaurants/{id}/menus
[200 - Ok]
[
{
"menuId": "4",
"name": "Butcher Boys Morningside",
"summary": null,
"restaurantId": "10",
"menuGroups": null,
"updated": "2023-04-09 15:38:59",
"created": "2023-04-09 15:38:59"
}
]
Returns a base64 QR Code image which is just a link to the restaurant's menu
- API key
GET v1/restaurants/{id}/qrcode
[200 - Ok]
{
"imageUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA..."
}
Uploads a restaurant display/banner image
- PNG / JPG / JPEG
- < 1MB
- API Key
PUT v1/restaurants/{id}/upload
Content-Type: multipart/form-data
Key | Required | Type |
---|---|---|
fileData | true | file |
[200 - OK]
{
"data": "public/restaurants/5-b2a7f1c6be9edf1ac591c123b6ed2f90.jpg"
}
[400 - BadRequest]
{
"error": "image too large"
}
Ask any questions related to the menu, such as allergens, food type, your budget etc. This uses an AI model underneath with the context of the menu
- Query Params
Param | Required | Description |
---|---|---|
userId | true | The user's identifier, used to retain user context |
menuId | true | The menu in question |
prompt | true | The query about the menu |
GET v1/menu/enquire
This returns a stream of JSON responses. This is best used with an EventSource
Data | Time |
---|---|
{"content":"For"} |
22:08:48.059 |
{"content":" a"} |
22:08:48.060 |
{"content":" seafood"} |
22:08:48.061 |
{"content":" option"} |
22:08:48.062 |
{"content":" within"} |
22:08:48.062 |
{"content":" a"} |
22:08:48.062 |
{"content":" R250"} |
22:08:48.063 |
{"content":" budget"} |
22:08:48.063 |
Creates a menu group/section/category within the main menu
- API Key
POST v1/menu/{id}/menu-group
JSON BODY
Key | Required | Description |
---|---|---|
name | true | Menu group/category name |
summary | false | Brief summary of menu category |
{
"name": "Beverages",
"summary": "All you can drink"
}
[200 - OK]
{
"message": "menu group created"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Returns the menu of the restaurant with all associated items
Menu Structure
- Menu
- Menu Groups[]
- Menu Items[]
- Ingredients[]
- Menu Items[]
- Menu Groups[]
- API key
GET v1/menu/{id}
[200 - Ok]
{
"menuId": "2",
"name": "Dukkah Restaurant & Bar",
"summary": "Dukkah Restaurant & Bar on Durban’s Florida road is a high point on the durban dining scene - a modern and luxuriant social hub with an upscale cocktail bar and lounge. ",
"restaurantId": "8",
"menuGroups": [
{
"menuId": "2",
"menuGroupId": "9",
"name": "Starters",
"summary": "",
"items": [
{
"menuItemId": "15",
"menuId": "2",
"menuGroupId": "9",
"name": "Chicken Croquettes",
"summary": "Thyme, anchovies, onion, garlic, mustard, chilli, Grana Padano, celery dressing",
"description": "Thyme, anchovies, onion, garlic, mustard, chilli, Grana Padano, celery dressing",
"imageUrl": "",
"price": 110,
"ingredients": [],
"updated": "2023-04-03 20:37:23",
"created": "2023-04-03 20:37:23"
},
{
"menuItemId": "22",
"menuId": "2",
"menuGroupId": "9",
"name": "Salt and Pepper Squid",
"summary": "Deep fried, asian slaw, aioli",
"description": "Deep fried, asian slaw, aioli",
"imageUrl": "",
"price": 95,
"ingredients": [],
"updated": "2023-04-03 20:54:54",
"created": "2023-04-03 20:54:54"
}
],
"updated": "2023-04-02 15:58:53",
"created": "2023-04-02 15:58:53"
},
{
"menuId": "2",
"menuGroupId": "11",
"name": "Pasta",
"summary": "",
"items": [
{
"menuItemId": "27",
"menuId": "2",
"menuGroupId": "11",
"name": "Chili Prawn Fettuccine",
"summary": "Napoli, coriander, grated pecorino",
"description": "Napoli, coriander, grated pecorino",
"imageUrl": "",
"price": 175,
"ingredients": [],
"updated": "2023-04-04 18:11:12",
"created": "2023-04-04 18:11:12"
},
{
"menuItemId": "30",
"menuId": "2",
"menuGroupId": "11",
"name": "Seafood Linguini",
"summary": "Chardonnay cream, prawns, mussels, squid, chili, gremolata",
"description": "Chardonnay cream, prawns, mussels, squid, chili, gremolata",
"imageUrl": "",
"price": 195,
"ingredients": [],
"updated": "2023-04-04 18:13:39",
"created": "2023-04-04 18:13:39"
}
],
"updated": "2023-04-02 15:59:27",
"created": "2023-04-02 15:59:27"
}
],
"updated": "2023-04-02 15:37:51",
"created": "2023-04-02 15:37:51"
}
Marks a menu for deletion. NB Deleting a menu will also remove any items associated with it, such as menu items, groups, and ingredients.
- API Key
DELETE v1/menu/{id}
[200 - OK]
{
"message": "item deleted"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Updates a menu group
- API Key
PUT v1/menu-group/{id}
JSON BODY
Key | Required | Description |
---|---|---|
name | true | Menu group/category name |
summary | false | Brief summary of menu category |
{
"name": "Meat",
"summary": "All you can eat meat meals"
}
[200 - OK]
{
"message": "menu group updated"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Deletes a menu group and all menu items attached to it
- API Key
DELETE v1/menu-group/{id}
[200 - OK]
{
"message": "item deleted"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Lists all menu groups (categories) found under a menu
- API Key
GET v1/menu/{id}/menu-groups
[200 - Ok]
[
{
"menuId": "1",
"menuGroupId": "11",
"name": "Sides",
"summary": "Sides",
"items": null,
"updated": "2022-01-08 12:21:43",
"created": "2022-01-08 12:21:43"
},
{
"menuId": "1",
"menuGroupId": "12",
"name": "Sharing",
"summary": "Sharing",
"items": null,
"updated": "2022-01-08 12:21:43",
"created": "2022-01-08 12:21:43"
}
]
List all menu items under a menu group/category/section
- API Key
GET v1/menu-group/{id}/menu-items
[200 - OK]
[
{
"menuItemId": "46",
"menuId": "18",
"menuGroupId": "20",
"name": "Ice Cream",
"summary": "Dessert that will melt your taste away",
"description": "Dessert that will melt your taste away",
"imageUrl": "",
"price": 13.65,
"ingredients": null,
"updated": "",
"created": ""
}
]
Create a menu item under a group/category
- API Key
POST v1/menu-group/{id}/menu-items
JSON BODY
Key | Required | Description |
---|---|---|
name | true | Menu item name |
summary | true | Brief summary of menu item |
description | false | Full details of the menu item |
price | false | Price of the item |
allergens | false | Menu items allergens |
{
"name": "Medium Chips",
"summary": "Get any two awesome burgers for the price of one",
"description": "The wacky wednesday special gives you 2 chicken or beef",
"price": 20.39,
"allergens": ["3", "5"]
}
[200 - OK]
{
"message": "menu item created"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Gets a menu item by id
- API Key
GET v1/menu-item/{id}
[200 - Ok]
{
"menuItemId": "10",
"menuId": "1",
"menuGroupId": "9",
"name": "Another Item",
"summary": "For those extra good mornings, start your day with a seasoned boerie patty, egg, ketchup and onion on a freshly toasted bun.",
"description": "For those extra good mornings, start your day with a seasoned boerie patty, egg, ketchup and onion on a freshly toasted bun.",
"imageUrl": "public/menu-items/1-b74b2b6acf4a14235ba2219b7511a34c.jpeg",
"price": 3,
"ingredients": null,
"updated": "2022-03-06 17:45:33",
"created": "2022-03-06 17:45:33"
}
Update a menu item
- API key
PUT v1/menu-item/{id}
JSON BODY
Key | Required | Description |
---|---|---|
name | true | Menu item name |
summary | true | Brief summary of menu item |
description | false | Full details of the menu item |
price | false | Price of the item |
menuGroupId | true | Menu group the item belongs to |
{
"name": "Nice Ice Cream",
"summary": "Best ice cream in the Milky-Way",
"description": "Melting ice-cream",
"price": 20.39,
"menuGroupId": 20
}
[200 - OK]
{
"message": "menu item updated"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Marks a menu item for deletion
- API Key
DELETE v1/menu-item/{id}
[200 - OK]
{
"message": "item deleted"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Creates/adds an allergen to a menu item
- API Key
POST v1/menu-item/{id}/ingredients
JSON BODY
Key | Required | Description |
---|---|---|
name | true | Ingredient name |
{
"name": "Tomato"
}
[201 - Created]
{
"message": "ingredient created"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Creates/adds an allergen to a menu item
- API Key
POST v1/menu-item/{id}/allergens
JSON BODY
Key | Required | Description |
---|---|---|
allergenId | true | Allergen id, use /v1/allergens for list |
{
"allergenId": "7"
}
[201 - Created]
{
"message": "allergen added"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
[500 - InternalServerError]
{
"error": "MenuItem or Allergen was not found"
}
List all ingredients of a menu item
- API Key
GET v1/menu-item/{id}/ingredients
[200 - OK]
[
{
"ingredientId": "1",
"menuItemId": "1",
"name": "Regular Bun",
"imageUrl": "public/ingredients/1-40a1afc36b3ee3a9d4164c3c0dc3ded5.png",
"updated": "2022-01-08 12:37:50",
"created": ""
}
]
Lists all allergens for a menu item
- API Key
GET v1/menu-item/{id}/allergens
[
{
"allergenId": "2",
"menuItemId": "16",
"name": "Nuts",
"summary": "Contains nuts",
"updated": "",
"created": ""
}
]
Uploads a menu item display image
- PNG / JPG / JPEG
- < 1MB
- API Key
PUT v1/menu-item/{id}/upload
Content-Type: multipart/form-data
Key | Required | Type |
---|---|---|
fileData | true | file |
[200 - OK]
{
"data": "public/menu-items/5-b2a7f1c6be9edf1ac591c123b6ed2f90.jpg"
}
[400 - BadRequest]
{
"error": ".gif file type is not allowed"
}
Updates an ingredient of a menu item
- API Key
PUT v1/ingredients/{id}
JSON BODY
Key | Required | Description |
---|---|---|
name | true | Ingredient new name |
menuItemId | true | Menu item the ingredient is for |
{
"name": "Cheese",
"menuItemId": 542
}
[200 - OK]
{
"message": "ingredient updated"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Marks an ingredient for deletion
- API Key
DELETE v1/ingredients/{id}
[200 - OK]
{
"message": "ingredient deleted"
}
[403 - Forbidden]
{
"error": "explicit deny: user not permitted to modified resource"
}
Uploads an ingredient image
- PNG / JPG / JPEG
- < 1MB
- API Key
PUT v1/ingredients/{id}/upload
Content-Type: multipart/form-data
Key | Required | Type |
---|---|---|
fileData | true | file |
[200 - OK]
{
"data": "public/ingredients/5-b2a7f1c6be9edf1ac591c123b6ed2f90.jpg"
}
[400 - BadRequest]
{
"error": "image too large"
}
Looks up an allergen by its id
- API Key
GET v1/allergens/{id}
[200 - Ok]
{
"allergenId": "2",
"name": "Nuts",
"summary": "Nuts",
"updated": "",
"created": ""
}
Returns a list of all allergens
- API Key
GET v1/allergens
[200 - Ok]
[
{
"allergenId": "2",
"name": "Nuts",
"summary": "Nuts",
"updated": "",
"created": ""
}
]