-
Notifications
You must be signed in to change notification settings - Fork 2
API Docs
This page describes all the data types and the endpoints that the backend uses
All data types are represented by JSON Objects. All of the endpoints require the Content-Type header to be application/json.
The id field is not required when creating a new user. However, it is returned by the server on a show user or a show all call. It is also required by the update call. Password is not a field stored in the database. However, setting that field updates related fields in the database. Secret Answer field basically behaves the same as password. Avatar URL is not directly set in the signup.
{"id":Integer, "email": String, "password": String, "fullName": String, "bio": String, "userType": Integer, "dietType": Integer, "secretQuestion": String, "secretAnswer": String, "avatarUrl": String, "isBanned": Boolean}
- 0 : Regular(default)
- 1 : Admin
- 2 : Food Server
- 0 : Omnivore(default)
- 1 : Egg+Diary vegetarian
- 2 : No mushroom or red meat
- 3 : Began
- 4 : Paleo
Only returned by the login call. No need to post that.
{"accessToken": String, "userId": Integer, "creationTime": String, "lastAccessTime": String}
For the endpoints that require Authentication, you need to set the Authorization header to "Bearer $token" to authenticate.
Only posted to the login call.
{"email": String, "password": String}
All endpoints start with /api/. POST calls that take an input require their input to be in the request body.
POST /api/user
Takes: User
Returns: The created User object, with the id set.
POST /api/user/update
Takes: User
Returns: The updated User
This call requires all the fields of the user be present in the request body. Returns a not authorized response if the token given is not valid. Doesn't modify the user object if the given token is for a different user.
GET /api/user
Returns: A list of Users
GET /api/user/:id
Returns: A user Object, if one with the given id exists. If not, a 404 response is returned.
POST /api/user/byEmail
Takes: A single JSON String, the email address Returns: A user object, just like getting one by id
POST /api/user/ban/:id
Requires authorization. Checks if the logged in user is an admin, if it is, bans the user with the given id.
Takes and Returns: Nothing
POST /api/session/login
Takes: Login Credentials Returns: Access Token if the attempt is successful. A Not Authorized (403, I think) response if it is unsuccessful.
POST /api/session/logout
Returns an empty response if the given access token is valid, and then deletes it. Returns a not authorized response if the given token is invalid.
##Show current user GET /api/session/currentUser
Returns the User object referenced by the current Access Token if it is valid. Can be used at startup to check if the token is valid.
- Noor Ahmad
- [Safa Andaç](Safa Andac)
- Behiye Avcı
- Sinem Dalkılıç
- Ekrem Öztürk (Communicator)
- Arda Cinar
- Harun Acar
- Muharrem Yeşilyurt
#Project: #
- Requirements
- [API Docs](API Docs)
- Plan
- Themes/Features
- Personas
- [User Stories](User Stories and Acceptance Criteria)
- [Domain Analysis](Domain Analysis)
- [Responsibility Assignment Matrix](Responsibility Assignment Matrix)
- [Project Communication Plan](Project Communication Plan)
- [Test Cases](Test Cases)
- [Setting Development Environment](Setting Development Environment)
#Diagrams: #
- [Use Cases and Use Case Diagram](Use Cases)
- [Use Case Drafts](Use Case Drafts)
- [Class Diagram](Class Diagram)
- [Activity Diagram](Activity Diagram)
- [Sequence Diagrams](Sequence Diagrams)
#Mockups: #
- [Web Mockups](Web Mockups)
- [Mobile Mockups](Mobile Mockups)
#Meetings: # Spring Semester
-
Fall Semester
-
[Customer Meeting Film-13/10/16](Meeting Film in class)
#Milestones: # Spring Semester
-
[Milestone-1 Report](Milestone-1 Report)
Fall Semester
-
[Milestone-1 Report](Milestone-2 Report)
-
[Milestone-2 Report](Milestone-3 Report)
-
[Milestone-3 Report](Milestone-4 Report)
#Group Works: #
#Documentations: #
- [Git Versioning Basics](Git Versioning Basics)
- [Label Customization and Issue Tracking](Label Customization and Issue Tracking)
- Scrum: An Agile Software Development Methodology
- [Patrick Lencioni: Five Dysfunctions Of A Team](Five Dysfunctions Of A Team)
- Software Development Life Cycles
- [Team Work in Software Engineering](Team Work in Software Engineering)
- [The Puzzle of Motivation](The Puzzle Of Motivation)
- Communication
- [Good and Bad Practices](Good and Bad Practices)
- Kaizen and 5S