curl --request GET \
--url https://api.example.com/api/user/enrolled-courses{
"success": true,
"enrolledCourses": [
{
"_id": "60d5ec49f1b2c72b8c8e4f1a",
"title": "Complete Web Development Bootcamp",
"thumbnail": "https://res.cloudinary.com/skillrise/image/upload/v1234567890/courses/web-dev.jpg",
"price": 49.99,
"educator": {
"_id": "educator_123abc",
"name": "Jane Smith",
"imageUrl": "https://..."
},
"totalLectures": 120,
"totalDurationMinutes": 1800,
"userRating": 5
},
{
"_id": "60d5ec49f1b2c72b8c8e4f1b",
"title": "Python for Data Science",
"thumbnail": "https://res.cloudinary.com/skillrise/image/upload/v1234567890/courses/python-ds.jpg",
"price": 39.99,
"educator": {
"_id": "educator_456def",
"name": "Bob Johnson",
"imageUrl": "https://..."
},
"totalLectures": 80,
"totalDurationMinutes": 1200,
"userRating": null
}
]
}
Retrieve list of courses the authenticated user is enrolled in with course details and user ratings
curl --request GET \
--url https://api.example.com/api/user/enrolled-courses{
"success": true,
"enrolledCourses": [
{
"_id": "60d5ec49f1b2c72b8c8e4f1a",
"title": "Complete Web Development Bootcamp",
"thumbnail": "https://res.cloudinary.com/skillrise/image/upload/v1234567890/courses/web-dev.jpg",
"price": 49.99,
"educator": {
"_id": "educator_123abc",
"name": "Jane Smith",
"imageUrl": "https://..."
},
"totalLectures": 120,
"totalDurationMinutes": 1800,
"userRating": 5
},
{
"_id": "60d5ec49f1b2c72b8c8e4f1b",
"title": "Python for Data Science",
"thumbnail": "https://res.cloudinary.com/skillrise/image/upload/v1234567890/courses/python-ds.jpg",
"price": 39.99,
"educator": {
"_id": "educator_456def",
"name": "Bob Johnson",
"imageUrl": "https://..."
},
"totalLectures": 80,
"totalDurationMinutes": 1200,
"userRating": null
}
]
}
userId is automatically extracted from the authentication token.
Show course properties
{
"success": true,
"enrolledCourses": [
{
"_id": "60d5ec49f1b2c72b8c8e4f1a",
"title": "Complete Web Development Bootcamp",
"thumbnail": "https://res.cloudinary.com/skillrise/image/upload/v1234567890/courses/web-dev.jpg",
"price": 49.99,
"educator": {
"_id": "educator_123abc",
"name": "Jane Smith",
"imageUrl": "https://..."
},
"totalLectures": 120,
"totalDurationMinutes": 1800,
"userRating": 5
},
{
"_id": "60d5ec49f1b2c72b8c8e4f1b",
"title": "Python for Data Science",
"thumbnail": "https://res.cloudinary.com/skillrise/image/upload/v1234567890/courses/python-ds.jpg",
"price": 39.99,
"educator": {
"_id": "educator_456def",
"name": "Bob Johnson",
"imageUrl": "https://..."
},
"totalLectures": 80,
"totalDurationMinutes": 1200,
"userRating": null
}
]
}
{
"success": false,
"message": "User not found"
}
{
"success": false,
"message": "An unexpected error occurred"
}
| Status Code | Description |
|---|---|
| 200 | Success |
| 401 | Unauthorized - Invalid or missing authentication token |
| 404 | User not found |
| 500 | Internal server error |
enrolledStudents field is excluded from course data in the responsecourseRatings array within each course