Skip to main content

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:

  • courseId
  • unitId

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:

  • courseId
  • unitId
  • topicId

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:

  • courseId
  • unitId
  • topicId

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:

  • courseId
  • unitId
  • topicId

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:

  • courseId
  • unitId

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:

  • courseId
  • unitId
  • topicId
  • resourceId

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:

  • courseId
  • unitId
  • topicId
  • cheatId

Description: Retrieves details of a specific cheatsheet.

Get Notes by ID

Method: GET
Path Parameters:

  • courseId
  • unitId
  • topicId
  • notesId

Description: Retrieves details of specific notes.

Get Video by ID

Method: GET
Path Parameters:

  • courseId
  • unitId
  • topicId
  • videoId

Description: Retrieves details of a specific video.

Get Important Question by ID

Method: GET
Path Parameters:

  • courseId
  • unitId
  • iqId

Description: Retrieves details of a specific important question.

Resource Deletion

Delete Video from a Topic

Method: DELETE
Path Parameters:

  • courseId
  • unitId
  • topicId
  • resourceId

Description: Deletes a specific video from the specified topic.

Delete Notes from a Topic

Method: DELETE
Path Parameters:

  • courseId
  • unitId
  • topicId
  • resourceId

Description: Deletes specific notes from the specified topic.

Delete Cheatsheet from a Topic

Method: DELETE
Path Parameters:

  • courseId
  • unitId
  • topicId
  • resourceId

Description: Deletes a specific cheatsheet from the specified topic.

Delete Important Question from a Unit

Method: DELETE
Path Parameters:

  • courseId
  • unitId
  • resourceId

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:

  • courseId
  • unitId
  • topicId
  • cheatId

Request Body:

{
"url": ,
"name":
}

Description: Updates the URL and/or name of a specific cheatsheet.

Edit Notes Details

Method: PATCH
Path Parameters:

  • courseId
  • unitId
  • topicId
  • notesId

Request Body:

{
"url": ,
"name":
}

Description: Updates the URL and/or name of specific notes.

Edit Video Details

Method: PATCH
Path Parameters:

  • courseId
  • unitId
  • topicId
  • videoId

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:

  • courseId
  • unitId
  • iqId

Request Body:

{
"url":
}

Description: Updates the URL of a specific important question.

Edit Topic Difficulty

Method: PATCH
Path Parameters:

  • courseId
  • unitId
  • topicId

Request Body:

{
"difficulty":
}

Description: Updates the difficulty level of a specific topic.

Parameters Table

Parameter NameLocationDescription
courseCategoryQueryFilters courses by category. Defaults to "program-core" if not provided.
courseIdPathThe unique identifier of the course within a category.
unitIdPathThe unique identifier of the unit within a course.
topicIdPathThe unique identifier of the topic within a unit.
cheatIdPathThe unique identifier of the cheatsheet resource.
notesIdPathThe unique identifier of the notes resource.
videoIdPathThe unique identifier of the video resource.
iqIdPathThe unique identifier of the important question resource.
resourceIdPathType of resource (notes, cheatsheets, videos, important questions).

Request Body Table

Field NameTypeDescription
courseIdStringThe unique identifier of the course.
courseCategoryStringThe category of the course.
titleStringThe title of the course.
descriptionStringThe description of the course.
imageStringThe URL of the course image.
unitNoNumberThe number of the unit within the course.
unitNameStringThe name of the unit.
descriptionStringThe description of the unit.
difficultyStringThe difficulty level of the unit.
nameStringThe name of the topic.
urlStringThe URL of the resource (notes, cheatsheets, videos, important questions).
thumbnailStringThe URL of the video thumbnail.
difficultyStringThe difficulty level of the topic.