Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


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

...

Authentication

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

Parameter

Description

key

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

You can generate the API key for your organization yourself.

1.2 Endpoint

https://www.hinote.in/hrworks/api/post/AttendanceInput.do?key=<customer_api_key>

...

Please note that the API key must be appended with the URL as a request parameter. You need to use https in your API call.

2 Post Request

Input can be provided as a request parameter named inputData or as a request body. A typical example is as follows.

{

"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.

...

Multiple objects can be supplied as a JSON array.

[{
"employeeId": "<Employee ID>", 
"location": "<Swipe/Biometric machine ID>", 
"swipeTime": "<yyyy-mm-dd hh:mm:ss>", 
"in_out": "<In/Out>"
},
...
]

You can post employee attendance information to HRWorks using this request. The post request can be made by way of JSON formatted string

...

named inputData, 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

 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 

00 or 2015-09-03T13:50:00Z

 represents

 represents 01:50 p.m. (UTC) on September 09, 2015.

Time Zones:

The

strings 

strings +hh:mm+hhmm, -hh:mm, -

hhmm 

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 

hence 2015-09-03 13:50:00+05:30

 represents

 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>&

...

inputData=
{"employeeId":

...

"1001",

...

"location":

...

"ChennaiOffice-MainEntrance",

...

"swipeTime":

...

"

...

2025-

...

08-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-NovAug-2015 2025 while getting into the office.

3. Response

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

{"success":true,"statusCode":200,"recordsProcessed":1222,"recordsSuccessful":1222,"recordsFailed":0}

3.1 Output Parameters

Parameter

Description

success

Denotes if the API call was successful.

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

Refers to a text value describing the response

. For errors, it

in case of an error. It can describe

any

the error which

may have

has occurred.

The possible values for "statusCode" are presented here.The  response shall be in the format {

3.2 Response in case of error

In case of error, the API returns the following JSON response:

{
    "success": false,
    "statusCode":

...

400,
    "

...

errorMsg": "Invalid JSON. Please ensure you are passing a valid JSON string and it is url encoded properly."
}

4 Coding Examples

4.1 CURL

1
2
3
4
5

#The following command uploads attendance employee data.
  
curl --location --request POST 'https://hinote.in/hrworks/api/post/AttendanceInput.do?key=<customer_api_key>\
--header 'Content-Type: text/plain' \
--data-raw '{"employeeId": "1001", "location": "ChennaiOffice-MainEntrance", "swipeTime": "2025-08-03 10:05:00+05:30", "in_out": "In"}'