📡 API Documentation

Tracker Integration API

Enable your external time tracking system to push employee activity data to Hrms Tracker for attendance management, payroll, and analytics.

View Endpoints Integration Guide

Connect your tracker to Hrms

This API enables external time tracking systems (like TimeDoctor, HubStaff, etc.) to push employee activity data to Hrms Tracker.

System Architecture

Data flows from your tracker system to Hrms Tracker

External Tracker

TimeDoctor, HubStaff, or custom tracker

Hrms Tracker

Attendance, Payroll, Analytics

🔄

Real-time Sync

Push employee activity data every 15-30 minutes for up-to-date attendance tracking.

📊

Detailed Analytics

Include app usage, break times, idle periods, and active sessions for comprehensive insights.

🏢

Multi-tenant

Support for multiple organizations with separate database isolation via DB_name parameter.

🌐 Base URL

https://unifygroup.in

Three endpoints to integrate

Simple REST API to connect your tracker system with Hrms Tracker.

GET /uc/api/organizations

Get Organizations List

Get the list of organizations to obtain the DB_name required for multi-tenant database connection.

Response Example
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Unify Cruise Technologies",
      "DB_name": "UC_unifycruisetechs"
    }
  ]
}
GET /uc/api/employees?DB_name={DB_name}

Get Employees List

Get the list of employees for a specific organization to obtain the userId values.

Query Parameters
Parameter Type Required Description
DB_name string Yes Organization database name
Response Example
{
  "success": true,
  "data": [
    {
      "userId": "UTS-123",
      "name": "John Doe",
      "email": "[email protected]"
    }
  ]
}
POST /uc/api/tracking/trackingEmpAttendance

Submit Employee Tracking Data

Submit employee tracking data (attendance, activities, breaks) from the tracker system to Hrms Tracker.

Request Headers
Content-Type: application/json
Request Body
{
  "DB_name": "UC_unifycruisetechs",
  "userId": "UTS-123",
  "clockInTime": "2025-01-15 09:00:00",
  "clockOutTime": "2025-01-15 18:00:00",
  "lastPingTime": "2025-01-15 17:55:00",
  "activeTime": "08:30:00",
  "idleTime": "00:30:00",
  "breakTime": "01:00:00",
  "date": "2025-01-15",
  "appActivity": [...],
  "breakActivity": [...],
  "activeSession": [...],
  "idleActivity": [...]
}
Field Descriptions
Field Type Required Format Description
DB_name string Yes UC_companyname Organization database name
userId string Yes String ID Employee unique ID
clockInTime string Yes Y-m-d H:i:s Employee clock-in time
clockOutTime string No Y-m-d H:i:s Employee clock-out time
activeTime string Yes H:i:s Total active time (00:00:00 to 23:59:59)
idleTime string No H:i:s Total idle time
breakTime string No H:i:s Total break time
date string Yes Y-m-d Attendance date
Success Response (200)
{
  "success": true,
  "message": "Attendance tracked successfully"
}

How to integrate

Follow this step-by-step process to integrate your tracker system.

1

Preparation

Call the organizations API to get DB_name, then call employees API to get userId. Store these mappings locally.

2

Clock In

When employee starts work, tracker system begins monitoring. No API call needed immediately.

3

Periodic Sync (Every 15-30 min)

POST tracking data with cumulative activeTime, idleTime, breakTime, and all activity arrays.

4

Clock Out

Final POST with clockOutTime and all final accumulated times. Attendance marked complete.

5

Next Day

Repeat the cycle with a new date.

Ready-to-use code

Copy and paste these examples to get started quickly.

Get Organizations

curl -X GET https://unifygroup.in/uc/api/organizations

Get Employees

curl -X GET "https://unifygroup.in/uc/api/employees?DB_name=UC_unifycruisetechs"

Submit Tracking Data (cURL)

curl -X POST https://unifygroup.in/uc/api/tracking/trackingEmpAttendance \
  -H "Content-Type: application/json" \
  -d '{
    "DB_name": "UC_unifycruisetechs",
    "userId": "UTS-123",
    "clockInTime": "2025-01-15 09:00:00",
    "clockOutTime": "2025-01-15 18:00:00",
    "activeTime": "08:30:00",
    "idleTime": "00:30:00",
    "breakTime": "01:00:00",
    "date": "2025-01-15",
    "appActivity": [],
    "breakActivity": [],
    "activeSession": [],
    "idleActivity": []
  }'

Submit Tracking Data (JavaScript)

const response = await fetch('https://unifygroup.in/uc/api/tracking/trackingEmpAttendance', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    DB_name: 'UC_unifycruisetechs',
    userId: 'UTS-123',
    clockInTime: '2025-01-15 09:00:00',
    activeTime: '08:30:00',
    idleTime: '00:30:00',
    breakTime: '01:00:00',
    date: '2025-01-15',
    appActivity: [],
    breakActivity: [],
    activeSession: [],
    idleActivity: []
  })
});

const data = await response.json();
console.log(data);

HTTP Status Codes

Understand response codes and implement proper error handling.

Status Code Meaning Action
200 Success Process response
404 Not Found Check userId, DB_name parameters
422 Validation Error Check request format and required fields
500 Server Error Retry with exponential backoff

Retry Strategy for 500 Errors

  • 1st retry: after 1 second
  • 2nd retry: after 2 seconds
  • 3rd retry: after 4 seconds
  • After 3 failures: log error and notify support

Integration Checklist

Track your integration progress with this checklist.