Question Paper API

Introduction

Welcome to the Question Paper API documentation. This API allows you to programmatically access and manage question papers with various filtering options.

Base URL

https://development.mdayubmondol.com/api

Authentication

X-API-Key header required

Response Format

JSON

All API requests must include the X-API-Key header with a valid API key.

API Endpoints

GET

Get All Question Papers

Retrieve all question papers for the authenticated user with optional filters.

Endpoint

https://development.mdayubmondol.com/api/question-papers?subject_id=1&type=mcq

Headers

Key Value Description
X-API-Key {your_api_key} Authentication key
Accept application/json Response format
Content-Type application/json Content type

Query Parameters

Parameter Type Required Description
subject_id integer No Filter by subject ID
type string No Filter by question type (mcq or cq)
part_id integer No Filter by part ID
chapter_id integer No Filter by chapter ID
topic_id integer No Filter by topic ID
GET

Get Question Paper by ID (No Answers, No Explanations)

Retrieve a specific question paper by ID without answers or explanations.

Endpoint

https://development.mdayubmondol.com/api/question-papers/1

Headers

Key Value Description
X-API-Key {your_api_key} Authentication key
Accept application/json Response format
Content-Type application/json Content type

Path Parameters

Parameter Type Required Description
id integer Yes Question paper ID

Response Example

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Sample Question Paper",
    "subject": "Mathematics",
    "part": "Algebra",
    "chapter": "Quadratic Equations",
    "topic": "Solving Quadratic Equations",
    "type": "mcq",
    "header": {
      "title": "Sample Exam",
      "instructions": "Answer all questions"
    },
    "questions": [
      {
        "id": 1,
        "question": "What is the solution to x² - 5x + 6 = 0?",
        "options": ["x=2, x=3", "x=-2, x=-3", "x=1, x=6", "x=-1, x=-6"]
      }
    ],
    "created_at": "2023-06-15T10:00:00Z",
    "updated_at": "2023-06-15T10:00:00Z"
  }
}
GET

Get Question Paper by ID (With Answers Only)

Retrieve a specific question paper by ID with answers but without explanations.

Endpoint

https://development.mdayubmondol.com/api/question-papers/1?include_answers=true

Query Parameters

Parameter Type Required Description
include_answers boolean Yes Must be set to true to include answers

Response Example

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Sample Question Paper",
    "subject": "Mathematics",
    "part": "Algebra",
    "chapter": "Quadratic Equations",
    "topic": "Solving Quadratic Equations",
    "type": "mcq",
    "header": {
      "title": "Sample Exam",
      "instructions": "Answer all questions"
    },
    "questions": [
      {
        "id": 1,
        "question": "What is the solution to x² - 5x + 6 = 0?",
        "options": ["x=2, x=3", "x=-2, x=-3", "x=1, x=6", "x=-1, x=-6"],
        "correct_answer": "x=2, x=3",
        "answers": {
          "A": "x=2, x=3",
          "B": "x=-2, x=-3",
          "C": "x=1, x=6",
          "D": "x=-1, x=-6"
        }
      }
    ],
    "created_at": "2023-06-15T10:00:00Z",
    "updated_at": "2023-06-15T10:00:00Z"
  }
}
GET

Get Question Paper by ID (With Explanations Only)

Retrieve a specific question paper by ID with explanations but without answers.

Endpoint

https://development.mdayubmondol.com/api/question-papers/1?include_explanations=true

Query Parameters

Parameter Type Required Description
include_explanations boolean Yes Must be set to true to include explanations

Response Example

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Sample Question Paper",
    "subject": "Mathematics",
    "part": "Algebra",
    "chapter": "Quadratic Equations",
    "topic": "Solving Quadratic Equations",
    "type": "mcq",
    "header": {
      "title": "Sample Exam",
      "instructions": "Answer all questions"
    },
    "questions": [
      {
        "id": 1,
        "question": "What is the solution to x² - 5x + 6 = 0?",
        "options": ["x=2, x=3", "x=-2, x=-3", "x=1, x=6", "x=-1, x=-6"],
        "explanation": "The equation can be factored as (x-2)(x-3)=0, so the solutions are x=2 and x=3."
      }
    ],
    "created_at": "2023-06-15T10:00:00Z",
    "updated_at": "2023-06-15T10:00:00Z"
  }
}
GET

Get Question Paper by ID (With Answers and Explanations)

Retrieve a specific question paper by ID with both answers and explanations.

Endpoint

https://development.mdayubmondol.com/api/question-papers/1?include_answers=true&include_explanations=true

Query Parameters

Parameter Type Required Description
include_answers boolean Yes Must be set to true to include answers
include_explanations boolean Yes Must be set to true to include explanations

Response Example

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Sample Question Paper",
    "subject": "Mathematics",
    "part": "Algebra",
    "chapter": "Quadratic Equations",
    "topic": "Solving Quadratic Equations",
    "type": "mcq",
    "header": {
      "title": "Sample Exam",
      "instructions": "Answer all questions"
    },
    "questions": [
      {
        "id": 1,
        "question": "What is the solution to x² - 5x + 6 = 0?",
        "options": ["x=2, x=3", "x=-2, x=-3", "x=1, x=6", "x=-1, x=-6"],
        "correct_answer": "x=2, x=3",
        "answers": {
          "A": "x=2, x=3",
          "B": "x=-2, x=-3",
          "C": "x=1, x=6",
          "D": "x=-1, x=-6"
        },
        "explanation": "The equation can be factored as (x-2)(x-3)=0, so the solutions are x=2 and x=3."
      }
    ],
    "created_at": "2023-06-15T10:00:00Z",
    "updated_at": "2023-06-15T10:00:00Z"
  }
}

Response Codes

Code Status Description
200 OK Successful request
400 Bad Request Invalid request parameters
401 Unauthorized Missing or invalid API key
404 Not Found Resource not found
500 Internal Server Error Server error occurred