Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 6 Current »

1 General


You can use our web (HTTP request) API to submit employee attendance information to HRWorks by way of JSON formatted strings.
The API request can be made for uploading the swipe card / biometric machine data of an employee to HRWorks. For each swipe card / biometric machine input, this API method needs to be called separately. In this document, the word swipe refers to the usage of both swipe card / biometric machine, as the case may be. 

1.1 URL for the API call

https://www.hinote.in/hrworks/api/post/AttendanceInput.do?key=<customer_api_key>&attendanceInputJson=
{
"employeeId": "<Employee ID>", 
"location": "<Swipe/Biometric machine ID>", 
"swipeTime": "<yyyy-mm-dd hh:mm:ss>", 
"in_out": "<In/Out>"
}

1.2 Authentication

Your API calls must contain the API key for the purpose of authentication.

Parameter

Description

keyPlease contact the HRWorks administrator in your organization for the API key.

You can generate the API key for your organization yourself.

2 Post Request

You can post employee attendance information to HRWorks using this request. The post request can be made by way of JSON formatted string named attendanceInputJSON, which allows you to submit attendance data with the following parameters as input.

2.1 Input Parameters

Parameter

Description

employeeId

This is a text value specifying Employee Id of the employee swiping his card.

This is a mandatory field.

location

This is a text value specifying the ID for the swipe card / biometric machine. This should correspond to a swipe card / biometric machine ID (referred to as Attendance Location ID in HRWorks) stored in HRWorks.

This is a non-mandatory field. If a value is not provided, the default attendance location (as specified in HRWorks) shall be used.

swipeTime

Refers to the time of employee swiping his card/finger. This should be a date value as per the ISO8601 format.

Typical Formats: yyyy-mm-dd hh:mm:ss or yyyy-mm-ddThh:mm:ssZ .

Note:

  • yyyy = year in 4 digits. For example, 2015.
  • mm = month in 2 digits, from 01 (for January) to 12 (for December).
  • dd = day of month in 2 digits, from 01 to 31.
  • hh = hour in 2 digits, from 00 to 23.
  • mm = minute in 2 digits from 00 to 59.
  • ss = second in 2 digits from 00 to 59.
  • T = Letter T can be inserted between yyyy-mm-dd and hh:mm:ss instead of space.
  • Z = Letter Z refers to zero meridian and can be appended (optional) to hh:mm:ss.

The time format represents Coordinated Universal Time (UTC). For example, 2015-09-03 13:50:00 or 2015-09-03T13:50:00Z represents 01:50 p.m. (UTC) on September 09, 2015.

Time Zones:

The strings +hh:mm+hhmm, -hh:mm, -hhmm can be appended to yyyy-mm-dd hh:mm:ss in order to specify a time zone relative to UTC. For example, UTC+5:30 represents Indian Standard Time (IST) and hence 2015-09-03 13:50:00+05:30 represents 01:50 p.m. (IST) on September 09, 2015.

Accepted date and time formats:

a. yyyy-mm-dd hh:mm:ss+hh:mm

b. yyyy-mm-dd hh:mm:ss+hhmm

c. yyyy-mm-dd hh:mm:ss-hh:mm

d. yyyy-mm-dd hh:mm:ss-hhmm

Note:

a. In all of the above, the space between yyyy-mm-dd and hh:mm:ss can be replaced with the letter T. For example, both 2015-09-30 12:00:00 and 2015-09-30T12:00:00 are acceptable.

b. In all of the above the letter Z can be appended to hh:mm:ss. Both hh:mm:ss and hh:mm:ssZ refer to time in UTC. For example, both 2015-09-30T12:00:00 and 2015-09-30T12:00:00Z refer to the same time in UTC .

This is a mandatory field.

in_out

This should be a text input with the value “In” or “Out”. In/Out signifies whether swipe machine was used for employee's entry or exit.

This is a mandatory field.

2.3 API Example
https://www.hinote.in/hrworks/api/post/AttendanceInput.do?key=<customer_api_key>&attendanceInputJson={"employeeId": "1001", "location": "ChennaiOffice-MainEntrance", "swipeTime": "2015-11-03 10:05:00+05:30", "in_out": "In"}


The above API call submits employee attendance data for an employee whose employee ID is "1001" who swiped in to make an entry into a swipe card / biometric machine called "ChennaiOffice-MainEntrance" at 10:05 a.m. IST on 03-Nov-2015 while getting into the office.

3. Response


If the API call is successful, HRWorks shall return a JSON formatted string response with the following parameter values.

3.1 Output Parameters

Parameter

Description

statusCode
Refers to the relevant http status code. Any status code other than "200" refers to an error while processing the request.
msg

Refers to a text value describing the response. For errors, it can describe any error which may have occurred.

The possible values for "statusCode" are presented here.

The  response shall be in the format {"statusCode": <code>, "msg": <msg>}. For example, {"statusCode": 400, "msg": “Bad Request - Invalid Date Format”}

  • No labels