Student App APIs
This documentation provides an overview of the functionalities for APIs related to the Student Application.
General
Login
Method: POST
Request Body:
{
"rollNo": ,
"pass": ,
"deviceId":
}
Description: Authenticates a user and returns a Firebase custom token. Checks if the roll number exists, validates credentials, and handles device ID verification.
Reauthenticate
Method: POST
Headers:
Authorization: Bearer "token"
Description: Re-authenticates a user using an existing Firebase ID token and returns a new token.
Revoke Device ID
Method: POST
Request Body:
{
"rollNo":
}
Description: Revokes a user's device ID, preventing them from logging in on that device.
Signup
Method: POST
Request Body:
{
"rollNo": ,
"pass": ,
"name": ,
"semester": ,
"courses": ,
"schedule": ,
"subId": ,
"deviceId":
}
Description: Creates a new user account and returns student details along with a Firebase custom token.
Dashboard
Method: GET
Path Parameters:
deviceId
Headers:
Authorization: Bearer "token"
Description: Retrieves the user's dashboard information, including semester, completed resources, and course details.
Add Completed Resource
Method: POST
Request Body:
{
"resourceId":
}
Headers:
Authorization: Bearer "token"
Description: Adds a resource to the user's list of completed resources.
Get Course Details
Method: GET
Path Parameters:
courseId
Description: Retrieves detailed information about a specific course, including its units.
Get Topic
Method: GET
Path Parameters:
courseIdunitId
Headers:
Authorization: Bearer "token"
Description: Retrieves the topic for a given unit within a course.
Get Resources by Type
Method: GET
Path Parameters:
courseIdunitIdtopicIdresourceId
Headers:
Authorization: Bearer "token"
Description: Retrieves resources of a specific type (notes, cheatsheets, videos, importantQuestions) for a given topic within a unit and course. If resourceId is "all", it retrieves all resource types.
Admin APIs
Admin Login
Method: POST
Request Body:
{
"rollNo": ,
"pass":
}
Description: Authenticates an admin user and returns a Firebase custom token.
Admin Router
All routes under /admin require admin authentication.
Middleware: checkAdminAuth
Description: This router handles administrative tasks related to course content management. Refer to admin-router.ts for specific endpoints and functionalities.
Razorpay Integration
Create Order
Method: POST
Request Body:
{
"userId": ,
"courseId": ,
"amount": ,
"receipt":
}
Description: Creates a Razorpay order for a given user and course.
Verify Signature
Method: POST
Request Body:
{
"orderId": ,
"paymentId": ,
"signature":
}
Description: Verifies the Razorpay signature for a payment.
Webhook
Method: POST
Description: Handles Razorpay webhook events, such as payment capture. Updates the user's subscription status and course access upon successful payment.
Parameters Table
| Parameter Name | Location | Description |
|---|---|---|
courseId | Path | The unique identifier of the course for retrieving course/topic/resource details. |
unitId | Path | The unique identifier of the unit for retrieving topics. |
topicId | Path | The unique identifier of the topic for retrieving resources by type. |
Request Body Table
| Field Name | Type | Description |
|---|---|---|
rollNo | String | User's roll number for authentication. |
pass | String | User's password for authentication. |
deviceId | String | The device ID used for device verification. |
name | String | User's name for registration. |
semester | Number | User's current semester for registration. |
courses | Array | List of course IDs for registration. |
schedule | String | User's schedule information for registration. |
subId | Number | Subscription ID for registration. |
resourceId | String | The identifier of the completed resource to add. |
userId | String | User's Id for Razorpay payment creation. |
courseId | String | The Course ID to which the user is subscribing. |
amount | Number | The amount for the Razorpay order. |
receipt | String | Receipt for the Razorpay order. |
orderId | String | Razorpay Order ID to Verify Payment. |
paymentId | String | Razorpay Payment ID to Verify Payment. |
signature | String | Razorpay signature to Verify Payment. |