Skip to main content
GET
Get Course

Endpoint

Authentication

No authentication required. This is a public endpoint.

Path Parameters

string
required
The unique MongoDB ObjectId of the course to retrieve

Response

boolean
required
Indicates whether the request was successful
string
Error message when the course is not found (only present when success is false)
object
Detailed course information including content structure

Success Response

Error Responses

Error Codes

Success (with error message)
The request was processed successfully, but the course was not found. Check the success field and message in the response.
Internal Server Error
An unexpected error occurred while fetching the course. This typically indicates a database connection issue, invalid ObjectId format, or server error.

Implementation Notes

  • Both published and unpublished courses can be retrieved with this endpoint
  • The following fields are excluded from the response:
    • courseRatings (individual user ratings array)
    • enrolledStudents (list of enrolled student IDs)
  • The educatorId field is populated with basic educator information (name and image)
  • Free Preview Protection: Lectures where isPreviewFree is false will have their lectureUrl field set to an empty string to prevent unauthorized access
  • If an invalid MongoDB ObjectId is provided, a 500 error will be returned
  • The course content structure is fully included, allowing clients to build course curriculum displays

Code Examples

Use Cases

Display Course Details Page

Show Free Preview Content

Build Course Table of Contents