- GET: View
- POST: Create
- PUT: Update
- DELETE: Delete
{
"error": "message with details"
}
GET /api/repo/ (200)
Sample Response:{ "categories": [ "catid_1", "catid_2" ] }
GET /api/repo/category/:category (200 - 404)
Sample Response:{ "name": "Category name", "subcategories": [ "subid_1", "subid_2" ] }
POST /api/repo/category/:category (201 - 409, 503)
Request Body:{ "name": "Category name" }
PUT /api/repo/category/:category (204 - 503)
Request Body:{ "name": "Category name" }
DELETE /api/repo/category/:category (204 - 503)
GET /api/repo/category/:category/:sub (200 - 404)
Sample Response:{ "name": "Subcategory name", "items": [ "itemid_1", "itemid_2" ] }
POST /api/repo/category/:category/:sub (201 - 409, 503)
Request Body: { "name": "Subcategory name" }
PUT /api/repo/category/:category/:sub (204 - 503)
Request Body: { "name": "Category name" }
DELETE /api/repo/category/:category/:sub (204 - 503)
GET /api/repo/category/:category/:sub/item/:item (200 - 404)
Sample Response:
{
"hash": "sha1",
"title": "Item Title",
"body": "<h1>Sample Body</h1><p>some text</p>",
"difficulty": "Beginner"
}```
### Create
**POST** /api/repo/category/:category/:sub/item/:item _(201 - 503)_
**Request Body**:
{ "title": "Item Title", "body": "
some text
", "difficulty": "Beginner" }```PUT /api/repo/category/:category/:sub/item/:item (204 - 409, 503)
Request Body:
{
"hash": "sha1",
"title": "Item Title",
"body": "<h1>Sample Body</h1><p>some text</p>",
"difficulty": "Beginner"
}```
### Delete
**DELETE** /api/repo/category/:category/:sub/item/:item _(204 - 503)_