Skip to content

giacoletti/course_library_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CourseLibrary API

CourseLibrary REST API built in .NET 6.

Dependencies


API documentation

Get Authors

Get Authors Request

GET /api/authors

or with request query string optional parameters

GET /api/authors?mainCategory={{category}}&q={{searchQuery}}&pageNumber={{pageNum}}&pageSize={{pageSize}}

Get Authors Response

200 Ok
[
  {
    "id": "102b566b-ba1f-404c-b2df-e2cde39ade09",
    "name": "Arnold The Unseen Stafford",
    "age": 66,
    "mainCategory": "Singing"
  }
]

Get Author

Get Author Request

GET /api/authors/{{id}}

Get Author Response

200 Ok
{
  "id": "102b566b-ba1f-404c-b2df-e2cde39ade09",
  "name": "Arnold The Unseen Stafford",
  "age": 66,
  "mainCategory": "Singing"
}

Create Author

Create Author Request

POST /api/authors
{
  "firstName" : "Jane",
  "lastName" : "Skewers",
  "dateOfBirth" : "1968-03-04T00:00:00",
  "mainCategory": "Rum"
}

Create Author Response

201 Created
Location: {{host}}/api/authors/{{id}}
{
  "id": "2d594794-5ce3-485a-981f-7c62fadbdd82",
  "name": "Jane Skewers",
  "age": 55,
  "mainCategory": "Rum"
}

Get Authors Options

Get Authors Options Request

OPTIONS /api/authors

Get Authors Options Response

200 Ok

Headers: (No body)

{
  "Allow": "GET,HEAD,POST,OPTIONS",
  ...
}

Get Courses For Author

Get Courses For Author Request

GET /api/authors/{{authorId}}/courses

Get Courses For Author Response

200 Ok
[
  {
    "id": "5b1c2b4d-48c7-402a-80c3-cc796ad49c6b",
    "title": "Commandeering a Ship Without Getting Caught",
    "description": "Commandeering a ship in rough waters isn't easy.  Commandeering it without getting caught is even harder.  In this course you'll learn how to sailaway and avoid those pesky musketeers."
  }
]

Get Course For Author

Get Course For Author Request

GET /api/authors/{{authorId}}/courses/{{courseId}}

Get Course For Author Response

200 Ok
{
  "id": "5b1c2b4d-48c7-402a-80c3-cc796ad49c6b",
  "title": "Commandeering a Ship Without Getting Caught",
  "description": "Commandeering a ship in rough waters isn't easy.  Commandeering it without getting caught is even harder.  In this course you'll learn how to sail away and avoid those pesky musketeers."
}

Create Course For Author

Create Course For Author Request

POST /api/authors/{{authorId}}/courses
{
	"title" : "Top Pirate Hits of Last Decade",
	"description" : "Learn the lyrics and notes to the latest pirate hits"
}

Create Course For Author Response

201 Created
Location: {{host}}/api/authors/{{authorId}}/courses/{{courseId}}
{
  "id": "015ddd8a-ed8c-4116-bca5-8f155a7c8ba5",
  "title": "Top Pirate Hits of Last Decade",
  "description": "Learn the lyrics and notes to the latest pirate hits"
}

Update Course For Author

Update Course For Author Request

PUT /api/authors/{{authorId}}/courses/{{courseId}}
{
  "title": "Updated title",
  "description": "Updated description"
}

Update Course For Author Response

204 No Content

or

201 Created
Location: {{host}}/api/authors/{{authorId}}/courses/{{courseId}}
{
  "id": "015ddd8a-ed8c-4116-bca5-8f155a7c8ba5",
  "title": "Updated title",
  "description": "Updated description"
}

Partially Update Course For Author

Partially Update Course For Author Request

PATCH /api/authors/{{authorId}}/courses/{{courseId}}
[
  {
    "op": "replace",
    "path": "/title",
    "value": "Updated title"
  }
]

Partially Update Course For Author Response

204 No Content

or

201 Created
Location: {{host}}/api/authors/{{authorId}}/courses/{{courseId}}
{
  "id": "015ddd8a-ed8c-4116-bca5-8f155a7c8ba5",
  "title": "Updated title",
  "description": "Updated description"
}

Delete Course For Author

Delete Course For Author Request

DELETE /api/authors/{{authorId}}/courses/{{courseId}}

Delete Course For Author Response

204 No Content

Acknowledgments

License

The software is available as open source under the terms of the MIT License.