0 people focusing right now

GET /api/all-projects

Get combined view of all projects (individual + team)

Projects System Overview

RegardingWork has three project types:

Get a unified view of all projects (both individual and team projects) accessible to the authenticated user.

Comprehensive View: This endpoint combines data from both /api/projects and /api/team-projects for convenience.
Endpoint URL
GET https://game.regardingwork.com/api/all-projects
Authentication
JWT Bearer token required
Status
✅ Available
Available Now

This endpoint is live and combines data from both individual and team projects in one convenient call.

  • Perfect for Mac/Windows apps that need all projects at once
  • Includes both personal (👤) and team (🫂) projects with type indicators
  • Eliminates need for multiple API calls

📤 Request

Headers
Authorization: Bearer <your_jwt_token>
Optional Query Parameters
  • include_inactive - Include inactive projects (true/false, default: false)
  • sort - Sort by: "recent", "name", "sessions", "type" (default: type)
  • group_by_type - Group results by project type (true/false, default: true)

✅ Response (200 OK)

{
  "success": true,
  "projects": {
    "individual": [
      {
        "id": 4,
        "project_name": "Personal Website",
        "type": "individual",
        "emoji": "👤",
        "color": "#3498db",
        "session_count": 15,
        "total_minutes": 450,
        "last_session": "2024-08-25T14:30:00Z",
        "created_at": "2024-01-10T09:00:00Z"
      }
    ],
    "team": [
      {
        "id": 6,
        "name": "Innovemind",
        "type": "team",
        "emoji": "🫂",
        "team_name": "Development Team",
        "team_id": 3,
        "description": "Core product development project",
        "is_public": true,
        "slack_channel": "#dev-innovemind",
        "created_at": "2024-01-15T10:30:00Z"
      }
    ]
  },
  "summary": {
    "total_individual": 1,
    "total_team": 1,
    "total_projects": 2
  }
}
Planned Response Fields
Field Type Description
success boolean Request success status
projects.individual[] array User's personal projects
projects.team[] array Accessible team projects
type string "individual" or "team"
emoji string 👤 for individual, 🫂 for team
summary object Project counts and totals

🔧 Current Workaround

Until this endpoint is available, you can combine the data from existing endpoints:

JavaScript Example
// Get all projects (current workaround)
async function getAllProjects() {
  const token = localStorage.getItem('jwt_token');
  const headers = { 'Authorization': 'Bearer ' + token };
  
  // Fetch both individual and team projects
  const [individualResponse, teamResponse] = await Promise.all([
    fetch('https://game.regardingwork.com/api/projects', { headers }),
    fetch('https://game.regardingwork.com/api/team-projects', { headers })
  ]);
  
  const individualData = await individualResponse.json();
  const teamData = await teamResponse.json();
  
  return {
    individual: individualData.projects || [],
    team: teamData.team_projects || [],
    total: (individualData.projects?.length || 0) + (teamData.team_projects?.length || 0)
  };
}

// Usage
const allProjects = await getAllProjects();
console.log('All projects:', allProjects);

🔗 Related Endpoints