Sales Track Live API Docs

Get Attendance

Retrieve comprehensive attendance and work session data for your field team.

GET/api/integrations/crm/attendance

How to Integrate at Your Website

Step-by-step guide to integrate attendance tracking and work session data into your HR or management system

1. Get Your API Keys

Contact us to get your API key and secret key for accessing attendance data

2. Use Our Pre-built Components

Download our ready-to-use attendance dashboard components from the UI Components page - just copy and paste!

3. Connect to Your System

Add the API integration code to your HR dashboard or management system using the examples in the right sidebar

4. Track Attendance

Your system will now show real-time attendance data, work hours, location tracking, and performance metrics

What You Get

  • Daily attendance records with login/logout times and GPS coordinates
  • Work session tracking with total hours and distance covered
  • Store visit counts and performance metrics per day
  • Attendance status tracking (present, absent, late, early departure)
  • Location-based attendance verification with photo capture
  • Attendance summary statistics and trends
  • Real-time data filtering by date ranges, merchandiser, and status
  • Ready-to-use attendance dashboard components and reports

Code Examples

GET /api/integrations/crm/attendance
const apiKey = 'your_api_key_here';
const secretKey = 'your_secret_key_here';

async function getAttendance() {
  const response = await fetch('/api/integrations/crm/attendance?status=present&start_date=2024-01-01&end_date=2024-12-31&limit=25', {
    method: 'GET',
    headers: {
      'X-API-Key': apiKey,
      'X-Secret-Key': secretKey,
      'Content-Type': 'application/json'
    }
  });

  if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`);
  }

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

getAttendance().catch(console.error);

Response Examples

{
  "success": true,
  "data": {
    "attendance": [
      {
        "id": "4fa01136-af10-4b32-b870-ba05b2689b82",
        "merchandiser_id": "acdb6c04-5fcc-4199-9457-4255ab2cb679",
        "login_date": "2024-01-15",
        "login_time": "2024-01-15T07:06:50.239Z",
        "logout_time": "2024-01-15T18:30:15.123Z",
        "total_hours": 8.5,
        "total_distance_km": 25.5,
        "stores_visited": 12,
        "status": "present",
        "notes": "Completed all scheduled visits",
        "photo_url": "https://cloudinary.com/attendance/photo.jpg",
        "latitude": 19.0760,
        "longitude": 72.8777,
        "is_completed": true,
        "profiles": {
          "id": "acdb6c04-5fcc-4199-9457-4255ab2cb679",
          "fullname": "John Smith",
          "email": "john@example.com",
          "phone": "+91-9876543210"
        }
      }
    ],
    "summary": {
      "total_records": 150,
      "present_count": 120,
      "absent_count": 15,
      "late_count": 10,
      "early_departure_count": 5,
      "average_hours": 8.2,
      "total_distance": 3825.5,
      "total_stores_visited": 1800
    },
    "pagination": {
      "total": 150,
      "limit": 50,
      "offset": 0,
      "has_more": true
    }
  }
}

Need Help?