-
Notifications
You must be signed in to change notification settings - Fork 2
RESTful Services API
xinruili07 edited this page Mar 2, 2020
·
14 revisions
Our project is deployed on Heroku: Link here
All the use cases of the employer viewpoint are available as RESTful services using Java Spring. Next section will briefly summarize all the RESTful service endpoints we have implemented.
User Profile/Person/App User
- Create an account (for AppUser and AppAdmin)
- Account Log In (for AppUser and AppAdmin)
- Update Profile Information (Profile information is initialized to null)
- Get UserProfile by Person
Pet Post
Adopt Request
- Create AdoptRequest
- Delete AdoptRequest
- Get AdoptRequest by adoptRequestId
- Get list of all AdoptRequest
Question
- Create Question
- Update Question
- Delete Question
- Get Question by questionId
- Add answer to Question
- Get list of all Questions
Donation
Title | AppUser: Create an account |
---|---|
URL | /appuser |
Method | POST |
URL Params | username=[String] |
Data Params | Required password=[String], appUserRole=[PersonRole] |
Success Response | Code: 200 Ok Request Body Example: { "username": "michael", "password": "mcgill123", "appUserRole": "ADOPTER"}" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "Username cannot be empty!" 2) "Password cannot be empty!" 3) "AppUserRole cannot be empty!" |
Description | Allows a person to signup for an appUser account |
Title | AppAdmin: Create an account |
---|---|
URL | /appadmin |
Method | POST |
URL Params | username=[String] |
Data Params | Required password=[String] |
Success Response | Code: 200 Ok Request Body Example: { "username": "michael", "password": "mcgill123"}" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "Username cannot be empty!" 2) "Password cannot be empty!" Code:500 Internal Server Error: 1) "Can only have one admin!" |
Description | Allows the petshelter to signup for an appAdmin account |
Title | AppUser: Account Login |
---|---|
URL | /loginuser |
Method | POST |
URL Params | username=[String] |
Data Params | Required: password=[string] |
Success Response | Code: 200 Ok Response Body: blank |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "Username cannot be empty!" 2) "Password cannot be empty!" 3)"This account cannot be found!" |
Description | Allows an existing user to login |
Title | AppAdmin: Account Login |
---|---|
URL | /loginadmin |
Method | POST |
URL Params | username=[String] |
Data Params | Required: password=[string] |
Success Response | Code: 200 Ok Response Body: blank |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "Username cannot be empty!" 2) "Password cannot be empty!" 3)"This account cannot be found!" |
Description | Allows an existing admin to login |
Title | UserProfile/Person: Update Profile Information |
---|---|
URL | /update_profile/ |
Method | POST |
URL Params | None |
Data Params | UserProfileDto object |
Success Response | Code: 200 Ok Response Body: { "address": "new address", "hasExperienceWithPets": "false", "numbersOfPetsCurrentlyOwned": "0", "typeOfLivingAccomodation": "house"}" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "hasExperienceWithPets is set to false but numberOfPetsCurrentlyOwned != 0" |
Description | User must provide relevant information about themselves and their homes. |
Title | UserProfile/Person: Get UserProfile by person |
---|---|
URL | /user_profile/{username} |
Method | GET |
URL Params | username=[string] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: { "address": "new address", "hasExperienceWithPets": "false", "numbersOfPetsCurrentlyOwned": "0", "typeOfLivingAccomodation": "house"}" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such username" |
Description | Users can access their own as well as other's user profiles |
Title | PetPost: Create PetPost |
---|---|
URL | /petPosts/newPetPost |
Method | POST |
URL Params | None |
Data Params | PetPostDTO object |
Success Response | Code: 200 Ok Response Body: { "availability": "true", "name": "doggo", "typeOfPet": "Dog", "description": "very calm", "relatesTo": "question"}" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "No availability" 2) Empty name field 3) Empty type of pet |
Description | Users can create a new pet post. |
Title | PetPost: Delete a petPost by petPostId |
---|---|
URL | /deletePetPost/{petPostId} |
Method | DELETE |
URL Params | petPostId=[Integer] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: { "petPostId": "1" }" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such petPost" |
Description | Users can delete their pet posts. |
Title | PetPost: Update a petPost |
---|---|
URL | /update/{petPostId} |
Method | PATCH |
URL Params | petPostId=[Integer] |
Data Params | PetPostDto Object |
Success Response | Code: 200 Ok Response Body: { "availability": "true", "name": "doggo", "typeOfPet": "Dog", "description": "very calm", "relatesTo": "question"}" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such pet post" |
Description | Users can edit the content of their pet post. |
Title | PetPost: Get PetPost by petPostId |
---|---|
URL | /petPost/{petPostId} |
Method | GET |
URL Params | petPostId=[Integer] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: Response Body: { "availability": "true", "name": "doggo", "typeOfPet": "Dog", "description": "very calm", "relatesTo": "question"}" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such pet Post" |
Description | View a specific pet post by pet post ID. |
Title | PetPost: Get list of all PetPosts |
---|---|
URL | /petPost/ |
Method | GET |
URL Params | None |
Data Params | None |
Success Response | Code: 200 Ok Response Body: A list of all pet PostsDto Objects |
Error Response | Code: 400 Bad Request |
Description | View all pet posts. |
Title | adoptRequest: create adopt request |
---|---|
URL | /adoptRequest/{petPostId} |
Method | POST |
URL Params | petPostId=[Integer] |
Data Params | adoptRequestDto Object |
Success Response | Code: 200 Ok Response Body: { "status": "PENDING", "requestBy": "username", "requesting": "petPost", "adoptRequestId": "1"} |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "No such pet post" |
Description | Users can submit a request to a pet post. |
Title | adoptRequest: Delete an adopt request |
---|---|
URL | /deleteAdoptRequest/{adoptRequestId} |
Method | DELETE |
URL Params | adoptRequestId=[Integer] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: { "adoptRequestId": "1" }" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such adoptRequest" |
Description | Users can delete one of their adopt request. |
Title | adoptRequest: Get a specific adopt request |
---|---|
URL | /adoptRequest/{adoptRequestId} |
Method | GET |
URL Params | adoptRequestId=[Integer] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: An adoptRequestDto object |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such adoptRequest" |
Description | View a specific adoptRequest |
Title | PetPost: Get all adoptRequest |
---|---|
URL | /adoptRequest/ |
Method | GET |
URL Params | None |
Data Params | None |
Success Response | Code: 200 Ok Response Body: List of all adoptRequestDto Objects |
Error Response | Code: 400 Bad Request |
Description | View all adopt requests |
Title | Question: create question |
---|---|
URL | /question/{petPostId} |
Method | POST |
URL Params | petPostId=[Integer] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: { "question": "What does the pet like to eat", "answer": "", "isRelatedTo": "petPost", "person": "username", "questionId": "1"} |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "No such pet post" |
Description | Users can submit a question to a pet post. |
Title | Question: Delete a question |
---|---|
URL | /deleteQuestion/{questionId} |
Method | DELETE |
URL Params | questionId=[Integer] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: { "questionId": "1" }" |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such question" |
Description | Users can delete one of their question. |
Title | Question: Get a specific question by questionId |
---|---|
URL | /question/{questionId} |
Method | GET |
URL Params | questionId=[Integer] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: An questionDto object |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such question" |
Description | View a specific question |
Title | Question: add an answer to a question |
---|---|
URL | /question/{questionId} |
Method | PATCH |
URL Params | questionId=[Integer] |
Data Params | questionDto Object |
Success Response | Code: 200 Ok Response Body: new questionDto object with updated answer field |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such user" |
Description | View all adopt requests by a specific person |
Title | PetPost: Get list of all questions related to a specific pet post |
---|---|
URL | /questions/{petPostId} |
Method | GET |
URL Params | petPostId=[Integer] |
Data Params | None |
Success Response | Code: 200 Ok Response Body: List of questionDto Objects |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "There is no such pet Post" |
Description | View all questions related to a specific pet post. |
Title | Donation: create donation |
---|---|
URL | /donation |
Method | POST |
URL Params | None |
Data Params | DonationDto Object |
Success Response | Code: 200 Ok Response Body: { "amount": "5$", "comment": "Thanks for the post", "setNameAnonymous": "true", "person": "Person", "donationId": "1"} |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "Invalid field" |
Description | Users can give a donation. |
Title | Donation: Get a list of all donations |
---|---|
URL | /donation |
Method | GET |
URL Params | None |
Data Params | None |
Success Response | Code: 200 Ok Response Body: List of DonationsDto Objects |
Error Response | Code: 400 Bad Request Error Message Examples: 1) "Invalid field" |
Description | View a list of all donations. |
Meeting Minutes
Efforts
Report
Meeting Minutes
Efforts
Report
Meeting Minutes
Efforts
Report
Meeting Minutes
Efforts
Report