Quick Access

Authentication

Login, logout, and session management

User Management

CRUD operations for users and roles

Scoring System

Score submission and management

Dashboard

Statistics and analytics APIs

Authentication APIs

POST /auth/login_process.php

Easy

Authenticate user and create session.

POST /auth/login_process.php
Parameters
Parameter
Type
Required
Description
action
string
required
Must be "login"
username
string
required
User's username
password
string
required
User's password
role
string
required
User's role (admin, judge, etc.)
Response
{
  "success": true,
  "message": "Login successful",
  "user": {
    "id": 1,
    "username": "admin",
    "role": "admin",
    "full_name": "System Administrator"
  }
}
Example Request
curl -X POST http://yoursite.com/auth/login_process.php \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "action=login&username=admin&password=password&role=admin"

POST /auth/logout.php

Easy

Logout user and destroy session.

POST /auth/logout.php
Parameters

No parameters required. Uses session data.

Response
{
  "success": true,
  "message": "Logged out successfully"
}

POST /auth/forgot-password.php

Medium

Request password reset for user account.

POST /auth/forgot-password.php
Parameters
Parameter
Type
Required
Description
email
string
required
User's email address
Response
{
  "success": true,
  "message": "Password reset instructions sent to your email"
}

User Management APIs

GET /admin/endpoint/UserController.php

Medium

Retrieve all users with pagination and filtering.

GET /admin/endpoint/UserController.php
Query Parameters
Parameter
Type
Required
Description
action
string
required
Must be "get_users"
page
integer
optional
Page number (default: 1)
limit
integer
optional
Items per page (default: 10)
search
string
optional
Search term for filtering
Response
{
  "success": true,
  "data": {
    "users": [
      {
        "id": 1,
        "username": "admin",
        "email": "admin@pageant.com",
        "full_name": "System Administrator",
        "role": "admin",
        "is_active": 1,
        "last_login": "2024-01-15 10:30:00"
      }
    ],
    "pagination": {
      "current_page": 1,
      "total_pages": 5,
      "total_items": 50,
      "items_per_page": 10
    }
  }
}

POST /admin/endpoint/UserController.php

Medium

Create a new user account.

POST /admin/endpoint/UserController.php
Parameters
Parameter
Type
Required
Description
action
string
required
Must be "create_user"
username
string
required
Unique username
email
string
required
Valid email address
password
string
required
User password (min 8 chars)
full_name
string
required
User's full name
role_id
integer
required
Role ID from roles table
Response
{
  "success": true,
  "message": "User created successfully",
  "user_id": 123
}

PUT /admin/endpoint/UserController.php

Medium

Update existing user information.

PUT /admin/endpoint/UserController.php
Parameters
Parameter
Type
Required
Description
action
string
required
Must be "update_user"
user_id
integer
required
ID of user to update
email
string
optional
New email address
full_name
string
optional
New full name
role_id
integer
optional
New role ID
is_active
boolean
optional
User active status
Response
{
  "success": true,
  "message": "User updated successfully"
}

DELETE /admin/endpoint/UserController.php

Medium

Delete user account (soft delete).

DELETE /admin/endpoint/UserController.php
Parameters
Parameter
Type
Required
Description
action
string
required
Must be "delete_user"
user_id
integer
required
ID of user to delete
Response
{
  "success": true,
  "message": "User deleted successfully"
}

Scoring System APIs

POST /admin/endpoint/ScoringController.php

Hard

Submit scores for a candidate in a specific category.

POST /admin/endpoint/ScoringController.php
Parameters
Parameter
Type
Required
Description
action
string
required
Must be "submit_score"
judge_id
integer
required
ID of the judge submitting scores
candidate_id
integer
required
ID of the candidate being scored
category_id
integer
required
ID of the scoring category
scores
json
required
JSON array of criteria scores
comments
string
optional
Judge comments for the scores
Response
{
  "success": true,
  "message": "Scores submitted successfully",
  "score_id": 456,
  "total_score": 85.5
}
Example Request
curl -X POST http://yoursite.com/admin/endpoint/ScoringController.php \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "action=submit_score&judge_id=1&candidate_id=5&category_id=2&scores=[{\"criteria_id\":1,\"score\":85},{\"criteria_id\":2,\"score\":90}]&comments=Excellent performance"

POST /admin/endpoint/ScoringController.php

Medium

Lock or unlock scores for a category.

POST /admin/endpoint/ScoringController.php
Parameters
Parameter
Type
Required
Description
action
string
required
Must be "lock_scores" or "unlock_scores"
category_id
integer
required
ID of the category to lock/unlock
judge_id
integer
optional
Specific judge's scores (if not provided, affects all judges)
Response
{
  "success": true,
  "message": "Scores locked successfully"
}

GET /admin/endpoint/ResultsController.php

Medium

Get competition results and rankings.

GET /admin/endpoint/ResultsController.php
Query Parameters
Parameter
Type
Required
Description
action
string
required
Must be "get_results"
competition_id
integer
required
ID of the competition
category_id
integer
optional
Specific category results (if not provided, returns overall results)
Response
{
  "success": true,
  "data": {
    "results": [
      {
        "candidate_id": 1,
        "candidate_number": "001",
        "full_name": "Jane Doe",
        "total_score": 92.5,
        "rank": 1,
        "category_scores": {
          "swimsuit": 90.0,
          "evening_gown": 95.0,
          "interview": 92.5
        }
      }
    ],
    "competition_info": {
      "name": "BNSC Pageant 2025",
      "date": "2025-12-31",
      "status": "completed"
    }
  }
}

Dashboard APIs

GET /admin/endpoint/dashboard_api.php

Easy

Get dashboard statistics and overview data.

GET /admin/endpoint/dashboard_api.php
Query Parameters
Parameter
Type
Required
Description
action
string
required
Must be "dashboard_stats"
Response
{
  "success": true,
  "data": {
    "candidates": 25,
    "judges": 8,
    "categories": 6,
    "scoring_locked": false,
    "active_competition": {
      "id": 1,
      "name": "BNSC Pageant 2025",
      "status": "ongoing"
    }
  }
}

GET /admin/endpoint/dashboard_api.php

Easy

Get active users count for real-time display.

GET /admin/endpoint/dashboard_api.php
Query Parameters
Parameter
Type
Required
Description
action
string
required
Must be "get_active_users"
Response
{
  "success": true,
  "data": {
    "active_users": 12,
    "last_update": "2024-01-15 14:30:00"
  }
}

Error Codes

Common Error Responses

Easy

Standard error responses and their meanings.

400
Bad Request

Invalid parameters or malformed request

401
Unauthorized

Authentication required or invalid credentials

403
Forbidden

Insufficient permissions for this action

404
Not Found

Resource not found or invalid endpoint

500
Internal Server Error

Server error or database connection issue