API Guide for Attendance Log Ingestion

Modified on Mon, 16 Oct 2023 at 09:17 AM

TABLE OF CONTENTS

Welcome to the Attendance Log Ingestion API guide. The document provides comprehensive instructions on how to correctly use Keka's Attendance API's base URL, headers, body, and comprehend the responses it produces.

Base URL

The API uses a POST call, accessible at the following URL:

https://[assigned_server].a.keka.com/v1/logs


Please note that the [assigned_server] in the URL will be provided by KEKA's support team, depending on your country of operation and the server assigned to you. Kindly reach out to the support team to get this detail before initiating the API integration process. Commonly used values will be cin01, cin02 if your business is located in India. 

API Headers

For successful API calls, you need to include the following headers:

  • Content-Type : 'application/json'
  • X-API-Key : '_X-API-Key_'
    • Content-Type must be set as application/json
    • X-API-Key will be issued by the KEKA support team when you raise a development request for the Attendance Log Ingestion API.

API Body

The API body carries the employee log data in a JSON format. Here's the expected format:

[{

"DeviceIdentifier": "__DeviceIdentifier__",

"EmployeeAttendanceNumber": "__AttendanceNumber__",

"Timestamp": "__Timestamp__",

"Status": 0

}]

  • DeviceIdentifier is provided by the KEKA support team, along with the X-API-Key, upon raising a request for the Attendance Log Ingestion API.
  • EmployeeAttendanceNumber is the unique attendance number of each employee, as registered on the KEKA portal.
  • Timestamp denotes the specific time when the employee checked IN/OUT on a particular day.
  • Status represents the type of the punch recorded at that specific moment. Here, "0" represents an IN punch, while "1" represents an OUT punch.


Response Message

Upon successful execution of the API call, the following response is returned:

{

"data": 

{

"logsReceived": 1,

"logsAccepted": 1, },

"succeeded": true

}


In case of a failed API call, the following response is generated. 

{

"errors": [

"Error message" ],

"succeeded": false

}

  • data is an object included in the response when the API call is successful. It contains details about the number of logs posted (logsReceived) and the number of logs accepted and saved in the KEKA server (logsAccepted).
  • succeeded is a Boolean value indicating whether the API request was successful.
  • errors is an array object returned when the API call fails. It includes a list of errors that led to the failure of the API request.


Other Frequently Asked Questions:

1. How many logs can we push in a single API request? 

You can push a maximum of 1000 logs in a single API request.


2. Can we push past dated logs in the API request? 

Yes, past-dated logs can be included in the API request. The Log Ingestion API permits the inclusion of logs from the previous 30 days.


3. What if the X-API-Key provided by KEKA is misplaced or stolen? 

In such scenarios, please contact the KEKA support team immediately. They will disable the previous key and issue a new API Key.


4. Can we add more devices to the Log Ingestion API? 

Yes, to add more devices, please reach out to the KEKA support team. Provide them with the list of devices you wish to add to KEKA. They will handle the addition of these devices from the backend and furnish you with the requisite details.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article