API Documentation

This page gives details on how to use Allergy Menu API. With this API, restaurant suppliers can share and update the known allergens of the dishes they are supplying to their customers.

API Endpoint URL

https://allergymenu.app/api/v1

Request Format

The Allergy Menu API is a REST service that uses JSON formatted requests and responses. The following HTTP Methods are supported:

  • GET - To return arrays of records or individual record details
  • POST - To insert a new record
  • PUT - Update existing record
  • DELETE - Remove a record

Authentication

All requests to the API must contain a custom header called Api-Key. This API key will be provided to you by the restaurant from their My Account area within Allergy Menu under the API Integration tab.

Typical HTTP request headers may look like this:

Api-Key: A71D1F837C776A2B38112BD8030E4331
Content-Type: application/json
Accept-Charset: utf-8

HTTP Response Codes

Each response from the API will have a HTTP response code indicating if it succeeded or failed.

CodeMessageDescription
200OK This is a normal response indicating that the request was successful
400Bad Request The API did not understand the request, indicating that it was not valid JSON, it was not a recognized API command, some fields were missing in the request, or some other syntax error.
401Unauthorized The Api-Key header was missing from the request or was not valid
404Not Found The API call attempted to get, update or delete a record that does not exist. This usually means that the ID in the called URL was incorrect.
405Method Not Allowed The request method was not supported for this type of request (e.g. trying to update data that is read-only)
415Unsupported Media Type The API call was not recognized as being in JSON format. Ensure that the request is JSON, and that the Content-Type request header is set to "application/json".
500Internal Server Error A generic catch-all error message which does not fall under other categories.

Implementation Notes

  • In addition to the Api-Key header, all requests should also include the Content-Type header, it's value should be "application/json".
  • Field and object names in the submitted data are case-sensitive.
  • If the API does not return a JSON response, it is because it has returned an error. The HTTP code will be something other than 200 in this circumstance. There may also be an error message returned as text/html in the HTTP response body.


Restaurant

Contains basic information about the restaurant. This information is read only.

GET

Purpose: Retrieve restaurant information
Method: GET
URL: https://allergymenu.app/api/v1/Restaurant

Response Fields

FieldDescription
Reference The six character restaurant code used by Allergy Menu to identify a restaurant. This is what the end user enters into the app.
CompanyName The name of the restaurant, take-away or food vendor.

Example Response

{
  "Restaurant":
  {
    "Reference": "AAA111",
    "CompanyName": "Bob's Bistro"
  }
}


Dishes

Get or update the dishes that make up a restaurant's menu.

GET (List)

Purpose: Retrieve a list of dishes
Method: GET
URL: https://allergymenu.app/api/v1/Dishes

Response Fields

FieldDescription
DishId Unique identifier for this dish, for this restaurant.
DishName The name of the dish.
DishDescription The description of the dish as appears in the menu.
MenuCategoryId A number that indicates if this is a starter, main course etc. See the MenuCategories Rest service for the list.
DishOrder (optional) The order by which dishes are listed in the menu, 1 being the first.
Price (optional) Menu price of the dish in including currency information or price ranges.
Live If 1, this dish will be shown on the menu. If 0, this dish will not show on the menu.
Calories (optional) Number of calories of the dish.
Veggie If 1, indicates this dish is suitable for vegetarians, otherwise 0.
Vegan If 1, indicates this dish is suitable for vegans, otherwise 0.

Example Response

{
  "Dishes": [
  {
    "DishId": 3,
    "DishName": "Spicy Chicken Wings",
    "DishDescription": "Chicken wings covered in a spicy marinade",
    "MenuCategoryId": 1,
    "DishOrder": 1,
    "Price": "£4.20",
    "Live": 1,
    "Calories": 340,
    "Veggie": 0,
    "Vegan": 0
  },
  {
    "DishId": 4,
    "DishName": "Burger and Chips",
    "DishDescription": "Steak mince beef burger with bap and sweet potato fries",
    "MenuCategoryId": 2,
    "DishOrder": 1,
    "Price": "£8.99",
    "Live": 1,
    "Calories": 756,
    "Veggie": 0,
    "Vegan": 0
  }
  ]
}

GET (Individual)

Purpose: Retrieve the details of a specific dish by it's ID (DishId)
Method: GET
URL: https://allergymenu.app/api/v1/Dishes/{DishId}

Response Fields

FieldDescription
DishId Unique identifier for this dish.
DishName The name of the dish.
DishDescription The description of the dish as appears in the menu.
MenuCategoryId A number that indicates if this is a starter, main course etc. See the MenuCategories Rest service for the list.
DishOrder (optional) The order by which dishes are listed in the menu, 1 being the first.
Price (optional) Menu price of the dish in including currency information or price ranges
Live If 1, this dish will be shown on the menu. If 0, this dish will not show on the menu.
Calories (optional) Number of calories of the dish.
Veggie If 1, indicates this dish is suitable for vegetarians, otherwise 0.
Vegan If 1, indicates this dish is suitable for vegans, otherwise 0.

Example Response

{
  "Dish":
  {
    "DishId": 3,
    "DishName": "Cauliflower Wings",
    "DishDescription": "Cauliflower wings covered in a spicy marinade",
    "MenuCategoryId": 1,
    "DishOrder": 1,
    "Price": "£4.20",
    "Live": 1,
    "Calories": 340,
    "Veggie": 1,
    "Vegan": 1
  }
}

POST

Purpose: Add a new dish. It will be returned back in the response, including the new DishId.
Method: POST
URL: https://allergymenu.app/api/v1/Dishes

Request Fields

FieldDescription
DishName The name of the new dish.
DishDescription The description of the dish as it will appear in the menu.
MenuCategoryId A number that indicates if this is a starter, main course etc. See the MenuCategories Rest service for the list.
DishOrder (optional) The order by which dishes are listed in the menu, 1 being the first.
Price (optional) Menu price of the dish in including currency information or price ranges
Live If 1, this dish will be shown on the menu. If 0, this dish will not show on the menu.
Calories (optional) Number of calories of the dish.
Veggie (optional) If 1, indicates this dish is suitable for vegetarians, otherwise 0.
Vegan (optional) If 1, indicates this dish is suitable for vegans, otherwise 0.

Example Request

{
  "Dish":
  {
    "DishName": "Feta Salad",
    "DishDescription": "Large salad with feta cheese, tomatoes and olives on a bed of leaves",
    "MenuCategoryId": 2,
    "DishOrder": 29,
    "Price": "£3.85",
    "Live": 1,
    "Calories": 490,
    "Veggie": 1,
    "Vegan": 1
  }
}

Response Fields

FieldDescription
DishId Unique identifier given to this new dish
DishName The name of the new dish.
DishDescription The description of the dish as it will appear in the menu.
MenuCategoryId A number that indicates if this is a starter, main course etc. See the MenuCategories Rest service for the list.
DishOrder (optional) The order by which dishes are listed in the menu, 1 being the first.
Price (optional) Menu price of the dish in including currency information or price ranges
Live If 1, this dish will be shown on the menu. If 0, this dish will not show on the menu.
Calories (optional) Number of calories of the dish.
Veggie (optional) If 1, indicates this dish is suitable for vegetarians, otherwise 0.
Vegan (optional) If 1, indicates this dish is suitable for vegans, otherwise 0.

Example Response

{
  "Dish":
  {
    "DishId": 123,
    "DishName": "Feta Salad",
    "DishDescription": "Large salad with feta cheese, tomatoes and olives on a bed of leaves",
    "MenuCategoryId": 2,
    "DishOrder": 29,
    "Price": "£3.85",
    "Live": 1,
    "Calories": 490,
    "Veggie": 1,
    "Vegan": 1
  }
}

PUT

Purpose: Update a dish. The updated record will be returned back in the response.
Method: PUT
URL: https://allergymenu.app/api/v1/Dishes/{DishId}

Request Fields

FieldDescription
DishName The name of the new dish.
DishDescription The description of the dish as it will appear in the menu.
MenuCategoryId A number that indicates if this is a starter, main course etc. See the MenuCategories Rest service for the list.
DishOrder (optional) The order by which dishes are listed in the menu, 1 being the first.
Price (optional) Menu price of the dish in including currency information or price ranges
Live If 1, this dish will be shown on the menu. If 0, this dish will not show on the menu. This field is typically used if you want to temporarily remove a dish from the menu, without deleting it permanently.
Calories (optional) Number of calories of the dish. If this field is omitted, the existing value (if any) will be left unchanged.
Veggie (optional) If 1, indicates this dish is suitable for vegetarians, otherwise 0. If this field is omitted, the existing value (if any) will be left unchanged.
Vegan (optional) If 1, indicates this dish is suitable for vegans, otherwise 0. If this field is omitted, the existing value (if any) will be left unchanged.

Example Request

{
  "Dish":
  {
    "DishName": "Feta Salad",
    "DishDescription": "Large salad with feta cheese, tomatoes and olives on a bed of leaves",
    "MenuCategoryId": 2,
    "DishOrder": 29,
    "Price": "£4.15",
    "Live": 1,
    "Calories": 490
  }
}

Response Fields

FieldDescription
DishId Unique identifier of this dish
DishName The name of the dish.
DishDescription The description of the dish as it will appear in the menu.
MenuCategoryId A number that indicates if this is a starter, main course etc. See the MenuCategories Rest service for the list.
DishOrder (optional) The order by which dishes are listed in the menu, 1 being the first.
Price (optional) Menu price of the dish in including currency information or price ranges
Live If 1, this dish will be shown on the menu. If 0, this dish will not show on the menu.
Calories (optional) Number of calories of the dish.
Veggie If 1, indicates this dish is suitable for vegetarians, otherwise 0.
Vegan If 1, indicates this dish is suitable for vegans, otherwise 0.

Example Response

{
  "Dish":
  {
    "DishId": 123,
    "DishName": "Feta Salad",
    "DishDescription": "Large salad with feta cheese, tomatoes and olives on a bed of leaves",
    "MenuCategoryId": 2,
    "DishOrder": 29,
    "Price": "£4.15",
    "Live": 1,
    "Calories": 490,
    "Veggie": 1,
    "Vegan": 1
  }
}

DELETE

Purpose: Delete a dish
Method: DELETE
URL: https://allergymenu.app/api/v1/Dishes/{DishId}

Response Fields

FieldDescription
Success 1 if the record was deleted, 0 if error.
Error Details of the error if any, otherwise it will be an empty string.

Example Response

{
  "Success": 1,
  "Error": ""
}


MenuCategories

Get or update the categories on the restaurant menu.

GET (List)

Purpose: Retrieve a list of menu categories (Breakfast, Starters, Mains, Deserts etc.)
Method: GET
URL: https://allergymenu.app/api/v1/MenuCategories

Response Fields

FieldDescription
MenuCategoryId Unique identifier for this category. This is unique to the restaurant. The same category for a different restaurant will have a different ID.
CategoryName The name of the category.
CategoryOrder The order in which the categories appear on the menu, 1 being the first.

Example Response

{
  "MenuCategories": [
  {
    "MenuCategoryId": 188,
    "CategoryName": "Starters",
    "CategoryOrder": 1
  },
  {
    "MenuCategoryId": 189,
    "CategoryName": "Mains",
    "CategoryOrder": 2
  },
  {
    "MenuCategoryId": 190,
    "CategoryName": "Deserts",
    "CategoryOrder": 3
  }
  ]
}

GET (Individual)

Purpose: Retrieve the details of a specific menu category by it's ID (MenuCategoryId)
Method: GET
URL: https://allergymenu.app/api/v1/MenuCategories/{MenuCategoryId}

Response Fields

FieldDescription
MenuCategoryId Unique identifier for this category. This is unique to the restaurant. The same category for a different restaurant will have a different ID.
CategoryName The name of the category.
CategoryOrder The order in which the categories appear on the menu, 1 being the first.

Example Response

{
  "MenuCategory":
  {
    "MenuCategoryId": 188,
    "CategoryName": "Starters",
    "CategoryOrder": 1
  }
}

POST

Purpose: Add a new menu category. It will be returned back in the response, along with the new MenuCategoryId.
Method: POST
URL: https://allergymenu.app/api/v1/MenuCategories

Request Fields

FieldDescription
CategoryName The name of the category.
CategoryOrder The order in which the categories appear on the menu, 1 being the first.

Example Request

{
  "MenuCategory":
  {
    "CategoryName": "Childrens Menu",
    "CategoryOrder": 4
  }
}

Response Fields

FieldDescription
MenuCategoryId Unique identifier for this category. This is unique to the restaurant. The same category for a different restaurant will have a different ID.
CategoryName The name of the category.
CategoryOrder The order in which the categories appear on the menu, 1 being the first.

Example Response

{
  "MenuCategory":
  {
    "MenuCategoryId": 91,
    "CategoryName": "Childrens Menu",
    "CategoryOrder": 4
  }
}

PUT

Purpose: Update a menu category. The updated record will be returned back in the response.
Method: PUT
URL: https://allergymenu.app/api/v1/MenuCategories/{MenuCategoryId}

Request Fields

FieldDescription
CategoryName The name of the category.
CategoryOrder The order in which the categories appear on the menu, 1 being the first.

Example Request

{
  "MenuCategory":
  {
    "CategoryName": "Kids Menu",
    "CategoryOrder": 4
  }
}

Response Fields

FieldDescription
MenuCategoryId Unique identifier for this category. This is unique to the restaurant. The same category for a different restaurant will have a different ID.
CategoryName The name of the category.
CategoryOrder The order in which the categories appear on the menu, 1 being the first.

Example Response

{
  "MenuCategory":
  {
    "MenuCategoryId": 123,
    "CategoryName": "Kids Menu",
    "CategoryOrder": 4
  }
}

DELETE

Purpose: Delete a menu category
Method: DELETE
URL: https://allergymenu.app/api/v1/MenuCategories/{MenuCategoryId}

Response Fields

FieldDescription
Success 1 if the record was deleted, 0 if error.
Error Details of the error if any, otherwise it will be an empty string.

Example Response

{
  "Success": 1,
  "Error": ""
}


Allergens

A food issue is the allergen or dish ingredient that may be of concern to the end user. These records are read only. This list is the same for every restaurant and does not change often, so you could consider caching the response for performance reasons.

GET (List)

Purpose: Retrieve a list of food issues
Method: GET
URL: https://allergymenu.app/api/v1/FoodIssues

Response Fields

FieldDescription
FoodIssueId Unique identifier for this food issue.
FoodIssueName The name or title of the food issue.
FoodIssueDescription A description of this food issue

Example Response

{
  "FoodIssues": [
  {
    "FoodIssueId": 1,
    "FoodIssueName": "Peanut",
    "FoodIssueDescription": "Peanuts are actually a legume and grow underground, which is why it’s sometimes called a groundnut. Peanuts are often used as an ingredient in biscuits, cakes, curries, desserts, sauces (such as satay sauce), as well as in groundnut oil and peanut flour."
  },
  {
    "FoodIssueId": 2,
    "FoodIssueName": "Shellfish",
    "FoodIssueDescription": "Crabs, lobster, prawns and scampi are crustaceans. Shrimp paste, often used in Thai and south-east Asian curries or salads, is an ingredient to look out for."
  },
  {
    "FoodIssueId": 4,
    "FoodIssueName": "Gluten",
    "FoodIssueDescription": "Wheat, rye, barley and oats is often found in foods containing flour, such as some types of baking powder, batter, breadcrumbs, bread, cakes, couscous, meat products, pasta, pastry, sauces, soups and fried foods which are dusted with flour"
  }
  ]
}

GET (Individual)

Purpose: Retrieve the details of a specific food issue by it's ID (FoodIssueId)
Method: GET
URL: https://allergymenu.app/api/v1/FoodIssues/{FoodIssueId}

Response Fields

FieldDescription
FoodIssueId Unique identifier for this food issue. This ID is the same between all restaurant.
FoodIssueName The name or title of the food issue.
FoodIssueDescription A description of this food issue

Example Response

{
  "FoodIssue":
  {
    "FoodIssueId": 5,
    "FoodIssueName": "Dairy",
    "FoodIssueDescription": "Milk is a common ingredient in butter, cheese, cream, milk powders and yoghurt. It can also be found in foods brushed or glazed with milk, and in powdered soups and sauces."
  }
}


Dish Allergens

Get or update what food issues apply to which dishes.

GET (List by dish)

Purpose: Retrieve a list of food issues for a particular dish
Method: GET
URL: https://allergymenu.app/api/v1/Dishes/{DishId}/DishFoodIssues

Note: The url of this method begins with "Dishes", not "DishFoodIssues".

Response Fields

FieldDescription
DishFoodIssueId Unique identifier for this food issue for this particular dish.
DishId Unique identifier for the dish.
FoodIssueId The identifier for the food issue. See the FoodIssues service for how to get the list of what these are.

Example Response

{
  "DishFoodIssues": [
  {
    "DishFoodIssueId": 5,
    "DishId": 4,
    "FoodIssueId": 7
  },
  {
    "DishFoodIssueId": 6,
    "DishId": 4,
    "FoodIssueId": 11
  },
  {
    "DishFoodIssueId": 10,
    "DishId": 4,
    "FoodIssueId": 4
  }
  ]
}

GET (Individual)

Purpose: Retrieve a specific food issue record for a specific dish
Method: GET
URL: https://allergymenu.app/api/v1/DishFoodIssues/{DishFoodIssueId}

Response Fields

FieldDescription
DishFoodIssueId Unique identifier for this food issue for this particular dish.
DishId Unique identifier for the dish.
FoodIssueId The identifier for the food issue. See the FoodIssues service for how to get the list of what these are.

Example Response

{
  "DishFoodIssue": 
  {
    "DishFoodIssueId": 5,
    "DishId": 4,
    "FoodIssueId": 7
  }
}

POST

Purpose: Add a new menu food issue to a dish. The new record will be returned back in the response. If this food issues is already listed for the specified dish, that record will be returned back unchanged.
Method: POST
URL: https://allergymenu.app/api/v1/DishFoodIssues

Request Fields

FieldDescription
DishId The unique identifier for the dish.
FoodIssueId The identifier for the food issue. See the FoodIssues service for how to get the list of what these are.

Example Request

{
  "DishFoodIssue":
  {
    "DishId": 10,
    "FoodIssueId": 7
  }
}

Response Fields

FieldDescription
DishFoodIssueId Unique identifier for the new record, used if you want to delete it later.
DishId The unique identifier for the dish.
FoodIssueId The identifier for the food issue. See the FoodIssues service for how to get the list of what these are.

Example Response

{
  "DishFoodIssue":
  {
    "DishFoodIssueId": 21,
    "DishId": 10,
    "FoodIssueId": 5
  }
}

DELETE

Purpose: Remove a food issue from a particular dish, effectively stating that this dish no longer contains this type of ingredient.
Method: DELETE
URL: https://allergymenu.app/api/v1/DishFoodIssues/{DishFoodIssueId}

Response Fields

FieldDescription
Success 1 if the record was deleted, 0 if error.
Error Details of the error if any, otherwise it will be an empty string.

Example Response

{
  "Success": 1,
  "Error": ""
}