GET - Get a course by its name (like joy-of-programming)
PUT - Update course details
DELETE - Delete a course
/courses/:course_name/assets
Methods:
GET - Get list of assets in a course
POST / PUT - Add a new asset
/courses/:course_name/lessons
Methods:
GET - Get list of lessons in a course
POST / PUT - Add a new lesson
/courses/:course_name/authors
Methods:
GET - Get list of authors in a course
POST / PUT - Add a new author
/assets/:course_name/:path_to_asset
Methods:
GET - Get asset at the specified path
PUT - Update asset at the specified path
DELETE - Delete the asset
/lessons/:course_name/:path_to_lesson:path_to_lesson can have at most 1 level of hierarchy. Either,
:path_to_lesson = lesson-name or module-name/lesson-name
Methods:
Part of #4
REST API
Resources:
courses
,assets
,lessons
,authors
Base prefix:
/api
Endpoints:
/courses
Methods:GET
- Get all coursesPOST
- Create a new course/courses/:course_name
Methods:GET
- Get a course by its name (likejoy-of-programming
)PUT
- Update course detailsDELETE
- Delete a course/courses/:course_name/assets
Methods:GET
- Get list of assets in a coursePOST
/PUT
- Add a new asset/courses/:course_name/lessons
Methods:GET
- Get list of lessons in a coursePOST
/PUT
- Add a new lesson/courses/:course_name/authors
Methods:GET
- Get list of authors in a coursePOST
/PUT
- Add a new author/assets/:course_name/:path_to_asset
Methods:GET
- Get asset at the specified pathPUT
- Update asset at the specified pathDELETE
- Delete the asset/lessons/:course_name/:path_to_lesson
:path_to_lesson
can have at most 1 level of hierarchy. Either,:path_to_lesson
=lesson-name
ormodule-name/lesson-name
Methods:GET
- Get lesson at the specified pathPUT
- Update lesson at the specified pathDELETE
- Delete lesson at the specified path/author/:course_name/:author_name
xor/author/:author_name
Methods:GET
- Get lesson at the specified pathPUT
- Update lesson at the specified pathDELETE
- Delete lesson at the specified pathThe problem with this is that we don't have endpoints that will take static IDs. Paths may change with a PUT request. A few solutions could be:
/users/:username
and/user/:id
.@anandology what do you think?