LMS API Documentation

Comprehensive documentation for the Learning Management System API

Table of Contents

Base URL

All API requests use the base URL defined in the Postman environment variable:

{{base_url}} - Default: http://localhost:8000

Authentication

Most endpoints require authentication using a Bearer token. After logging in, the token should be stored in the Postman environment variable:

{{token}} - Your JWT authentication token

Authentication Endpoints

POST {{base_url}}/api/register
Register a new user account
Headers
  • Content-Type: application/json
Request Body
{
    "name": "John Doe",
    "email": "john@example.com",
    "password": "password123",
    "role": "student"
}
POST {{base_url}}/api/login
Authenticate user and get access token
Headers
  • Content-Type: application/json
Request Body
{
    "email": "user@example.com",
    "password": "password123"
}
Response

Contains JWT token to be used for authenticated requests

POST {{base_url}}/api/logout
Invalidate the current user's token
Headers
  • Authorization: Bearer {{token}}
GET {{base_url}}/api/profile
Get the current user's profile information
Headers
  • Authorization: Bearer {{token}}
PUT {{base_url}}/api/profile
Update the current user's profile information
Headers
  • Authorization: Bearer {{token}}
  • Content-Type: application/json
Request Body
{
    "name": "Updated Name",
    "email": "updated@example.com"
}

Quiz Endpoints

GET {{base_url}}/api/v1/quizzes
Get a list of all available quizzes
Headers
  • Authorization: Bearer {{token}}
GET {{base_url}}/api/v1/quizzes/{quiz_id}
Get detailed information about a specific quiz
Headers
  • Authorization: Bearer {{token}}
GET {{base_url}}/api/v1/quizzes/{quiz_id}/questions
Get all questions for a specific quiz
Headers
  • Authorization: Bearer {{token}}
POST {{base_url}}/api/v1/quizzes/{quiz_id}/start
Start a new quiz attempt
Headers
  • Authorization: Bearer {{token}}
GET {{base_url}}/api/v1/quizzes/{quiz_id}/questions/{question_id}
Get details of a specific question in a quiz
Headers
  • Authorization: Bearer {{token}}
POST {{base_url}}/api/v1/quizzes/{quiz_id}/questions/{question_id}/answer
Submit an answer for a quiz question
Headers
  • Authorization: Bearer {{token}}
  • Content-Type: application/json
Request Body
{
    "answer_id": 123
}
POST {{base_url}}/api/v1/quizzes/{quiz_id}/questions/{question_id}/track-time
Track time spent on a question
Headers
  • Authorization: Bearer {{token}}
  • Content-Type: application/json
Request Body
{
    "time_spent": 45
}
POST {{base_url}}/api/v1/quizzes/{quiz_id}/questions/{question_id}/mark-difficult
Mark a question as difficult for later review
Headers
  • Authorization: Bearer {{token}}
POST {{base_url}}/api/v1/quizzes/{quiz_id}/questions/{question_id}/report
Report an issue with a question
Headers
  • Authorization: Bearer {{token}}
  • Content-Type: application/json
Request Body
{
    "reason": "Incorrect information",
    "details": "The question contains factually incorrect information."
}
GET {{base_url}}/api/v1/quizzes/{quiz_id}/progress
Get the current progress of an ongoing quiz
Headers
  • Authorization: Bearer {{token}}
POST {{base_url}}/api/v1/quizzes/{quiz_id}/finish
Complete a quiz attempt
Headers
  • Authorization: Bearer {{token}}

Ranking Endpoints

GET {{base_url}}/api/v1/quizzes/{quiz_id}/rankings
Get leaderboard rankings for a specific quiz
Headers
  • Authorization: Bearer {{token}}
GET {{base_url}}/api/v1/quizzes/{quiz_id}/my-ranking
Get the current user's ranking for a specific quiz
Headers
  • Authorization: Bearer {{token}}
GET {{base_url}}/api/v1/rankings/global
Get the global leaderboard across all quizzes
Headers
  • Authorization: Bearer {{token}}
GET {{base_url}}/api/v1/rankings/subcategory-averages
Get average scores by subcategory
Headers
  • Authorization: Bearer {{token}}

User-Specific Endpoints

POST {{base_url}}/api/v1/user/acquisition-source
Store information about how the user found the platform
Headers
  • Authorization: Bearer {{token}}
  • Content-Type: application/json
Request Body
{
    "source": "social_media",
    "details": "Facebook ad"
}

Performance Analytics

GET {{base_url}}/api/v1/user/performance
Get overall performance statistics for the user
Headers
  • Authorization: Bearer {{token}}

Practice Mode

GET {{base_url}}/api/v1/user/practice/main-categories
Get list of main practice categories
Headers
  • Authorization: Bearer {{token}}

Gamification

GET {{base_url}}/api/v1/user/gamification/persona
Get the user's gamification persona
Headers
  • Authorization: Bearer {{token}}

Learning Resources

GET {{base_url}}/api/v1/live-class
Get a list of available live classes
Headers
  • Authorization: Bearer {{token}}

Environment Variables

The Postman collection uses the following environment variables:

  1. base_url - The base URL for the API (default: http://localhost:8000)
  2. token - The JWT authentication token received after login

Importing the Collection

  1. Open Postman
  2. Click on "Import" in the top left
  3. Select the LMS.postman_collection.json file
  4. Create a new environment and set the base_url variable
  5. After logging in, update the token variable with the received JWT token

Note: Make sure to update the token environment variable after logging in to access protected endpoints.