Base URL: https://digitalmadrasah.onrender.com
Register a new user
{
"fullName": "string",
"email": "string",
"password": "string",
"gender": "string",
"phoneNumber": "string",
"referralCode": "string",
"guardianEmail": "string"
"countryCode": "string"
}
Register a new user with email
{verificationCode: "string",
userId:"string"}
Log in a user
{
"email": "string",
"password": "string"
}
Log in a user with email
{
"email": "string"
}
Verify OTP code
{
"verificationCode": "string",
"email": "string"
}
Forgotten password
{
"email": "string"
}
Reset user password
{
"userId": "string",
"newPassword": "string"
}
Update an existing user
{
"fullName": "string",
"gender": "string",
"phoneNumber": "string",
"guardianEmail": "string"
"countryCode": "string"
}
Update user password
{
"userId": "string"
}
{
"currentPassword": "string",
"newPassword": "string"
}
Delete a user account
{
"userId": "string"
}
Update user email (with verification)
{
"userId": "string"
}
Get All users
Get a user by Id
{
"userId": "string",
}
Get All Instructors
Get user courses
Mark a course as done
Update course Progress
{
"progress": "Number",
"currenLessonId": "string"
}
Upload or update user profile picture
Add a new course
{
"title": "string",
"shortdescription": "string",
"description": "string",
"category": "string",
"price": "number",
"duration": "string"
}
Purchase a course
Delete a course
Update a course
{
// Updated course fields
}
Get all courses
Get a specific course
Note: The userId query parameter is optional and allows you to retrieve the course for a specific user and get isEnrolled status to determine if current user has already purchase-course
Search and filter courses
/api/courses/search
Search by title
/api/courses/search?title=python
Filter by category
/api/courses/search?category=Programming
Price range
/api/courses/search?minPrice=0&maxPrice=100
Instructor courses
/api/courses/search?instructor=instructorObjectId
// Minimum ratings
/api/courses/search?minRatings=4
// Combined filters
/api/courses/search?title=python&category=Programming&minPrice=0&maxPrice=100&minRatings=4
Verify a course
Add a new lesson to a course
{
"title": "string",
"shortdescription": "string",
"description": "string",
"duration": "string"
}
Delete a lesson
Update a lesson
{
// Updated lesson fields
}
Get a specific lesson
Create a new rating for a course
{
"userId": "string",
"courseId": "string",
"rating": "number",
"comment": "string"
}
Get ratings for a specific course
Add a course to wishlist
{
Get user's wishlist
Remove a course from wishlist
creat payment after payments has been made to the insructor
{ "instructor": "string",
"course": "string",
"amountPaid": "Number",
"balance": "Number",
"status": "string"
}
Get all payments made to instructor
Get all payments
Get a specific payment
Delete a payment
Create a new referral code
{
codeDiscount: number,
code: string
}
Get all referral codes
Get a specific referral code
Update a referral code
{
codeDiscount: number,
code: string
}
Delete a referral code
Get a referral code by code
Broadcast message to registered users via email
{
subject: string,
message: string,
broadcastType : enum:['general',instructors, admin] //set to general by default
}
Get all categories
Create a new category
{
name: string,
description: string
}
Update a category
{
name: string,
description: string
}
Delete a category
Get all user certificates from all courses
Get user certificate from a single course
Saves user FCM token for push notifications
{
userId: string,
FCMToken: string
}
Get all FCM tokens for push notifications
Get all FCM tokens for a specific user
userId: string (MongoDB ObjectId)
Delete a specific FCM token
tokenId: string (MongoDB ObjectId)
Update a specific FCM token
tokenId: string (MongoDB ObjectId)
{
FCMToken: string
}
Delete all FCM tokens for a specific user
userId: string (MongoDB ObjectId)
Send push notifications to specific users or all users
{
userIds: string[], // Array of user IDs (optional if messageType is "All")
title: string, // Required - notification title
body: string, // Required - notification body text
data: object, // Optional - additional data to send with notification
messageType: string // Optional - defaults to "All", use specific userIds if not "All"
}
Send a contact message to the admin
{
"name": "string",
"email": "string",
"message": "string"
}
{
"success": true,
"message": "Message sent successfully"
}