Pre-requisite: Your unique domain name
API Key: Your unique API Key. Contact support to get it.
Secret Key: Contact support to get it.
For all the below API calls pass below headers
X-Api-Key:YOUR API KEY
X-Code:HASH CODE OF END POINT. SEE BELOW HOW TO GENERATE IT
X-Request-Time:xxxx-xx-xx
Generate Hash Code
$end_point = END POINT URL OF API CALLS
$xcode = hash_hmac('sha256', $end_point, $secrate);
Get Attendance
End Point: https://<DOMAIN NAME>/apis/getAttendance/
Post
date:xxxx-xx-xx //Required
employee_id: //Optional
email: //Optional
adname: //Optional
Get Objects
End Point: https://<DOMAIN NAME>/apis/getCategory/
Get Object Field Details
End Point: https://<DOMAIN NAME>/apis/getCategoryDetails/<OBJECT_iD>/
Save Data In Object
End Point: https://<DOMAIN NAME>/apis/saveCatDataBult/<OBJECT_iD>?request_time=<date>
RAW:
[
{
"KEY":"VALUE",
"KEY":"VALUE",
},
{
"KEY":"VALUE",
"KEY":"VALUE",
}
]
GET RECORDS FROM OBJECT
End Point: https://<DOMAIN NAME>/apis/getObjectData/<OBJECT_iD>?request_time=<date>
POST:
id: <Record ID>
from_date: <date>
to_date: <date>
Note: Either search on id or from_date and to_date
DELETE RECORDS FROM OBJECT
End Point: https://<DOMAIN NAME>/apis/deleteObjectData/<OBJECT_iD>?request_time=<date>
POST:
id: <Record ID>
from_date: <date>
to_date: <date>
Note: Either search on id or from_date and to_date
FULL EXAMPLE
Sample call of API using curl in PHP
$api_key = YOUR API KEY;
$secret = YOUR SECRET KEY;
$request_date = date('Y-m-d'); // Required
$attendance_date = '2021-02-12'; // Required (The date for which you wanted to grab the attendance)
$employee_id = ''; // Optional. Supply if you wanted to filter users on employee id
$email = ''; // Optional. Supply if you wanted to filter user on email
$adname = ''; // Optional. Supply if you wanted to filter user on AD name
$end_point =
"apis/getAttendance/?employee_id=$employee_id&email=$email&adname=$adname&date=$attendance
_date&request_time=$request_date";
$xcode = hash_hmac('sha256', $end_point, $secret);
$curl = curl_init();
$post = array(
'date' => $attendance_date,
'employee_id' => $employee_id,
'email' => $email,
'adname' => $adname
);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://teamob.zdpm.us/apis/getAttendance/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => http_build_query($post),
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded",
"X-Api-Key: $api_key",
"X-Code: $xcode",
"X-Request-Time: $request_date"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Success Response Format
{
"data": [
{
"employee_id": "ZD1000",
"name": "A Kumar",
"email": "ab@abc",
"date": "2021-02-12",
"login_time": "10:20:18",
"logout_time": "13:30:54"
},
{
"employee_id": "ZD1002",
"name": "rajesh pandit",
"email": "rajesh@abc.com",
"date": "2021-02-12",
"login_time": "07:10:00",
"logout_time": "20:02:32"
},
{
"employee_id": "ZD1003",
"name": "sarthak shelke s",
"email": "sarthak@abc.com",
"date": "2021-02-12",
"login_time": "10:05:00",
"logout_time": "20:20:16"
}
],
"success": true
}
If there is no data for supplied date
{"data":[],"success":true}
Possible ErrorsIf hash does not match
==================================
{
"msg": "Authentication failed",
"success": false
}
If date is blank (attendance date)
==================================
{
"msg": "Date is required",
"success": false
}
If supplied has does not match with the server (Generate hash every time before call)
==================================
{
"msg": "Token has been expired",
"success": false
}
If API key is wrong or updated on server
========================================
{
"msg": "API key is wrong",
"success": false
}