Authentication

Method Query Plan Section Expected Result
GET /api/ApiCheck D1
App checks auth-free API to server
200 - OK               true
GET /api/Guard?inputScan=PP_EmployeeCode_|TNNOaZwQauZrSjhjPN1kFQ== D2
App confirms guard valid
200 - OK {
"EmployeeID": 1051,
"EmployeePIN": "11234",
"EmployeeFullName": "Xolani"
}
400 - Bad Request {"Message": "Card does not belong to an employee."}
400 - Bad Request {"Message": "Employee is not a registered guard."}
POST /Token D3
App requests token auth
200 - OK                {
"access_token": "pow9GF0rbl4PxbFpEEt8KCzKZoC3asCd9DWKqfhKD",
"token_type": "bearer",
"expires_in": 1209599,
"userName": "kevin2@tgdev.co.za",
".issued": "Wed, 20 Feb 2019 12:45:37 GMT",
".expires": "Wed, 06 Mar 2019 12:45:37 GMT"
}
GETAuth /api/Site D3
App requests site list
200 - OK                [
{
"LocationID": 5,
"LocationName": "Hilton Construction Site",
"LocationAddress": "6A Quarry Road, Hilton"
},
{
"LocationID": 8,
"LocationName": "Oldfield Business Park",
"LocationAddress": "25 Haworth Road, Mkondeni, PMB, 3201"
}
]
POSTAuth /api/Guard?id=1056&locationId=5&geolocation=-29.6058074,30.3393265 D4
App records guard and site location
201 - Created          {
"GuardLogId": 2,
"EmployeeId": 1056,
"LocationId": 5,
"GuardLogDate": "2019-02-20T14:51:12.482814+02:00",
"GuardLogGeolocation": "-29.6058074,30.3393265",
"GuardLogTranslation": null
}
400 - Bad Request {"Message": "Guard ID mismatch. Please try again or contact XXX"}
400 - Bad Request {"Message": "Location ID mismatch. Please try again or contact XXX."}
400 - Bad Request {"Message": "Unable to capture guard login. Please try again or contact XXX :- EXCEPTION}"}

Auto Sign Out

Method Query Plan Section Expected Result
POST api/AutoSignOut Perform Midnight Sign Out
200 - OK                true
200 - OK                false

Employees

Method Query Plan Section Expected Result
POSTAuth api/EmployeeScan?inputScan=PP_EmployeeCode_|TNNOaZwQauZrSjhjPN1kFQ== Receive scanned QR Code
200 - OK               {
"EmployeeID": 1051,
"EmployeeFullName": "Xolani Mhlongo (Satan) ",
"EmployeeProfilePicture": "http://trackyard.tgapps.co.za/Media/EmployeeProfiles/8612226053084_7634.jpg",
"EmployeePersonnelLogId": 0
}
400 - Bad Request {"Message": "Card does not belong to an employee."}
400 - Bad Request {"Message": "Employee is disabled."}
400 - Bad Request {"Message": "Employee is not a registered guard."}
POSTAuth /api/EmployeeScan?id=1051&guardId=1056&siteId=6&personnelLogId=0&geolocation=-29.6058074,30.3393265 Mark Employee Code as signed-in/signed-out
200 - OK               {
"ID": 6511,
"PersonnelID": 1051,
"GuardID": 1056,
"CodeTypeID": 1,
"CodeLocationId": 6,
"LogDate": "2019-02-27T15:54:54.9735569+02:00",
"LogSignedState": true,
"LogGeolocation" : "-29.6058074,30.3393265"
"LogNotes": "Employee Logged In Successfully at: 2019-02-27 03:54:55 PM by Xolani Mhlongo",
"LogSignoutNormal": true,
"LinkPersonnelCodeLogID": 0
}
400 - Bad Request {"Message": "Employee ID mismatch. Please try again or contact XXX"}
400 - Bad Request {"Message": "Guard ID mismatch. Please try again or contact XXX."}
400 - Bad Request {"Message": "Location ID mismatch. Please try again or contact XXX."}
400 - Bad Request {"Message": "Could not capture guard login, an error has occured." + EXCEPTION}

Access List

Method Query Plan Section Expected Result
GETAuth /api/AccessList/10 Receive list of employees signed into the current site.
200 - OK               {
"EmployeeID": 1051,
"EmployeeFullName": "Xolani Mhlongo",
"EmployeeProfilePicture": "http://trackyard.tgapps.co.za/Media/EmployeeProfiles/8612226053084_7634.jpg",
"LogDate": "2019-03-05T11:56:46.63"
}
Method Query Plan Section Expected Result
GETAuth /api/AccessSubContractorList/5 Receive list of Subcontractors signed into the current site.
200 - OK               {
"SubContractorID": 1051,
"SubContractor": "John Smith Pty",
"SubContractorContactNumber": "074 122 3522",
"LogDate": "2019-03-05T11:56:46.63"
}

SubContractor Scan

Method Query Plan Section Expected Result
POSTAuth /api/SubContractorScan?inputScan=PP_Subcontractor_|oob1gob5dHJg1hYfyd9wQg== Receive scanned QR Code
200 - OK               {
"SubContractorID": 1012,
"SubContractorTitle": "John Smith Pty",
"SubContractorContactNumber": "0763234521",
"SubContractorPersonnelLogId": 0
}
400 - Bad Request {"Message": "Card does not belong to a contractor."}
400 - Bad Request {"Message": "Contractor is disabled."}
400 - Bad Request {"Message": "Employee is not a registered guard."}
POSTAuth /api/SubContractorScan?id=1012&guardId=1056&siteId=6&personnelLogId=0&geolocation=-29.6058074,30.3393265 Mark Subcontrzctor Code as signed-in/signed-out
200 - OK               {
"ID": 6511,
"PersonnelID": 1051,
"GuardID": 1056,
"CodeTypeID": 1,
"CodeLocationId": 6,
"LogDate": "2019-02-27T15:54:54.9735569+02:00",
"LogSignedState": true,
"LogGeolocation" : "-29.6058074,30.3393265"
"LogNotes": "Subcontractor Logged In Successfully at: 2019-02-27 03:54:55 PM by Xolani Mhlongo",
"LogSignoutNormal": true,
"LinkPersonnelCodeLogID": 0
}
400 - Bad Request {"Message": "Subcontractor ID mismatch. Please try again or contact XXX"}
400 - Bad Request {"Message": "Guard ID mismatch. Please try again or contact XXX."}
400 - Bad Request {"Message": "Location ID mismatch. Please try again or contact XXX."}
400 - Bad Request {"Message": "Could not capture guard login, an error has occured." + EXCEPTION}

Visitor Scan

Method Query Plan Section Expected Result
POSTAuth api/VisitorScan/PP_VisitorCode_|TNNOaZwQauZrSjhjPN1kFQ==&visitorDescription=Help with plumbing&guardId=1056&siteId=5&geolocation=-29.6058074,30.3393265 Receive scanned QR Code for visitor Scan In
200 - OK               {
"ID": 6511,
"PersonnelID": 1051,
"GuardID": 1056,
"CodeTypeID": 4,
"CodeLocationId": 6,
"LogDate": "2019-02-27T15:54:54.9735569+02:00",
"LogSignedState": true,
"LogGeolocation" : "-29.6058074,30.3393265"
"LogNotes": "Visitor Logged In Successfully at: 2019-02-27 03:54:55 PM by Xolani Mhlongo",
"LogSignoutNormal": null,
"LinkPersonnelCodeLogID": 0
}
400 - Bad Request {"Message": "Card does not belong to a contractor."}
400 - Bad Request {"Message": "Contractor is disabled."}
400 - Bad Request {"Message": "Employee is not a registered guard."}
POSTAuth api/EmployeeScan/PP_VisitorCode_|TNNOaZwQauZrSjhjPN1kFQ==&guardId=1056&siteId=5&geolocation=-29.6058074,30.3393265 Receive scanned QR Code for visitor Scan Out
200 - OK               {
"ID": 6511,
"PersonnelID": 1051,
"GuardID": 1056,
"CodeTypeID": 1,
"CodeLocationId": 6,
"LogDate": "2019-02-27T15:54:54.9735569+02:00",
"LogSignedState": false,
"LogGeolocation" : "-29.6058074,30.3393265"
"LogNotes": "Visitor Logged Out Successfully at: 2019-02-27 03:54:55 PM by Xolani Mhlongo",
"LogSignoutNormal": true,
"LinkPersonnelCodeLogID": 3786
}
400 - Bad Request {"Message": "Subcontractor ID mismatch. Please try again or contact XXX"}
400 - Bad Request {"Message": "Guard ID mismatch. Please try again or contact XXX."}
400 - Bad Request {"Message": "Location ID mismatch. Please try again or contact XXX."}
400 - Bad Request {"Message": "Could not capture guard login, an error has occured." + EXCEPTION}