FootfallCam 3D Plus User manual

www.footfallcam.com API Documentation
1
USER MANUAL
For FootfallCam 3D Plus

www.footfallcam.com API Documentation
2
Table of Content
1.0Overview
2.0ExportFootfall DatatoRetailerSystem
2.1Pull DataviaAPI
2.2Pull DatafromCentralDatabase
2.3Pull Data fromFTPServer
2.4DownloadCSVfromFootfallCam Portal
3.0ImportDatafrom RetailerSystem
3.1PushDataviaAPI
3.1.1 ePOSData
3.1.2 StaffLabour Hours
3.2PushDatatoFTPServer
1
2
3
3
4

www.footfallcam.com API Documentation
3
1.0 Overview
FootfallCam is a fully embedded software module, intended for any environment where store footfall counting is required. Business
intelligence (BI) system extracts and analyses footfall data (from FootfallCam central server) together with ePOS data or staff labour hours
(from retailer’s ePOS system or staff management system) to produce management report for corporate strategic planning.
There areseveral ways of integrating footfall data with the ePOS data or staff labour hours:
Exportfootfalldata toretailersystem
ImportePOSdataorstafflabourhourstoFootfallCamcentralserver
2.0 Export Footfall Data to Retailer System
2.1 Pull Data via API
The camera automaticallycollects the traffic data and builds them into a convenient JSON/XML data file that can be retrieved easily via a web
service API call, hence allowing seamless integration of the camera into any existing solution. Through an API call, the data file will be
extracted from FootfallCam portalto the business intelligence system for further data processingin orderto generate the management report.
Title
GetCountingData
Description:APIFunctiontoreceivecountingdata.
Countingdataincludes Timestamp,numberofIncountper15minutes,numberofOutcountper15minutes
URL
http://<ipto counter>:<port>/pi-cgi/data.json(JSONFormat)
http://<ipto counter>:<port>/pi-cgi/data.xml(XMLFormat)
Method
GET

www.footfallcam.com API Documentation
4
URLParams
Optional:-
Name
Value
Description
date
omit
Singleday-<YYYYMMDD>
Daterange–
<YYYYMMDD>-<YYYYMMDD>
omit–The currentdaydata
Singleday–Dataonthe
specifiedday
Daterange–Dataonthe
specifieddatarange,both
startingandending isinclusive
DataParams
None
Success Response
(JSON)
Example:
Content:{
"cameraData": {
"companyCode":"<CompanyCode>",
"cameraName":"<Counter Name>",
"offset": <offset>
},
"data":[
{
"timestamp":<timestamp>,
"inCount": <valuein>,
"outCount":<valueout>
}]
}
Success Response
(XML)
<?xml version=”1.0” ?>
<countdata>
Where <count data>is
<countdata version="2">
<countset>
</countdata>
<typedesc>is descriptionofcounttype,where3representIn,and4 representOut.
<typedesc>
<typetypeid="3">Pedestriancomingin</type>
<typetypeid="4">Pedestriangoingout</type>
</typedesc>
and<countset>is
<cntsetname="<CompanyCode>-<CounterName>"starttime="<starttime>" delta="<delta>">
<countgroup>
</cntset>

www.footfallcam.com API Documentation
5
<starttime>isPOSIXformat(secondssince00:00:00UTC,January1,1970)fortheday
<delta>isthetimeinterval specifiedinsecondsbetweeneachentryand<countgroup>is
<cntgroupendtime="<endtime>">
<cnttypeid="3"><valuein></cnt>
<cnttypeid="4"><valueout></cnt>
</cntgroup>
SampleCall
curlhttp://<ipto counter>:<port>/pi-cgi/data.json?date=20140101-20140131
Notes
None
2.2 Pull Data from Central Database
Insteadof usingAPI,users may choose to extractthe footfall data directly from FootfallCam CentralDatabase. This involves establishing a
remote connectiondirectly to the databasetoextract thedata from the relevant table to the business intelligence system.
Title
GetBranchList
Description:SQLFunction toretrieve branch list.
BranchdataincludeBranchId,Name,Region, City, Country,StoreType,Latitude,Longitude and FloorSize
FunctionName
GetBranchList
Method
SQL
DataParams
Username[nvarchar]
Password[nvarchar]
Success Response
SampleCall
SELECT*FROMGetBranchList('username','password');
Notes
None

www.footfallcam.com API Documentation
6
Title
GetCounterByBranch
Description:SQLFunction toretrieve countersfilteredbybranch.
Counterdatainclude CounterId,Name,IP,Port, Serial
FunctionName
GetCounterByBranch
Method
SQL
DataParams
Username[nvarchar]
Password[nvarchar]
BranchId [bigint]
Success Response
SampleCall
SELECT*FROMGetCounterByBranch('username','password',37);
Notes
None
Title
GetCounterCounting
Description:SQLFunction toretrieve countingfiltered bycounter.
CountingdataincludeCounter(inhourlyinterval),ValueDateTime,ValueIn,ValueOut,OutsideTraffic,Day,
CounterId
FunctionName
GetCounterCounting
Method
SQL
DataParams
Username[nvarchar]
Password[nvarchar]
CounterId[bigint]
StartDate[datetime]
EndDate[datetime]
Success Response
SampleCall
SELECT*FROMGetCounterCounting('username','password',410,'2015-03-2000:00:00','2015-03-20
23:59:59');
Notes
None

www.footfallcam.com API Documentation
7
Title
GetCounterDailySummary
Description:SQLFunction toretrieve dailysummaryfilteredbycounter
Counting datainclude Date (POSIXTimestamp),CameraName,ValueIn, ValueOut,OutsideTraffic,
TurnInRate,LessThanFifteen,LessThanThiry,OverThirty,NewCustomer,ReturnInWeek,ReturnInMonth,
CounterId
FunctionName
GetCounterDailySummary
Method
SQL
DataParams
Username[nvarchar]
Password[nvarchar]
CounterId[bigint]
StartDate[bigint](POSIXTimestamp)
EndDate[bigint](POSIXTimestamp)
Success Response
SampleCall
SELECT*FROMGetCounterDailySummary('username','password',410,1426809600,1426896001);
Notes
None
2.3 Push to FTP Server
A dedicated FTP server will be provided by retailer as a ‘shared folder’ where access (link, username and password) will be given to
FootfallCam technical team to dump the footfall data (.csv files) into it. These data will then being retrieved from the FTP Server to the
business intelligencesystem for furtherdata processing to generate the management report.

www.footfallcam.com API Documentation
8
2.4 Download CSV from FootfallCam Portal
Footfall data will be stored and updated to central server every 15 minutes automatically. Retailer will be given access (link,username and
password) to access FootfallCamportal to access these data anddownload it in .csv, PDF format,etc.
CSV Sample Data
Name
Symbol
Separator
,(comma)
3.0 Import Data from Retailer System
3.1 Push Data via API
Through an API call, retailer system sends a http request (containing ePOS data, staff labour hours, etc.) to FootfallCam central server.
FootfallCam central server returns a status to retailer’s system, indicating if the request is successful or fail. The data received from retailer’s
system will be further processed to integrate with the footfall data and generate reports in FootfallCam portal.
3.1.1 ePOSData
Title
PostTransaction
Description:APIFunctiontoreceiveTransactiondata.
Transactiondataincludingtimestamp,numberoftransactionper15minutes,averageamountper15
minutes.
Eachdataentrymustbein15minutesinterval.
URL
http://footfallcounter.com/api/Action/PostTransaction
Method
POST
URLParams
None

www.footfallcam.com API Documentation
9
DataParams
SecretKey:[String]Secretkeyprovidedbyfootfallcamforauthenticationpurpose.
Data:Arrayofdataentriesasbelow:
Example:
{
SecretKey:“0E6A48F765D0FFFFF6247FA80D748E615F91DD0C7431E4D9”,
Data:[{
Timestamp: 1418688000,
TransactionCount:10,
AverageAmount:500.00
},
{
Timestamp: 1418688900,
TransactionCount:8,
AverageAmount:420.00
},
{
Timestamp: 1418689800,
TransactionCount:14,
AverageAmount:530.00
}]
}
Success Response
Example:
Code:200
Content: {Response:“OK” }
ErrorResponse
Example:
Code:401UNAUTHORIZED
Content: {error:" UNAUTHORIZED "}
OR
Code:422UnprocessableEntry
Content: {error:"InvalidStructure"}
SampleCall
$.ajax({
url:"http://controlpanel.retailcam.co.uk/api/Action/PostTransaction",
dataType: "json",
data: {
SecretKey:“0E6A48F765D0FFFFF6247FA80D748E615F91DD0C7431E4D9”,
Data:[{
Timestamp :1418688000,
TransactionCount:10,
AverageAmount:500.00
},
{
Timestamp :1418688900,
TransactionCount:8,
AverageAmount:420.00
},
{
Timestamp :1418689800,
TransactionCount:14,
Timestamp :[long]Timestamp forevery15minutes
TransactionCount:[int]Numbersoftransactionwithinin15minutes
AverageAmount:[double]Averageamount oftransaction within15minutes

www.footfallcam.com API Documentation
10
AverageAmount:530.00
}]
},
type :"POST",
success:function(r){
console.log(r);
}
});
Notes
Timestampmustbein15minutesintervalforeachrecord.
3.1.2 StaffLabour Hours
Title
PostStaffLabourHour
Description:APIFunctiontoreceiveStaffdata.
Dataincludingtimestamp,numberofstaffper15minutes
Eachdataentrymustbein15minutesinterval.
URL
http://footfallcounter.com/api/Action/PostStaffLabourHour
Method
POST
URLParams
None
DataParams
SecretKey:[String]Secretkeyprovidedbyfootfallcamforauthenticationpurpose.
Data:Arrayofdataentriesasbelow:
Example:
{
SecretKey:“0E6A48F765D0FFFFF6247FA80D748E615F91DD0C7431E4D9”,
Data:[{
Timestamp: 1418688000,
StaffCount:1
},
{
Timestamp: 1418688900,
StaffCount:1
},
{
Timestamp: 1418689800,
StaffCount:2
}]
}
Success Response
Example:
Code:200
Content: {Response:“OK” }
ErrorResponse
Example:
Code:401UNAUTHORIZED
Content: {error:" UNAUTHORIZED "}
OR
Code:422UnprocessableEntry
Timestamp :[long]Timestamp forevery15minutes
StaffCount:[int]NumbersofStaffwithinin15minutes

www.footfallcam.com API Documentation
11
Content: {error:"InvalidStructure"}
SampleCall
$.ajax({
url:"http://controlpanel.retailcam.co.uk/api/Action/PostStaffLabourHour",
dataType: "json",
data: {
SecretKey:“0E6A48F765D0FFFFF6247FA80D748E615F91DD0C7431E4D9”,
Data:[{
Timestamp :1418688000,
StaffCount:1
},
{
Timestamp :1418688900,
StaffCount:1
},
{
Timestamp :1418689800,
StaffCount:2
}]
}
type :"POST",
success:function(r){
console.log(r);
}
});
Notes
Timestampmustbein15minutesintervalforeachrecord.
3.2 Push Data to FTP Server
A dedicated FTP server will be provided by FootfallCam as a ‘shared folder’ where access (link, username and password) will be given for
retailer to dump the ePOS data, staff labour hours, etc. into it. These data will then being retrieved, further processed to integrate with the
footfall data and generate reports in FootfallCam portal.
Other manuals for 3D Plus
2
Table of contents
Other FootfallCam Webcam manuals