Updated: 7 June 2024

Affect Version: 2.8.13 or above


A new API for Time Attendance has been added with BioStar 2.8.13.

 

For ‘How to use TA API swagger’, please refer to the link below:

 [BioStar 2 TA API] How to use and start BioStar 2 TA API

 

Other API functions available on TA Swagger (To be covered in other guide documents)

  • Time Code related functions
  • Shift related functions
  • Schedule Template related functions
  • Rule relates functions
  • Schedule related functions
  • Punch log related functions

 

 

How to use TA Report

[POST] /report.json API retrieves the appropriate report data in JSON format.

*TA Report has a variety of report types: Daily Report, Individual Report, Leave Report, Except Report, Edit History Report, and more. This article will cover a few of them by providing suggested request bodies for such reports.

 

Part 1. API Call & Parameters 

 

[POST]:         /report.json


Body Parameters : 

ParameterTypeRequiredDescription
limit Number YNumber of results. Min: 1, Max: 100 
offset NumberYResults data offset. minimum: 0 
start_datetime String YStart datetime of the report range.
YYYY-MM-DD format 
end_datetime String YEnd datetime of the report range.
YYYY-MM-DD format  
user_id_listNumberYList of user ids of users to be included in report. At least one user_id_list element is required. 
report_typeStringYType of report to be generated:
[REPORT_DAILY, REPORT_DAILY_SUMMARY, REPORT_INDIVIDUAL, REPORT_INDIVIDUAL_SUMMARY, REPORT_LEAVE, REPORT_EXCEPTION, REPORT_EDIT_HISTORY, REPORT_WORKWEEK]
group_id_listStringNlist of group id. 
report_filter_typeStringNRequired for “REPORT_INDIVIDUAL” type
[INDIVIDUAL_FILTER_SUMMARY, INDIVIDUAL_FILTER_DETAIL]
filterStringNRequired for “REPORT_LEAVE” and “REPORT_EXCEPTION” type
Possible values for “REPORT_LEAVE”
- Paycode id (number)
Possible values for “REPORT_EXCEPTION”
- ALL
- 1: NORMAL
- 2: ABSENCE
- 3: LATE_IN
- 4: EARLY_OUT
- 5: MISSING_PUNCH_IN
- 6: MISSING_PUNCH_OUT
- 7: MISSING_PUNCH_MEAL_START
- 8: MISSING_PUNCH_MEAL_END
- 9: MISSING_PUNCH_BREAK_START
- 10: MISSING_PUNCH_BREAK_END
- 11: MISSING_EVENT_TYPE
- 12: INSUFFICIENT_WORK_TIME
workweekIntegerNRequired for "REPORT_WORKWEEK"
columns
NColumns to be shown. 
- if columns doesn't exist, all columns are chosen by default
( mandatory for version below v2.9.6. 
It is not working in versions below v2.9.6 but still needs to be there in order for the API to work. 
It is working correctly as expected from version v2.9.6 )
:fieldstring
field of column to be included :
[datetime, userName, userId, userGroupName, shift, leave, inTime, outTime, exceptionForView, normalRegular, normalOvertime, totalWorkTime, punchBreak, overBreak, mealTime, regularByTimeRate, overtimeByTimeRate]
typeStringY"custom"
( mandatory only for version below v2.9.6.
Thi
s field is unnecessary and has been removed in v2.9.6 )
rebuild_time_cardBooleanY'true' or 'false' - value does not affect result
( mandatory only for version below v2.9.6.
Thi
s field is unnecessary and has been removed in v2.9.6 ) 



Suggested Request Bodies for Different Report Types


Changing the “report_type” parameter allows you to call different reports from BioStar 2.


Note:
Below examples are for v2.9.6 or above. 
Please note that 'type', 'rebuild_time_card', 'columns' fields are also mandatory if you are using versions below v2.9.6. You can find the information in the parameter table above. 
You can simply add those fields to the examples below for versions below v2.9.6. 



Daily Report 


Individual Report

The "REPORT_INDIVIDUAL" type requires a "report_filter_type" parameter. 


 Leave Report 

The "REPORT_LEAVE" type requires a "filter" parameter. Put Id of leave timecode that you'd like to view. 


Exception Report 

The "REPORT_EXCEPTION" type requires a "filter" parameter.