GET, POST methods
GET method returns all announcments
You can filter announcements by adding GET parameters like:
?subject=matematyka
You can add multiple filters joing them using '&':
?subject=informatyka&price_from=10
All avaible filters:
- price_from
- price_to
- subject
- degree_course
- semester
- is_negotiable
- date_posted_from
- date_posted_to
Date format is: YYYY-mm-dd
You can also sort by price or date using:
?price_sort=asc
?date_sort=desc
POST method
{
"title": "Ucze jak robić równania różniczkowe",
"content": "fajny opis",
"price": 120,
"is_negotiable": false,
"degree_course": "informatyka",
"subject": "matematyka",
"semester": 4
}Only users with prz collage email can add announcements!
GET, PUT, DELETE methods
You can edit announcement using PUT method (the same json as in announcements)
POST method
{
"username": "pijoter",
"email": "pjoter12@demo.com",
"password": "qwerty",
"name": "Piotr",
"surname": "Kowalski"
}POST method
user can be either an email or username
{
"user": "pjoter12@demo.com",
"password": "qwerty"
}GET method
GET, PUT, DELETE method
Returns logged user info.
To edit account use PUT method with following json:
{
"description": "Fajny. młody, ciekawy a co najważniejsze przystojny chłopak",
"email": "4DERT@demo.com",
"name": "Jarosław",
"phone": "213742071",
"surname": "Jarząbkowski",
"semester": 4,
"degree_course": "informatyka"
}degree_course, semester and phone can NULL. Make sure phone is an string value and semester is INT from 1 to 7.
PUT method
Allows to change passowrd
{
"old_password": "qwerty",
"new_password": "password"
}GET, PUT, DELETE methods
This endpoint returns base64 encoded image (png or jpg) To send avatar use PUT method (couse default is NULL) and use form-data with key named 'file'. Avatar must be either PNG or JPEG, max size 512 x 512 px
GET method
Returns info about given user
POST, PUT, DELETE methods
{
"rate": 5,
"review": "Fajny korepetytor"
}GET methods Returns base64 encoded image (png or jpg)
GET, POST method
Returns all subjects
POST - this methods are only available for admin
To add subject use POST method with following JSON:
{
"subject" : "matematyka",
"degree_course" : "informatyka",
"semester" : 1
}GET, PUT, DELETE methods
GET - returns more detailed subject data
PUT, DELETE - this methods are only available for admin, PUT uses the same JSON as subjects
GET, POST method
Returns all degree_courses
To add degree courses use POST with following JOSN:
{
"degree_course": "informatyka"
}This method is only available for admin
GET, PUT, DELETE method
GET - returns more detailed degree course data
PUT, DELETE - this methods are only available for admin, PUT uses the same JSON as degree_courses
You can configure an app secret key and admin usernames in .env file:
SECRET_KEY="KEY"
ADMINS=4DERT,pablo
PORT=8080
IS_DEBUG=True
DATABASE_URI="sqlite:///db.sqlite3"- user sesions and log in
- password hash
- announcements filtering
- loged user info endpoint
- other users info endpoint
- find better validation system, try...catch is bleh
- find way to store user avatars in the db
- announcements sorting
- add ratings and reviews about users
- store SECRET_KEY in .env
- announcements editing
- announcements deleting
- reviews editing
- reviews deleting
- account editing
- account deleting
- subjects editing
- subjects deleting
- degree course editing
- degree course deleting
- add endpoint to change password
- and more... ?