Knowledgium API Documentation
Vokal hack day stuff.
Coders (users)
Create A New Coder
POST: /api/coder/register/
Body:
{
"email": "hibiki@kamenrider.co.jp",
"password": "henshin",
"first_name": "KR",
"last_name": "Hibiki"
}
Notes:
first_name
andlast_name
are not required.
Response:
{
"id": 1,
"token": "sahfdlhsafh02373274027402742128hsdfg8s83"
}
Status Codes:
201
if successfully created400
if incorrect data is provided (badly formatted email or empty string for password)409
if a Coder with this email already exists.
Login Coder
POST: /api/coder/login/
Body:
{
"email": "hibiki@kamenrider.co.jp",
"password": "henshin"
}
Response:
{
"id": 1,
"token": "sahfdlhsafh02373274027402742128hsdfg8s83"
}
Status Codes:
200
if successfully logged in400
if bad data were provided401
if credentials are invalid
Current Coder
GET: /api/coder/
Body:
{
"id": 1,
"email": "hibiki@kamenrider.co.jp",
"first_name": "KR",
"last_name": "Hibiki",
"created": "YYYY-MM-DD"
}
Notes:
- the
HTTP_AUTHORIZATION
header will have to be set to the user's token in the request - ex:
Token sahfdlhsafh02373274027402742128hsdfg8s83
in the header
Status Codes:
200
if successful401
if unauthorized
Content
Create a Category
POST: /api/category/all/
Body:
{
"title": "Japanese Live Action"
}
Notes:
- Set
HTTP_AUTHORIZATION
header here - Only users with
is_staff
set toTrue
(admins) can create categories
Status Codes:
201
if created403
if non-admin tries to create
List all Categories
GET: /api/category/all/
Response:
[
{
"id": 1,
"title": "Japanese Live Action"
},
{
"id": 2,
"title": "Anime"
},
]
Status Codes:
-200
success
Create Content
POST: /api/content/