API Documentation

There are 7 actions that the API supports, each action is called by visiting http://45.79.22.177/ + the action name, for example: http://45.79.22.177/Recipe

Each endpoint consumes URL parameters, and provides information back either as a JSON object, as plain text, or as a binary stream (file).

Endpoints act as an intermediary between the website and either the OneSource application (calls their REST endpoints), or the database (using custom queries).

Categories

http://45.79.22.177/Categories

Retrieves a list of all categories available for recipe searches.

Used to populate categories for the recipe search page.

Manually pulled via a database query.

Parameters:

Returns: JSON

	[
		{
			"id": , // Type: string(UUID)
			"name": , // Type: string
		},
		//...
	]

Export

http://45.79.22.177/Export

Exports a scaled recipe to a downloadable file from OneSource.

Used to allow export of scaled recipe files on individual recipe pages.

Uses a built-in OneSource endpoint.

Parameters:

Returns: Binary

Ingredients

http://45.79.22.177/Ingredients

Retrieves an ingredient list for a scaled recipe.

Used to build the scaled recipe table on individual recipe pages.

Uses a built-in OneSource endpoint.

Parameters:

Returns: JSON

{
	"recipenumber": , // Type: string (unused)
	"recipename": , // Type: string (unused)
	"Yield": , // Type: string(int) (unused)
	"Ingredients": [
		{
			"sequence": , // Type: string(int)
			"id": , // Type: string
			"description": , // Type: string
			"amount1": , // Type: string
			"measure1": , // Type: string
			"operand": , // Type: string (unused)
			"amount2": , // Type: string
			"measure2": , // Type: string
			"totalgrams": , // Type: string(float)
		},
		// ...
	]
}

Recipe

http://45.79.22.177/Recipe

Retrieves general information for a recipe, including instructions, serving, and nutrition information.

Used as the primary content on individual recipe pages.

Manually pulled via a database query.

Parameters:

Returns: JSON

{
	"RecipeNumber": , // Type: string
	"RecipeName": , // Type: string
	"IsHot": , // Type: int
	"RecipeSource": , // Type: string
	"StandardServings": , // Type: int
	"BatchQuantity": , // Type: int
	"StandardServingSize": , // Type: string
	"StandardServingMeasure": , // Type: string
	"ServingDescription": , // Type: string
	"NutritionLink": , // Type: int
	"Category": , // Type: string
	"HACCP": ,
	"HACCPProcessCategory": , // Type: string
	"PrePreparationInstructions": , // Type: string
	"PreparationInstructions": , // Type: string
	"ServingInstructions": , // Type: string
	"MeasureFactor": , // Type: string(float)
	"Nutrition": {
		"Protein": , // Type: float
		"Total Fat": , // Type: float
		"Carbohydrate": , // Type: float
		"Ash": , // Type: float
		"Food Energy": , // Type: float
		"Moisture": , // Type: float
		"Total Dietary Fiber": , // Type: float
		"Calcium": , // Type: float
		"Iron": , // Type: float
		"Sodium": , // Type: float
		"Vitamin A (IU)": , // Type: float
		"Vitamin A (RE)": , // Type: float
		"Vitamin C": , // Type: float
		"Cholesterol": , // Type: float
		"Total Trans": , // Type: float
		"Saturated Fat": , // Type: float
		"Fruits": , // Type: float
		"Vegetables, Total": , // Type: float
		"Vegetables, Dark Green": , // Type: float
		"Vegetables, Red/Orange": , // Type: float
		"Vegetables, Legumes": , // Type: float
		"Vegetables, Starchy": , // Type: float
		"Vegetables, Other": , // Type: float
		"Grains": , // Type: float
		"Meats/Meat Alternates": , // Type: float
		"Fluid Milk": , // Type: float
		"Vegetables, Additional": , // Type: float
		"Grains, Whole, Rich": , // Type: float
		"Grains, Dessert": , // Type: float
		"Juice, Fruit": , // Type: float
		"Juice, Vegetable": , // Type: float
		"Milk, Skim Unflavored": , // Type: float
		"Milk, Skim Flavored": , // Type: float
		"Milk, Low Fat Unflavored": , // Type: float
		"Milk, Low Fat Flavored": , // Type: float
		"Milk, Reduced Fat/Whole": , // Type: float
	}
}

Recipes

http://45.79.22.177/Recipes

Searches for recipes.

Used to filter/search recipes for the main recipe search page.

Manually pulled via a database query.

Parameters:

Returns: JSON

[
	{
		"id": , // Type: string
		"name": , // Type: string
		"isHot": , // Type: bool
		"categoryId": , // Type: string
	},
	// ...

Report

http://45.79.22.177/Report

Exports a nutrition or cost analysis for a recipe to a downloadable file from OneSource.

Used to allow export report files on individual recipe pages.

Uses a built-in OneSource endpoint.

Parameters:

Returns: Binary

Status

http://45.79.22.177/Status

Performs a test against a OneSource endpoint to make sure the service is functional.

Used for debugging/maintenance, not on the live site.

Uses a built-in OneSource endpoint.

Parameters:

Returns: Text