API - Cypad Data Extractor

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 article will...

Define the API and how it is intended to be used as a manual when implementing the bespoke software to extract data from Cypad.

IMPORTANT

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 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 a valid admin account user name.

password

Use a valid admin account password.

UserID

Unique identifier assign to each user by Cypad.

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

DataCollectionMealNumbers

Site ID, Site DFE, Site Name, Date, Question, Value

MealSelectionMealsTaken

Site ID, Site DFE, Site Name, Student Type, Student ID, Student MIS ID, Student Name, Student Class, Transaction Date, Menu Category, Menu Type, Menu Item ID, Menu Item, Meal Price, Free Portion, Meal Status

MealSelectionPreOrders

Site ID, Site DFE, Site Name, Student Type, Student ID, Student MIS ID, Student Name, Student Class, Required Date, Menu Type, Menu Item ID, Menu Item

SiteRollNumbers

Site ID, Site DFE, Site Name, Date, Year, Year Status, Class, Total, FSM

StaffHours

Staff Name, Payroll Number, Employee Number, Role Worked, Pay Rate, Site Worked, Site ID, Contract Minutes, Worked Minutes, Absent Minutes, Absent Reason, Absent Note, Start Time, End Time, Extra Minutes, Non-Productive Minutes, Non-Productive Reason, Timesheet Approved, Timesheet Approved By

StockItemsOrderedDelivered

Site ID, Site DFE, Site Name, Order ID, Order Status, Supplier Name, Supplier Type, Stock Code, Stock Item, Unit Price, Quantity Ordered, Ordered Value, Quantity Delivered, Delivered Value, Created Date, Sent To Supplier Date, Delivery Date, Delivered Date, Delivery Note Reference

Stocktake

Site ID, Site DFE, Site Name, Sign Off Date, Stock Category, Stock Code, Stock Item, Quantity Per Pack, Portions Per Pack, Price Per Pack, Units Per Pack, Priced In, Supplier Name, Supplier Type, Units In Stock, Total Value

StocktemplateItems

Template Name, Stock Category, Stock Code, Stock Item, Quantity Per Pack, Portions Per Pack, Price Per Pack, Units Per Pack, Supplier Name, Supplier Type, Stock Category Level 1, Stock Category Level 2

Report Dates

Report Start/End Date
DataCollectionMealNumbers Data entered in selected date range
MealSelectionMealsTaken Meals marked as taken in selected date range
MealSelectionPreOrders Meals required in selected date range
SiteRollNumbers Roll numbers when report is called
StaffHours Staff hours recorded in selected date range
StockItemsOrderedDelivered Orders created in selected date range
Stocktake Stocktakes signed off in selected date range
StockTemplateItems Items on stock templates when report is called

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]);
Was this article helpful?
1 out of 1 found this helpful