Admin Panel APIs
This document provides a comprehensive overview of the APIs designed for admin panel for CHITTI.
Course Retrieval
Get Courses by Category
Method: GET
Query Parameters:
courseCategory
Description: Retrieves all courses belonging to the specified category.
Get Course Details by ID
Method: GET
Path Parameters:
courseId
Description: Retrieves detailed information about a specific course, including its units, important questions for each unit.
Course Creation
Add New Course
Method: POST
Request Body:
{
"courseId": ,
"courseCategory": ,
"title": ,
"description": ,
"image":
}
Description: Creates a new course with the provided details. Returns a 400 status if a course with the given courseId already exists.
Add New Unit to a Course
Method: POST
Path Parameters:
courseId
Request Body:
{
"unitNo": ,
"unitName": ,
"description": ,
"difficulty":
}
Description: Adds a new unit to the specified course. The unitId is automatically generated by converting the unitName to lowercase and replacing spaces with hyphens. Returns a 404 status if the course is not found, or a 400 status if a unit with the same unitNo or unitName already exists in the course.
Add New Topic to a Unit
Method: POST
Path Parameters:
courseIdunitId
Request Body:
{
"name": ,
"difficulty":
}
Description: Adds a new topic to the of the specified unit within the course. The topicId is generated from the name. Returns a 400 status if a topic with the same name already exists.
Add New Notes to a Topic
Method: POST
Path Parameters:
courseIdunitIdtopicId
Request Body:
{
"url": ,
"name":
}
Description: Adds new notes to the specified topic within the unit and course. Returns a 404 status if the topic is not found.
Add New Video to a Topic
Method: POST
Path Parameters:
courseIdunitIdtopicId
Request Body:
{
"url": ,
"thumbnail": ,
"name":
}
Description: Adds a new video resource to the specified topic within the unit and course. Returns a 404 status if the topic is not found.
Add New Cheatsheet to a Topic
Method: POST
Path Parameters:
courseIdunitIdtopicId
Request Body:
{
"url": ,
"name":
}
Description: Adds a new cheatsheet resource to the specified topic within the unit and course. Returns a 404 status if the topic is not found.
Add New Important Question to a Unit
Method: POST
Path Parameters:
courseIdunitId
Request Body:
{
"url":
}
Description: Adds a new important question resource to the specified unit within the course.
Resource Retrieval
Get Resources for a Topic
Method: GET
Path Parameters:
courseIdunitIdtopicIdresourceId
Description: Retrieves all available resources (notes, cheatsheets, videos, important questions) for a given topic within a unit and course.
Get Cheatsheet by ID
Method: GET
Path Parameters:
courseIdunitIdtopicIdcheatId
Description: Retrieves details of a specific cheatsheet.
Get Notes by ID
Method: GET
Path Parameters:
courseIdunitIdtopicIdnotesId
Description: Retrieves details of specific notes.
Get Video by ID
Method: GET
Path Parameters:
courseIdunitIdtopicIdvideoId
Description: Retrieves details of a specific video.
Get Important Question by ID
Method: GET
Path Parameters:
courseIdunitIdiqId
Description: Retrieves details of a specific important question.
Resource Deletion
Delete Video from a Topic
Method: DELETE
Path Parameters:
courseIdunitIdtopicIdresourceId
Description: Deletes a specific video from the specified topic.
Delete Notes from a Topic
Method: DELETE
Path Parameters:
courseIdunitIdtopicIdresourceId
Description: Deletes specific notes from the specified topic.
Delete Cheatsheet from a Topic
Method: DELETE
Path Parameters:
courseIdunitIdtopicIdresourceId
Description: Deletes a specific cheatsheet from the specified topic.
Delete Important Question from a Unit
Method: DELETE
Path Parameters:
courseIdunitIdresourceId
Description: Deletes a specific important question from the specified unit.
Resource Editing
Edit Course Image
Method: PATCH
Path Parameters:
courseId
Request Body:
{
"image":
}
Description: Updates the image URL of the specified course.
Edit Cheatsheet Details
Method: PATCH
Path Parameters:
courseIdunitIdtopicIdcheatId
Request Body:
{
"url": ,
"name":
}
Description: Updates the URL and/or name of a specific cheatsheet.
Edit Notes Details
Method: PATCH
Path Parameters:
courseIdunitIdtopicIdnotesId
Request Body:
{
"url": ,
"name":
}
Description: Updates the URL and/or name of specific notes.
Edit Video Details
Method: PATCH
Path Parameters:
courseIdunitIdtopicIdvideoId
Request Body:
{
"url": ,
"thumbnail": ,
"name":
}
Description: Updates the URL, thumbnail, and/or name of a specific video.
Edit Important Question URL
Method: PATCH
Path Parameters:
courseIdunitIdiqId
Request Body:
{
"url":
}
Description: Updates the URL of a specific important question.
Edit Topic Difficulty
Method: PATCH
Path Parameters:
courseIdunitIdtopicId
Request Body:
{
"difficulty":
}
Description: Updates the difficulty level of a specific topic.
Parameters Table
| Parameter Name | Location | Description |
|---|---|---|
courseCategory | Query | Filters courses by category. Defaults to "program-core" if not provided. |
courseId | Path | The unique identifier of the course within a category. |
unitId | Path | The unique identifier of the unit within a course. |
topicId | Path | The unique identifier of the topic within a unit. |
cheatId | Path | The unique identifier of the cheatsheet resource. |
notesId | Path | The unique identifier of the notes resource. |
videoId | Path | The unique identifier of the video resource. |
iqId | Path | The unique identifier of the important question resource. |
resourceId | Path | Type of resource (notes, cheatsheets, videos, important questions). |
Request Body Table
| Field Name | Type | Description |
|---|---|---|
courseId | String | The unique identifier of the course. |
courseCategory | String | The category of the course. |
title | String | The title of the course. |
description | String | The description of the course. |
image | String | The URL of the course image. |
unitNo | Number | The number of the unit within the course. |
unitName | String | The name of the unit. |
description | String | The description of the unit. |
difficulty | String | The difficulty level of the unit. |
name | String | The name of the topic. |
url | String | The URL of the resource (notes, cheatsheets, videos, important questions). |
thumbnail | String | The URL of the video thumbnail. |
difficulty | String | The difficulty level of the topic. |