Skip to content

Wookie Integration

The Wookie integration connects the Stratpoint Timesheet Application with the Wookie system, providing access to employee user data and filter information for workforce reporting and analytics.

Integration Overview

Wookie System Architecture

graph TB
    A[Wookie Application] --> B[Wookie Integration Layer]
    B --> C[User Data API]
    B --> D[Filter Data API]

    C --> E[Active User Lists]
    C --> F[Basic User Information]
    C --> G[Employee Data]

    D --> H[User Filters]
    D --> I[Department Filters]
    D --> J[Position Filters]

    K[Timesheet Application] --> B

Key Features

  • User Data Access: Retrieve active employee information with basic data
  • Filter Data Integration: Access to user-related filter options for reporting
  • Employee Information: Basic employee data for workforce management
  • Authentication Security: App-to-app authentication with rate limiting

API Endpoints

The Wookie integration provides two main endpoints for accessing user data:

Base URL

/api/v2/wookie/

Authentication

All Wookie endpoints use app-to-app authentication with the timesheet.authAppBulongOnly:wookie middleware.

Rate Limiting

  • Rate Limit: 50 requests per minute
  • Throttling: Automatic throttling applied via Laravel middleware

Available Endpoints

1. User Data Retrieval

Endpoint: POST /api/v2/wookie/getUserData

Retrieves active user list with basic employee information.

Request Parameters:

{
    "include_inactive": false,
    "department_ids": [1, 2, 3],
    "position_ids": [10, 20, 30],
    "start_date": "2024-01-01",
    "end_date": "2024-12-31"
}

Response: Returns active user data including employee information, department assignments, and basic profile data.

Example Response:

{
    "users": [
        {
            "id": 1,
            "name": "John Doe",
            "email": "john.doe@stratpoint.com",
            "department_id": 1,
            "department_name": "Engineering",
            "position_id": 10,
            "position_name": "Senior Developer",
            "is_active": true,
            "hire_date": "2023-01-15"
        },
        {
            "id": 2,
            "name": "Jane Smith",
            "email": "jane.smith@stratpoint.com",
            "department_id": 2,
            "department_name": "Design",
            "position_id": 20,
            "position_name": "UX Designer",
            "is_active": true,
            "hire_date": "2023-03-20"
        }
    ],
    "total_count": 2,
    "active_count": 2
}

2. Filter Data Retrieval

Endpoint: POST /api/v2/wookie/getIdList

Provides bulk filter data for user-related queries and reporting.

Request Parameters:

{
    "filters": ["departments", "positions", "user_types", "employment_status"]
}

Response: Returns available filter options for user queries including department IDs, position IDs, user types, and employment status categories.

Example Response:

{
    "departments": [
        {"id": 1, "name": "Engineering"},
        {"id": 2, "name": "Design"},
        {"id": 3, "name": "Sales"}
    ],
    "positions": [
        {"id": 10, "name": "Senior Developer"},
        {"id": 20, "name": "UX Designer"},
        {"id": 30, "name": "Sales Manager"}
    ],
    "user_types": [
        {"id": 1, "name": "Full-time"},
        {"id": 2, "name": "Part-time"},
        {"id": 3, "name": "Contract"}
    ]
}

Usage Guidelines

Integration Usage

The Wookie integration is designed for:

  • User Data Queries: Retrieving active employee information for reporting
  • Workforce Analytics: Supporting employee-related analytics within the timesheet application
  • Filter Data Access: Providing filter options for user-based reports
  • Employee Management: Basic employee data access for project assignments

Error Handling

// Wookie Error Handling
function handleWookieError(error, endpoint, requestData) {
    const errorLog = {
        timestamp: new Date(),
        endpoint: endpoint,
        error_type: error.type || 'unknown',
        message: error.message,
        request_data: requestData
    };

    logWookieError(errorLog);

    // Handle different endpoints
    switch (error.type) {
        case 'timeout':
            return retryWithBackoff(endpoint, requestData);
        case 'authentication_failed':
            return refreshAuthAndRetry(endpoint, requestData);
        case 'user_not_found':
            return handleMissingUser(requestData);
        default:
            return escalateError(errorLog);
    }
}

// Example usage for getting user data
function getWookieUserData(filters) {
    try {
        return fetch('/api/v2/wookie/getUserData', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'Authorization': 'Bearer ' + getWookieAuthToken()
            },
            body: JSON.stringify(filters)
        }).then(response => response.json());
    } catch (error) {
        return handleWookieError(error, 'getUserData', filters);
    }
}

This Wookie integration provides essential user data and filter information for employee management and workforce analytics within the Stratpoint Timesheet Application.