Cypad Data Extractor (CDE) is an Application Programming Interface (API) that provides customers with a method to extract select data stored in Cypad databases through their own custom built software.
This document defines the API and is intended to be used as a manual when implementing the bespoke software to extract data from Cypad.
CDE can be connected to via a secure connection at following URL:
[Your Desktop URL]/webservices/CypadExtractData.asmx
Objects
Login
A login object is required to be supplied with each call to the CDE. This authenticates that the request is sent by an approved party.
class Login
{
string username,
string password,
Guid userID
}
username
Use valid admin account user name.
password
Use valid admin account password.
UserID
Cypad provided unique identifier assign to each system.
Functions
GetReportNames
This function returns a DataTable with available report names. These names can be passed into GetData function to retrieve relevant data.
DataTable GetReportNames
(
login Login
)
login
A login object correctly populated with valid admin username and password.
GetData
This function returns a DataTable of which the columns are dependent on the requested report type. If no relevant data exists, the function returns null.
DataTable GetData
(
login Login,
report String,
startDate DateTime,
endDate DateTime
)
login
A login object correctly populated with valid admin username and password.
report
String type report name can be retrieved using GetReportNames method defined above.
startDate
Starting date the data should be extracted for. Please note that this field is optional.
endDate
End date the data should be extracted for. Please note that this field is optional.
Reports
- Sites
Site ID, 2nd ID, Cost centre ID, Area, Name, Postcode, Type, Status, Group, Kitchen type, Prod kitchen, KS1PupPrem, KS2 PupPrem, Total PupPrem, UIFSM, KS2 Paid, All FSM, TotalKS1, Total KS2, School Roll, Adult Free, Adult Paid, Adult Total, Target Daily Meals, Pre Order Lead Time, Auto Credit Top Up Emails, ShowInWebPayments, CashCollectedOnPDA, MenuOption, PreSelectionEnabled
- TradingDays
Site ID, 2nd ID, Cost centre ID, Date, D1100 Trading Days
- PreOrders
Site ID, 2nd ID, Cost centre ID, Site name, Date, Meal type, Menu item, Pupil name, Year, Class, Account name
- ParentAccounts
Site ID, 2nd ID, Cost centre ID, Area, School, Account ID, Account registration date, Full name, Status, Child name, Child year, Child class, Child balance, Current balance
- BankedCash
Site ID, Site ID2, Cost centre ID, Date, Coins, Notes, Cheques, Total, Receipt No, Left In Safe, Status, Note
- FoodOrders
Category, Code, Stock item, Price per pack (£), Units per pack, Portions per pack, Quantity per pack, Supplier, Price by, Qty in order, Total Value (£)
- MealCosts
Site ID, 2nd ID, Cost centre ID, Area, Site, Type, Main, Dessert, Drink, Light lunch
- MealNumbersDataCollection
Site ID, 2nd ID, Cost centre ID, Description, Date, Question, Value
- MealSelection
Site ID, 2nd ID, Cost centre ID, Date, Site, Meal Type, Menu Item, Requested, Served
- PaymentAnalysis
Site ID, 2nd ID, Cost Centre ID, Site, Class, Year, Account Holder’s Name, Ref Number, Date, Entered by, Pupil Full Name, Credit/Debit card Breakdown, Cash Breakdown, Cheque Breakdown, Paypoint Breakdown, Adjustment Breakdown, Refund Breakdown, Internet Other Breakdown
- Roll
Site ID, 2nd ID, Cost Centre ID, Site, Date, Year, Class, Value
- SiteOrderSummary
Site ID, Site ID2. Cost centre ID, Order ID, Site, Status, Supplier, Created, At supplier, Confirmed, Delivery, Del. Note. Ref., Order (£), Confirmation (£), Delivery (£), Sent on, Delivery note received on
- StaffHours
Site ID, 2nd ID, Cost centre ID, Site, Name, Payroll number, Date, Staff rate, Contract hours, Worked hours, Start, End, Additional hours, Absence hours, Absence reason
- Stocktake
Code, Stock item, Price per pack (£), Units per pack, Portions per pack, Quantity per pack, Supplier, Price by, Quantity, Total Value (£)
Sample Code
Following sample code written in C# can be utilised to retrieve data. Please note that [CypadDataExtractorService] tag should be replaced with web reference name you have chosen when establishing a connection.
[CypadDataExtractorService].Service srv = new [CypadDataExtractorService].Service();[CypadDataExtractorService].Login login = new [CypadDataExtractorService].Login();
login.UserName = "[UserName]";
login.Password = "[Password]";
login.UserID = new Guid(“[Guid]” );
DataTable returnedData = srv.GetData(login, [ReportName], [StartDate], [EndDate]);
Data Extractor Reports
The following menu item information is made available via the Cypad Data Extractor (API):
-
MenuItemID
-
MenuItemName
-
MenuItemDescription
-
StockItemCode
-
StockItemName
-
PackContents
-
UnitsPerPack
-
PackPrice(£)
-
Quantity
-
UnitOfMeasure
-
Cooking Method
-
PostCookedWeight(g)
-
Cost(£)
-
CostPerPortion(£)
-
Portions
-
IsNutritionDataAvailable
-
IsWeightDataAvailable
4 New Reports have been added to the Data Extractor:
-
Menu Items: menu item details inc allergy and dietary information
-
Menus: Menu Details
-
Menu Recipes: Menu item recipes
-
Menu Item Nutritional Analysis: nutritional analysis for menu items
The following menu item information is made available via the Cypad Data Extractor (API) - Menu Item Nutritional Analysis: Nutritional Analysis for Menu Items
-
MenuItemID
-
MenuItemName
-
MenuItemDescription
-
PortionWeight (g)
-
Energy (kcal) per portion
-
Energy (kcal) per 100g
-
Fat (g) per portion
-
Fat (g) per 100g
-
Saturated Fat (g) per portion
-
Saturated Fat (g) per 100g
-
Carbohydrate (g) per portion
-
Carbohydrate (g) per 100g
-
NSP Fibre (g) per portion
-
NSP Fibre (g) per 100g
-
AOAC Fibre (g) per portion
-
AOAC Fibre (g) per 100g
-
Protein (g) per portion
-
Protein (g) per 100g
-
Iron (g) per portion
-
Iron (g) per 100g
-
Zinc (mg) per portion
-
Zinc (mg) per 100g
-
Calcium (mg) per portion
-
Calcium (mg) per 100g
-
Vitamin A (ug) per portion
-
Vitamin A (ug) per 100g
-
Vitamin C (mg) per portion
-
Vitamin C (mg) per 100g
-
Folate (ug) per portion
-
Folate (ug) per 100g
-
Sodium (mg) per portion
-
Sodium (mg) per 100g
-
Total Sugar (g) per portion
-
Total Sugar (g) per 100g
-
Salt (g) per portion
-
Salt (g) per 100g
-
Potassium (mg) per portion
-
Potassium (mg) per 100g
-
Magnesium (mg) per portion
-
Magnesium (mg) per 100g
-
Riboflavin (mg) per portion
-
Riboflavin (mg) per 100g
-
Vitamin D (ug) per portion
-
Vitamin D (ug) per 100g
-
Free Sugar (g) per portion
-
Free Sugar (g) per 100g
A “Quantity” column has been added which will display data in the following Data Extractor reports:
-
MealSelectionMealsTaken
-
MealSelectionPreOrders
-
-
-