-
Notifications
You must be signed in to change notification settings - Fork 3
API Documentation
When Permission Required == 'IsAuthenticated', Token must be satisfied.
DateFormat = Will be given
Signup user with credentials that are needed to create a user.
URL : /auth/register/
Method : POST
Auth required : NO
Permissions required : None
Code : 200 OK
Body
User Types:
{
"ADMIN": 0
"DOCTOR": 1,
"MEMBER": 2,
}
For User:
{
"email": [email protected],
"password": joedoepassword,
"type": 2,
}
- Initially, the default signup endpoint handles the fields of the Abstract Base User class.
Log user in with credentials that are needed for a user to login.
URL : /auth/login/
Method : POST
Auth required : NO
Permissions required : None
Code : 200 OK
Body
User Types:
{
"ADMIN": 0
"DOCTOR": 1,
"MEMBER": 2,
}
For User:
{
"email": [email protected],
"password": joedoepassword,
"type": 2,
}
For Token:
{
"data": {
"email":[email protected],
"password: joedowpassword
}
"token": 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b
}
- Initially, the default signup endpoint handles the fields of the Abstract Base User class.
- If the user is a Doctor (type: 1), they can only use their e-mail address to login.
- If the user is a Member (type: 2), they can either use their e-mail address or their username to login. It is checked later which is used.
Validate token and return personal information of the user.
URL : /auth/me/
Method : GET
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
Code : 200 OK
Remove user's token to invalidate the token
URL : /auth/logout/
Method : GET
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
Code : 200 OK
This endpoint gives all the posts using pagination. You can also use this endpoint for your search inquiries
URL : /forum/posts
Method : GET
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Query
?page=int
?page_size=int
?q=space-separated string values
?c=exact category name as string
?dist=maximum distance as int
If you provide a dist param, you also have to provide "latitude" and "longitude" params,
which are both float values where decimals and floating part are separated via a dot
?longitude=1.233333
?latitude=5.555555
Body
"items":[{
"title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
},
{
"title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
},
.
.
.
]
"count": 13,
"next": link,
"previous": link
Code : 200 OK
Fetch post data by id
URL : /forum/post/<id: int>
Method : GET
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{ "title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
}
Code : 200 OK
Fetch posts by passing-in user id
URL : /forum/post/user/<user_id: int>
Method : GET
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{
"page_number": 0,
"sort": "desc" or "asc"
}
- Page size is 10. The example below can be misleading in that sense.
{
"data": [
{
"id": 4,
"title": "qweqw1111eqwe",
"body": "asdasf2222dsfasd",
"date": "2022-11-27T12:41:34.749348",
"upvote": 0,
"downvote": 0,
"author": 13
}
],
"total": 9,
"page_number": 2,
"last_page": 2
}
Code : 200 OK
Fetch posts by passing-in user id.
URL : /profile/upvoted_posts/<user_id: int>
- Returns upvoted posts of user with given ID
URL : /profile/upvoted_posts/
- Returns upvoted posts of user who makes the request
Method : GET
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{
"page_number": 0,
"sort": "desc" or "asc"
}
{
"data": [
{
"id": 3,
"title": "Title",
"body": "Body",
"date": "2022-11-21T19:03:12.207500",
"upvote": 5,
"downvote": 5,
"author": 5
},
{
"id": 4,
"title": "qweqw1111eqwe",
"body": "asdasf2222dsfasd",
"date": "2022-11-27T12:41:34.749348",
"upvote": 1,
"downvote": 0,
"author": 13
},
{
"id": 5,
"title": "ewqeqweqwe",
"body": "eeeee",
"date": "2022-11-27T12:41:41.367483",
"upvote": 1,
"downvote": 0,
"author": 13
}
],
"total": 3,
"page_number": 0,
"last_page": 0
}
Code : 200 OK
Create a new post with necessary info.
URL : /forum/post
Method : POST
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{ "title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"image_urls": ["url1", "url2"]
}
{ "post: {
"title" : "Test Title",
"author" : "Test Author",
"body" : "Test Body",
"date" : DateFormat,
"upvote" : 0,
"downvote" : 0,
},
"image_urls":["url1", "url2"]
}
Code : 200 OK
Fetch post data by id
URL : /forum/post/<id: int>/upvote
URL : /forum/post/<id: int>/downvote
Method : POST
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{ "title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
}
Code : 200 OK
Fetch post data by id
URL : /forum/post/comment/<id: int>/upvote
URL : /forum/post/comment/<id: int>/downvote
Method : POST
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
}
Code : 200 OK
This endpoint gives all the articles using pagination.
URL : /articles/all
Method : GET
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Query
?page=int
Body
"items":[{
"title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
},
{
"title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
},
.
.
.
]
"count": 13,
"next": link,
"previous": link
Code : 200 OK
Create a new article with necessary info.
URL : /articles/article
Method : POST
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{ "title" : "Test Title"
"author" = "Test Author"
"body" = "Test Body"
}
{
"title" : "Test Title",
"author" : "Test Author",
"body" : "Test Body",
"date" : DateFormat,
"upvote" : 0,
"downvote" : 0,
}
Code : 200 OK
Fetch, update or delete article data by id
URL : /articles/article/<id: int>
Method : GET, POST, DELETE
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
if method == GET or UPDATE
{ "title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
}
Code : 200 OK
if method == DELETE
Code : 200 OK
Fetch articles by passing-in user id.
URL : /profile/upvoted_articles/<user_id: int>
- Returns upvoted articles of user with given ID
URL : /profile/upvoted_articles
- Returns upvoted articles of user who makes the request
Method : GET
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{
"page_number": 0,
"sort": "desc" or "asc"
}
{
"data": [
{
"id": 5,
"title": "5",
"body": "test article body",
"date": "2022-11-27T14:56:08.129099",
"upvote": 1,
"downvote": 0,
"author": 23
},
{
"id": 4,
"title": "4",
"body": "test article body",
"date": "2022-11-27T14:56:04.684648",
"upvote": 1,
"downvote": 0,
"author": 23
},
{
"id": 3,
"title": "3",
"body": "test article body",
"date": "2022-11-27T14:56:01.724406",
"upvote": 1,
"downvote": 0,
"author": 23
},
{
"id": 2,
"title": "second",
"body": "test article body",
"date": "2022-11-27T14:55:58.392944",
"upvote": 1,
"downvote": 0,
"author": 23
}
],
"total": 4,
"page_number": 0,
"last_page": 0
}
Code : 200 OK
Fetch post data by id
URL : /articles/article/<id: int>/upvote
URL : /articles/article/<id: int>/downvote
Method : POST
Auth required : YES
Permissions required : IsAuthenticated
Header
{
"Authorization": "Token 944b09199c62bcf9418ad846dd0e4bbdfc6ee4b"
}
Body
{
"title" : "Test Title"
"author" : "Test Author"
"body" : "Test Body"
"date" : DateFormat
"upvote" : 3
"downvote" : 2
}
Code : 200 OK
🏠 Homepage
- Alper Canberk Balcı
- Baver Bengin Beştaş
- Burak Mert
- Halil Burak Pala
- Kardelen Demiral
- Sinan Kerem Gündüz
- Yavuz Samet Topçuoğlu
- Mehmet Emre Akbulut
- Oğuzhan Demirel
- Engin Oğuzhan Şenol
- Irfan Bozkurt
- Ozan Kılıç
Meeting Notes From CMPE352
Meeting Notes From CMPE451
- Meeting 13.1
- Meeting 14.1
- Meeting 15.1
- Meeting 16.1
- Meeting 18.1
- Meeting 19.1
- Meeting 20.1
- Meeting 21.1
- Meeting 23.1
- Meeting 24.1
Backend Team Meetings
Frontend Team Meetings
Mobile Team Meetings
- Customer Meeting 1
- Customer Meeting 2
- Customer Meeting 3
- Customer Meeting 4
- Customer Meeting 5
- Milestone 1 Presentation Notes
- Milestone 2 Presentation Notes
- Milestone 3 Presentation Notes
Scenarios
- Scenario 1 for CMPE451:Milestone 1
- Scenario 2 for CMPE451:Milestone 1
- Scenario 1 for CMPE451:Milestone 2
- Scenario 2 for CMPE451:Milestone 2
- Scenario 3 for CMPE451:Milestone 2
- Scenario 1 for CMPE451:Final Milestone
- Scenario 2 for CMPE451:Final Milestone
- Scenario 1 for CMPE352
- Scenario 2 for CMPE352
- Scenario 3 for CMPE352