Skip to content
Martim de Carvalho e Sousa Pinto da Silva edited this page Jun 12, 2020 · 1 revision

A7: High-level architecture. Privileges. Web resources specification.

The project consists in developing a global marketplace which specializes in the sale of gaming related digital products using redemption keys.

By the end of the seventh iteration, it will be already established:

  • The routes and endpoints of the platform
  • All actions are defined as well as the technology used for that action. The input parameters that should be included in the HTTP requests are also included
  • The permission of access to this routes
  • JSON response are identified and defined

1. Overview

M01: Authentication and register Resources associated with user authentication and sign in into the platform
M02: Individual user profile Resources associated with personal information and property acquired/sold management
M03: Administration Resources associated with the administration interface
M04: Product Search and interaction Resources associated with the product searching in the website and the pages describing each product
M05: Cart and checkout Resources associated with the personal shopping cart and the checkout process
M06: Offer Resources associated with offer placement/canceling and discounts
M07: Social Interaction Resources associated with the community part of the website includes reporting and feedback.
M08: Static Pages Static resources of the platform.
Table 1: Overview

2. Permissions

PUB Public Group of users without any permission on the platform
ATHUSER Authenticated User User which login was successful. Has the privilege to access to his personal account information.
ATVUSER Active User Authenticated user which is not banned. Has full privileges in the platform such as selling and buying products
BUY Buyer Active User that after buying a product acquires privileges in the bought he made, such as possibility to submit reports and feedback
SELL Seller Active User that after publishing an offer acquires privileges in the offer he made, such as possibility to cancel and edit it
BAN Banned User Authenticated user that because of it behaviour has is privileges in the website reduced
ADM Administrator Administrator is a special type of user which have all privileges of adding/editing and removing content
Table 2: Permissions

3. Modules

3.1 Authentication and register

Endpoints of Module: Authentication and register
  • R101: Login Form[/login]
  • R102: Login Action [/login]
  • R103: Register Form[/register]
  • R104: Register Action [/register]
  • R105: Login with Google Action [/login]
  • R106: Register with Google Action [/register]
  • R107: Admin Login Form [/admin/login]
  • R108: Admin Login Action [/admin/login]
  • R109: Logout User[/logout]
  • R110: Logout Admin[/admin/logout]
  • R111: Password Recovery Form[/password/reset]
  • R112: Password Reset Link Form[/password/reset/{token}]
  • R113: Password Reset Action[/password/reset]
  • R114: Send Recovery Link Action[/password/email]

R101: Login Form

URL /login
Description Page with a form to login.
Method GET
UI UI07 Sign in/up
Submit R102
Permissions PUB
Table 3: Login Form

R102: Login Action

URL /login
Description Action to submit the login request.
Method POST
Request Body +username: string Username to check login
+password: string Password to check login
Redirects Current page Success
Login page Error
Permissions PUB
Table 4: Login Action

R103: Register Form

URL /register
Description Page with a form to register to a user account.
Method GET
UI UI07 Sign in/up
Submit R104
Permissions PUB
Table 5: Login Form

R104: Register Action

URL /register
Description Action to submit the register request.
Method POST
Request Body +username: string Username to be used
+email: string Email to be used
+birthDate: date Birth date to be used
+password: string Password to be used
+password_confirmation: string Password to checked against password
Redirects Current page Success
Sign up page Error
Permissions PUB
Table 6: Register Action

R105: Google Login Action

URL /login
Description Action to submit the login request.
Method POST
Request Body +username: string Username to check login
+password: string Password to check login
Returns 200 OK The login is successful and the login modal is closed
400 Bad Request The form is malformed
401 Unauthorized The login was wrong. A message broadcasting the error is displayed in the modal
Permissions PUB
Table 7: Google Login Action

R106: Google Register Action

URL /register
Description Action to submit the register request.
Method POST
Request Body +username: string Username to be used
+email: string Email to be used
+birthDate: date Birth date to be used
+password: string Password to be used
+password_confirmation: string Password to checked against password
Returns 200 OK Success
400 Bad Request The form is malformed
Permissions PUB
Table 8: Register Action

R107: Admin Login Form

URL /admin/login or /admin
Description View with the admin login form
Method GET
UI UI19 (Admin Page - Login)
Submit R108
Permissions PUB
Table 9: Admin Login Form

R108: Admin Login Action

URL /admin/login
Description Action to submit the admin login request.
Method POST
Request Body +username: string Username to check login
+password: string Password to check login
Redirects R301 Success
R107 Error
Permissions PUB
Table 10: Admin Login Action

R109: Logout User

URL /logout
Description Action to submit the logout request.
Method POST
Redirects R401 Success
Permissions AUTHUSER
Table 11: Logout User

R110: Logout Admin

URL /admin/logout
Description Action to submit the logout request for an admin account.
Method POST
Redirects R107 Success
Permissions ADM
Table 12: Admin Logout

R111:Password Recovery Form:

URL /password/reset
Description View that allows to recovery password using a recovery email.
Method GET
UI
SUBMIT R114
Permissions PUB
Table 13: Password Recovery Form

R112:Password Reset Link Form

URL /password/reset/{token}
Description View that allows to recovery password using a recovery email.
Method GET
Parameters +token: string
UI
SUBMIT R113
Permissions PUB
Table 14:Password Reset Link Form

R113:Password Reset Action

URL /password/reset
Description Action to reset the password
Method POST
Request Body +newPassword: string New account password
Redirects R401 Success
Permissions PUB
Table 15: Password Reset Action

R114:Send Recovery Link Action

URL /password/email
Description Action to send the recovery email password
Method POST
Request Body +email: string Target account email
Redirects R401 Success
Permissions PUB
Table 16: Send Recovery Link Action

3.2 Module Individual User Profile:

Endpoints of Module: Individual User Profile:
  • R201:User Homepage/User Edit View [/user/{username}]
  • R202:User Purchases View [/user/purchases]
  • R203:User Offers View [/user/{username}/offers]
  • R204:User Reports View [/user/reports]
  • R205:User Delete Action [/user]
  • R206:User Delete Profile Picture Action[/user/image]
  • R207:User Update Action [/user]

R201: User Homepage/User Edit View:

URL /user/{username}
Description View that works simultaneously as user profile homepage but also user edit profile.
Method GET
Parameters +username: string Username of the user
UI UI10 (User Page - Account - As own user)
AJAX Calls R205 Called when deleting the account.
R206 Called when the user deletes his profile photo.
R207 Called when the user deletes his profile photo.
Permissions ATHUSER
Table 17: User Homepage/User Edit View

R202: User Purchases View:

URL /user/purchases
Description View with the purchases done.
Method GET
UI UI11 (User Page - Purchases - As own user)
Permissions BUY or BAN
Table 18: User Purchases View

R203: User Offers View:

URL /user/{username}/offers
Description View the offers that either active or already sold out(own profile only).
Method GET
Parameters +username: string Username of the user
UI UI12 (User Page - Offers - As own user)
Permissions PUB or ATHUSER
Table 19: User Offers View

R204: User Reports View:

URL /user/reports
Description View the reports that an user made.
Method GET
UI UI13 (User Page - Reports)
Permissions ATHUSER
Table 20: User Reports View

R205: User Delete Action:

URL /user
Description Action to submit the account delete request.
Method DELETE
Request Body +password: string Password to check the account
Returns 200 OK Success
400 Bad Request Invalid information given
401 Unauthorized Not allowed
404 Not Found User not found
Permissions ATHUSER
Table 21: User Delete Action

R206: User Delete Profile Picture Action:

URL /user/image
Description Action to delete a profile picture.
Method DELETE
Returns 200 OK Success
400 Bad Request Invalid information given
401 Unauthorized Not allowed
404 Not Found User image not found
Permissions ATHUSER
Table 22: User Delete Profile Picture Action

R207: User Update Action:

URL /user
Description Action executed when an update to the user personal information occurs.
Method POST
Request Body ?description: string New description to update the profile
?currentPassword: string Password to check the account
?newPassword: string New password
?newPassword_confirmation: string New password
?newPhoto: file New profile photo
?newEmail: string New email address
?newPaypalAddress: string New paypal address
Returns 200 OK Success
400 Bad Request Invalid information given
401 Unauthorized Not allowed
404 Not Found User not found
Permissions ATHUSER
Table 23: User Update Action

3.3 Module Administration:

Endpoints of module: Administration:
  • R301: Admin Homepage [/admin]
  • R302: Products Listing View [/admin/product]
  • R303: Products Listing Action[/api/admin/product]
  • R304: Product Insertion Form View [/admin/product/form]
  • R305: Product Add Action [/admin/product]
  • R306: Product Update View [/admin/product/{id}]
  • R307: Product Update Action[/admin/product/{id}]
  • R308: Product Remove Action[/admin/product/{id}]
  • R309: Categories Listing View [/admin/category]
  • R310: Categories Listing Action [/api/admin/category]
  • R311: Categories Add Action [/admin/category]
  • R312: Categories Remove Action [/admin/category/{id}]
  • R313: Categories Update Action [/admin/category/{id}]
  • R314: Genres Listing View [/admin/genre]
  • R315: Genres Listing Action [/api/admin/genre]
  • R316: Genres Add Action [/admin/genre]
  • R317: Genres Remove Action [/admin/genre/{id}]
  • R318: Genres Update Action [/admin/genre/{id}]
  • R319: Platforms Listing View [/admin/platform]
  • R320: Platforms Listing Action [/api/admin/platform]
  • R321: Platforms Add Action [/admin/platform]
  • R322: Platforms Remove Action [/admin/platform/{id}]
  • R323: Platforms Update Action [/admin/platform/{id}]
  • R324: Users Listing View [/admin/user]
  • R325: Users Listing Action [/api/admin/user/list]
  • R326: Users Update Action [/admin/user/{id}]
  • R327: Reports Listing View [/admin/report]
  • R328: Reports Listing Action [/api/admin/report]
  • R329: Transactions Listing View [/admin/transaction]
  • R330: Transactions Listing Action [/api/admin/transaction]
  • R331: Reviews Listing View [/admin/review]
  • R332: Reviews Listing Action [/api/admin/review]
  • R333: Reviews Remove Action [/admin/review/{id}]
  • R334: FAQ Listing View [/admin/faq]
  • R335: FAQ Listing Action [/api/admin/faq]
  • R336: FAQ Add Action [/admin/faq]
  • R337: FAQ Update Action [/admin/faq/{id}]
  • R338: FAQ Remove Action [/admin/faq/{id}]

R301: Admin Homepage

URL /admin
Description View the Admin homepage.
Method GET
Returns UI18 (Admin Page - Dashboard)
Permissions ADM
Table 24: Admin Homepage

R302: Products Listing View

URL /admin/product
Description Page that will allow the user to navigate through and choose products.
Method GET
UI UI06 (Admin Page - Dashboard)
AJAX Calls R303 Called by the platform on the page rendering process and when searching.
R308 Called when removing a product.
Permissions ADM
Table 25: Products Listing View

R303: Products Listing Action

URL /api/admin/product
Description Request to return the list of products information.
Method GET
Parameters ?page: integer Results paging.
?query: string String to use as element of searching.
Response Body JSON303
Permissions ADM
Table 26: Products Listing Action

R304: Product Insertion Form View

URL /admin/product/form
Description View to insert a new product.
Method GET
UI UI21 (Admin Page - Add/Edit Product)
Submit R305
Permissions ADM
Table 27: Product Insertion Form View

R305: Product Add Action

URL /admin/product
Description View to insert a new product.
Method PUT
Request Body +productName: string Name of the new product
+gameDescription: string Text with the description for the product
+genres: array Array of id of genres
+platforms: array Array of id of platforms
+categoryId: array Id of game category
+photo: file Photo that describes the game
Redirects R302 Success
Permissions ADM
Table 28: Product Add Action

R306: Product Update View

URL /admin/product/{id}
Description View to update the product information.
Method GET
Parameters +id: integer Product id
UI UI21 (Admin Page - Add/Edit Product)
Submit R307
Permissions ADM
Table 29: Product Update View

R307: Product Update Action

URL /admin/product/{id}
Description Action to update a product information.
Method POST
Parameters +id: integer Id of the product to update
Request Body +productName: string Name of the product
+gameDescription: string Text with the description for the product
+genres: array Array of id of genres
+platforms: array Array of id of platforms
+categoryId: array Id of game category
?photo: file Photo that describes the game
Redirects R302 Success
Permissions ADM
Table 30: Product Update Action

R308: Product Remove Action

URL /admin/product/{id}
Description Action to remove a product.
Method DELETE
Parameters +id: integer Id of the product to remove
Redirects R302 Success
Returns 400 Bad Request Product could not remove product
Permissions ADM
Table 31: Product Remove Action

R309: Category Listing View

URL /admin/category
Description View with the list of the categories in the system.
Method GET
AJAX Calls R310 Called in the rendering of the page.
R311 Used while adding a new category.
R312 Called when a deletion is executed.
R313 Called when a update occurs.
Permissions ADM
Table 32: Category Listing View

R310: Category Listing Action

URL /api/admin/category
Description Request to return the information about categories.
Method GET
Parameters ?page: integer Results paging
Response Body JSON311
Permissions ADM
Table 33: Category Listing Action

R311: Category Add Action

URL /admin/category
Description Action to insert a new category.
Method PUT
Request Body +categoryName: string Name of the new category
Returns 200 OK The category submission was successful
400 Bad Request The category submission had an error
401 Unauthorized The insertion of the category was refused
Response Body JSON300
Permissions ADM
Table 34: Category Add Action

R312: Category Remove Action

URL /admin/category/{id}
Description Action to remove a category.
Method DELETE
Parameters +id: integer Id of the category to remove
Returns 200 OK The category deletion was successful
400 Bad Request The category deletion had an error
401 Unauthorized The deletion of the category was refused
404 Not Found Category not found
Permissions ADM
Table 35: Category Remove Action

R313: Category Update Action

URL /admin/category/{id}
Description Action to update a category.
Method POST
Parameters +id: integer Id of the category to update
Request Body +categoryName: string Name of the new category
Returns 200 OK The category update was successful
400 Bad Request The category update had an error
401 Unauthorized The update of the category was refused
404 Not Found Category not found
Permissions ADM
Table 36: Category Update Action

R314: Genre Listing View

URL /admin/genre
Description View with the list of the genres in the system.
Method GET
AJAX Calls R315 Called in the rendering of the page.
R316 Used while adding a new genre.
R317 Called when a deletion is executed.
R318 Called when a update is made.
Permissions ADM
Table 37: Genre Listing View

R315: Genre Listing Action

URL /api/admin/genre
Description Request to return the information about genres.
Method GET
Parameters ?page: integer Results paging
Response Body JSON315
Permissions ADM
Table 38: Genre Listing Action

R316: Genre Add Action

URL /admin/genre
Description Action to insert a new genre.
Method PUT
Request Body +genreName: string Name of the new genre
Returns 200 OK The genre submission was successful
400 Bad Request The genre submission had an error
401 Unauthorized The insertion of the genre was refused
Response Body JSON300
Permissions ADM
Table 39: Genre Add Action

R317: Genre Remove Action

URL /admin/genre/{id}
Description Action to remove a genre.
Method DELETE
Parameters +id: integer Id of the genre to remove
Returns 200 OK The genre deletion was successful
400 Bad Request The genre deletion had an error
401 Unauthorized The deletion of the genre was refused
404 Not Found Genre not found
Permissions ADM
Table 40: Genre Remove Action

R318: Genre Update Action

URL /admin/genre/{id}
Description Action to update a genre.
Method POST
Parameters +id: integer Id of the genre to update
Request Body +genreName: string Name of the new genre
Returns 200 OK The genre update was successful
400 Bad Request The genre update had an error
401 Unauthorized The update of the genre was refused
404 Not Found Genre not found
Permissions ADM
Table 41: Genre Update Action

R319: Platform Listing View

URL /admin/platform
Description View with the list of the platforms in the system.
Method GET
AJAX Calls R320 Called in the rendering of the page.
R321 Used while adding a new platform.
R322 Called when a deletion is executed.
R323 Called when a update is made.
Permissions ADM
Table 42: Platform Listing View

R320: Platform Listing Action

URL /api/admin/platform
Description Request to return the information about platforms.
Method GET
Parameters ?page: integer Results paging
Response Body JSON320
Permissions ADM
Table 43: Platform Listing Action

R321: Platform Add Action

URL /admin/platform
Description Action to insert a new platform.
Method PUT
Request Body +platformName: string Name of the new platform
Returns 200 OK The platform submission was successful
400 Bad Request The platform submission had an error
401 Unauthorized The insertion of the platform was refused
Response Body JSON300
Permissions ADM
Table 44: Platform Add Action

R322: Platform Remove Action

URL /admin/platform/{id}
Description Action to remove a platform.
Method DELETE
Parameters +id: integer Id of the platform to remove
Returns 200 OK The platform deletion was successful
400 Bad Request The platform deletion had an error
401 Unauthorized The deletion of the platform was refused
404 Not Found Platform not found
Permissions ADM
Table 45: Platform Remove Action

R323: Platform Update Action

URL /admin/platform/{id}
Description Action to update a platform.
Method POST
Parameters +id: integer Id of the platform to update
Request Body +platformName: string Name of the new platform
Returns 200 OK The platform update was successful
400 Bad Request The platform update had an error
401 Unauthorized The update of the platform was refused
404 Not Found Platform not found
Permissions ADM
Table 46: Platform Update Action

R324: User Listing View

URL /admin/user
Description View with the list of the users in the system.
Method GET
AJAX Calls R325 Called in the rendering of the page and when searching users.
R326 Called when a ban/unban is executed.
Permissions ADM
Table 47: User Listing View

R325: User Listing Action

URL /api/admin/user
Description Request to return the list of users.
Method GET
Parameters ?page: integer Results paging.
?query: string String to use as element of searching.
Response Body JSON325
Permissions ADM
Table 48: User Listing Action

R326: User Update Action

URL /admin/user/{id}
Description Action to ban/unban a user.
Method POST
Parameters +id: integer Id of the genre to update
Request Body +ban: boolean Whether it is to ban or unban.
Returns 200 OK The user update was successful
400 Bad Request The user update had an error
401 Unauthorized The update of the user was refused
404 Not Found User not found
Permissions ADM
Table 49: User Update Action

R327: Report Listing View

URL /admin/report
Description View with the list of the reports in the system.
Method GET
AJAX Calls R328 Called in the rendering of the page.
Permissions ADM
Table 50: Report Listing View

R328: Report Listing Action

URL /api/admin/report
Description Request to return the list of reports.
Method GET
Parameters ?page: integer Results paging.
Response Body JSON328
Permissions ADM
Table 51: Report Listing Action

R329: Transaction Listing View

URL /admin/transaction
Description View with the list of the transactions in the system.
Method GET
AJAX Calls R330 Called in the rendering of the page and when searching for transactions.
Permissions ADM
Table 52: Transaction Listing View

R330: Transaction Listing Action

URL /api/admin/transaction
Description Request to return the list of transactions.
Method GET
Parameters ?page: integer Results paging.
?query: string String to use as element of searching.
Response Body JSON330
Permissions ADM
Table 53: Transaction Listing Action

R331: Review Listing View

URL /admin/review
Description View with the list of the reviews in the system.
Method GET
AJAX Calls R332 Called in the rendering of the page and when searching for reviews.
R333 Called when deleting a review.
Permissions ADM
Table 54: Review Listing View

R332: Review Listing Action

URL /api/admin/review
Description Request to return the list of reviews.
Method GET
Parameters ?page: integer Results paging.
?query: string String to use as element of searching.
Response Body JSON332
Permissions ADM
Table 54: Review Listing Action

R333: Review Remove Action

URL /admin/review/{id}
Description Action to remove review.
Method DELETE
Parameters +id: integer Id of the review to remove
Returns 200 OK The review deletion was successful
400 Bad Request The review deletion had an error
401 Unauthorized The review of the category was refused
404 Not Found Review not found
Permissions ADM
Table 55: Review Remove Action

R334: FAQ Listing View

URL /admin/faq
Description View with the list of the FAQs in the system.
Method GET
AJAX Calls R335 Called in the rendering of the page.
R336 Called when adding a FAQ.
R337 Called when updating a FAQ.
R338 Called when deleting a FAQ.
Permissions ADM
Table 56: FAQ Listing View

R335: FAQ Listing Action

URL /api/admin/faq
Description Request to return the list of FAQs.
Method GET
Parameters ?page: integer Results paging.
Response Body JSON335
Permissions ADM
Table 57: FAQ Listing Action

R336: FAQ Add Action

URL /admin/faq
Description Action to insert a new FAQ.
Method PUT
Request Body +question: string New question
+answer: string New answer
Returns 200 OK The FAQ submission was successful
400 Bad Request The FAQ submission had an error
401 Unauthorized The FAQ of the platform was refused
Response Body JSON300
Permissions ADM
Table 58: FAQ Add Action

R337: FAQ Update Action

URL /admin/faq/{id}
Description Action to update a FAQ.
Method POST
Parameters +id: integer Id of the FAQ to update
Request Body +question: string Updated question
+answer: string Updated answer
Returns 200 OK The FAQ update was successful
400 Bad Request The FAQ update had an error
401 Unauthorized The update of the FAQ was refused
404 Not Found FAQ not found
Permissions ADM
Table 59: FAQ Update Action

R338: FAQ Remove Action

URL /admin/faq/{id}
Description Action to remove a FAQ.
Method DELETE
Parameters +id: integer Id of the FAQ to remove
Returns 200 OK The FAQ deletion was successful
400 Bad Request The FAQ deletion had an error
401 Unauthorized The deletion of the FAQ was refused
404 Not Found FAQ not found
Permissions ADM
Table 60: FAQ Remove Action

3.4 Module Product Search and Interaction:

Endpoints of module: Product Search and Interaction:
  • R401: Website Homepage[/ or /home]
  • R402: Products Listing [/search]
  • R403: Product Page [/product/{id}/{platform}]
  • R404: Listing Restriction [/search/filters]
  • R405: Offers Ordering [/product/{id}/{platform}/offers]

R401: Website Homepage

URL / or /home
Description Main page of the website, with the most popular and most recent products.
Method GET
UI UI01 (Homepage)
Permissions PUB
Table 61: Website Homepage

R402: Products Listing

URL /search
Description Page that will allow the user to navigate through and choose products.
Method GET
Parameters ?page: integer Current page searching
?filters: array Different types of search filters applied
UI UI06 (Product Searching)
AJAX Calls R404 When updating filters or switching pages.
Permissions PUB
Table 62: Products Listing

R403: Product Page

URL /product/{id}/{platform}
Description Page that will allow the user to see the product's information.
Method GET
Parameters +id: integer ID of the product
+platform: integer ID of the products platform
UI UI09 (Product Page)
AJAX Calls R405 When getting more offers for the product.
R502 Add an offer to the cart.
Permissions PUB
Table 63: Product Page

R404: Listing Restriction Action

URL api/product
Description Action that returns all products regarding the filters selected.
Method GET
Parameters ?query: integer String inserted in the search bar with the search query
?genres: array Genres
?platforms: array Platforms
?categories: array Categories
?maxPrice: float Maximum Price
?page: integer Page
?orderingParameter: string Order parameter to define the way the results of the search will be presented
Response Body JSON404
Permissions PUB
Table 64: Listing Restriction

R405: Offers Ordering Action

URL /api/product/{id}/{platform}/offers
Description Request to return a number of offers of the given product starting at a certain offer number.
Method GET
Parameters +id: integer The id of the product
+platform: integer The id of platform of the product
?orderingParameter: string Order parameter to define the way the results of the search will be presented
?numberOffers: integer Number of offers previously loaded
Response Body JSON405
Permissions PUB
Table 65: Offers Ordering Action

3.5 Module Cart and Checkout

  • R501: Cart View [cart]
  • R502: Cart Add [cart]
  • R503: Cart Remove [/cart/{id}]
  • R504: Checkout View [/cart/checkout]
  • R505: Checkout Action [/cart/checkout]

R501: Cart View

URL /cart
Description View for the personal shopping cart.
Method GET
UI UI03 (Cart)
AJAX Calls R503 When deleting an entry from the cart.
Permissions PUB
Table 66: Cart View

R502: Cart Add Action

URL /cart
Description Action to submit a new offer into the cart.
Method PUT
Request Body +offerId: integer Offer to insert into the personal cart.
Returns 200 OK The insertion of the item on the cart was successful.
400 Bad Request The insertion of the product was wrong.
401 Unauthorized The insertion of the product was refused.
Permissions PUB or ATVUSER
Table 67: Cart Add Action

R503: Cart Remove Action

URL /cart/{id}
Description Action to remove an offer from the cart.
Method DELETE
Parameters +id: integer ID of the cart entry we want to remove.
Returns 200 OK The deletion of the item on the cart was successful.
400 Bad Request The deletion of the product was wrong.
401 Unauthorized The deletion of the product was refused.
404 Not Found ID of the cart not found.
Permissions PUB or ATVUSER
Table 68: Cart Remove Action

R504: Checkout View

URL /cart/checkout
Description View the checkout form.
Method GET
AJAX Calls R503 Used if the current step in the checkout procedure is the "confirm your order step" and the user deletes a offer from the cart.
Submit R505
Permissions ATVUSER
Table 69: Checkout View

R505: Checkout Action

URL /cart/checkout
Description Action to buy the items in the cart.
Method PUT
Request Body +name: string Name to which the bill will be addressed.
+email: string Email address to which the bill will be addressed.
+address: string Address to which the bill will be addressed.
+zipcode: string Zipcode to which the bill will be addressed.
Redirects R202 Success
R504 Error
Permissions ATVUSER
Table 70: Checkout Action

3.6 Module Offer

Endpoints of module: Module Offer:
  • R601: New Offer View [/offer]
  • R602: Active Offer View [/offer/{id}]
  • R603: Offer Add Action [/offer]
  • R604: Offer Edit Action [/offer/{id}]
  • R605: Offer Cancel Action [/offer/{id}]
  • R606: Discount Listing Action [/api/offer/{id}/discount]
  • R607: Discount Add Action [/offer/{id}/discount]
  • R608: Discount Edit Action [/offer/{offerId}/discount/{discountId}]
  • R609: Discount Remove Action [/offer/{offerId}/discount/{discountId}]
  • R610: Key Listing Action [/api/offer/{id}/key]
  • R611: Key Add Action [/offer/{id}/key]
  • R612: Key Edit Action [/offer/{offerId}/key/{keyId}]
  • R613: Key Remove Action [/offer/{offerId}/key/{keyId}]

R601: New Offer View

URL /offer
Description View with create offer form.
Method GET
UI UI08 (Add/Edit Offer)
AJAX Calls R603 Used to add the new offer to the database.
Permissions ATVUSER
Table 71: New Offer View

R602: Active Offer View

URL /offer/{id}
Description View with edit offer form.
Method GET
Parameters +id: integer ID of the offer we want to edit.
UI UI08 (Add/Edit Offer)
AJAX Calls R604 Used to update the offer in the database.
R607 Used add a discount to the offer.
R608 Used edit a discount of the offer.
R609 Used delete a discount of the offer.
R611 Used add a key to the offer.
R612 Used edit a key associated with the offer.
R613 Used delete a key associated with the offer.
Permissions ATVUSER
Table 72: Active Offer View

R603: Offer Add Action

URL /offer
Description Action to submit a new offer.
Method PUT
Request Body +gameId: integer Id with the game that offer will be about.
+idPlatform: integer Id of platform for that game.
+keys: array Array of the keys the seller wants to publish.
+price: float Unitary price for those keys.
+paypal: string Id with the game that offer will be about.
?discounts: array Array with all discount dates and rates for that offer.
Returns 200 OK The insertion of the offer was successful.
400 Bad Request The offer insertion was invalid.
401 Unauthorized The offer insertion was refused.
Permissions ATVUSER
Table 73: Offer Add Action

R604: Offer Edit Action

URL /offer/{id}
Description Action to edit an offer.
Method POST
Parameters +id: integer ID of the offer we want to edit.
Request Body +price: float Unitary price for those keys.
+paypal: string Id with the game that offer will be about.
Returns 200 OK The update of the offer was successful.
400 Bad Request The offer update was invalid.
401 Unauthorized The offer update was refused.
404 Not Found Offer not found.
Permissions SELL
Table 74: Offer Edit Action

R605: Offer Cancel Action

URL /offer/{id}
Description Action to cancel an offer.
Method DELETE
Parameters +id: integer ID of the offer we want to edit.
Returns 200 OK The cancellation of the offer was successful.
400 Bad Request The offer cancellation was invalid.
401 Unauthorized The offer cancellation was refused.
404 Not Found Offer not found.
Permissions SELL
Table 75: Offer Cancel Action

R606: Discount Listing Action

URL /api/offer/{id}/discount
Description Returns discounts of the given offer.
Method GET
Parameters +id: integer ID of the offer the discounts belong to.
Response Body JSON606
Permissions SELL
Table 76: Discount Listing Action

R607: Discount Add Action

URL /offer/{id}/discount
Description Action to submit a new discount.
Method PUT
Parameters +id: integer ID of the offer the discount belongs to.
Request Body +rate: integer Rate with the discount rate of the offer.
+startDate: date Date for the discount to take effect.
+endDate: date Date for the discount to stop having effect on the offer.
Returns 200 OK The insertion of the discount was successful.
400 Bad Request The discount insertion was invalid.
401 Unauthorized The discount insertion was refused.
404 Not Found Offer not found.
Permissions SELL
Table 77: Discount Add Action

R608: Discount Edit Action

URL /offer/{offerId}/discount/{discountId}
Description Action to edit a discount.
Method POST
Parameters +offerId: integer ID of the offer the discount belongs to.
+discountId: integer ID of the discount we want to edit.
Request Body +rate: integer Rate with the discount rate of the offer.
+startDate: date Date for the discount to take effect.
+endDate: date Date for the discount to stop having effect on the offer.
Returns 200 OK The update of the discount was successful.
400 Bad Request The discount update was invalid.
401 Unauthorized The discount update was refused.
404 Not Found Offer or discount not found.
Permissions SELL
Table 78: Discount Edit Action

R609: Discount Remove Action

URL /offer/{offerId}/discount/{discountId}
Description Action to delete a discount.
Method DELETE
Parameters +offerId: integer ID of the offer the discount belongs to.
+discountId: integer ID of the discount we want to edit.
Returns 200 OK The deletion of the discount was successful.
400 Bad Request The discount deletion was invalid.
401 Unauthorized The discount deletion was refused.
404 Not Found Offer or discount not found.
Permissions SELL
Table 79: Discount Remove Action

R610: Key Listing Action

URL /api/offer/{id}/key
Description Returns keys of the given offer.
Method GET
Parameters +id: integer ID of the offer the keys belong to.
Response Body JSON610
Permissions SELL
Table 80: Key Listing Action

R611: Key Add Action

URL /offer/{id}/key
Description Action to submit a new key.
Method PUT
Parameters +id: integer ID of the offer the key belongs to.
Request Body +key: string The new key.
Returns 200 OK The insertion of the key was successful.
400 Bad Request The key insertion was invalid.
401 Unauthorized The key insertion was refused.
404 Not Found Offer not found.
Permissions SELL
Table 81: Key Add Action

R612: Key Edit Action

URL /offer/{offerId}/key/{keyId}
Description Action to edit a key.
Method POST
Parameters +offerId: integer ID of the offer the key belongs to.
+keyId: integer ID of the key we want to edit.
Request Body +key: integer The updated key.
Returns 200 OK The update of the key was successful.
400 Bad Request The key update was invalid.
401 Unauthorized The key update was refused.
404 Not Found Offer or key not found.
Permissions SELL
Table 82: Key Edit Action

R613: Key Remove Action

URL /offer/{offerId}/key/{keyId}
Description Action to delete a key.
Method DELETE
Parameters +offerId: integer ID of the offer the key belongs to.
+keyId: integer ID of the key we want to edit.
Returns 200 OK The deletion of the key was successful.
400 Bad Request The key deletion was invalid.
401 Unauthorized The key deletion was refused.
404 Not Found Offer or key not found.
Permissions SELL
Table 83: Key Remove Action

3.7 Module Social Interaction

Endpoints of module: Module Social Interaction:
  • R701: Feedback Listing Action [/user/{username}/feedback]
  • R702: Report View [/report/{id}]
  • R703: Report Message Add Action [/report/{id}]
  • R704: Report Add Action [/key/{id}/report]
  • R705: Feedback Add Action [/key/{id}/feedback]
  • R706: Admin Report View [/admin/report/{id}]
  • R707: Admin Report Message Add Action[/admin/report/{id}]

R701: Feedback Listing Action

URL /api/user/{username}/feedback
Description View with the feedback made to a certain user.
Method GET
Parameters +username: string Username of the user.
?evaluation: boolean Evaluation of the feedback given.
UI UI10 (User Page - Account - As own user)
UI10 (User Page - Account - From another user)
UI09 (Product Page)
Response Body JSON701
Permissions PUB
Table 84: Feedback Listing Action

R702: User Report View

URL /report/{id}
Description View a report that a user has made or that was made against him.
Method GET
Parameters +id: integer ID of the report.
UI UI14 (Report - Report Details)
AJAX Calls R703 Used to add a message to the report.
Permissions ATHUSER
Table 85: User Report View

R703: Report Message Add Action

URL /report/{id}
Description Action to submit a new message to a report.
Method PUT
Parameters +id: integer ID of the report.
Request Body +message: string The new message.
Returns 200 OK The insertion of the message was successful.
400 Bad Request The message insertion was invalid.
401 Unauthorized The message insertion was refused.
404 Not Found Report not found.
Permissions ATHUSER
Table 86: Report Message Add Action

R704: Report Add Action

URL /key/{id}/report
Description Action to submit a new report.
Method PUT
Parameters +id: integer ID of the key that we are reporting.
Request Body +title: string The title of the report.
+description: string The description of the report.
Returns 200 OK The insertion of the report was successful.
400 Bad Request The report insertion was invalid.
401 Unauthorized The report insertion was refused.
404 Not Found Key not found.
Permissions BUY
Table 87: Report Add Action

R705: Feedback Add Action

URL /key/{id}/feedback
Description Action to submit a new feedback.
Method PUT
Parameters +id: integer ID of the key that we are give feedback about.
Request Body +evaluation: boolean The evaluation of the feedback.
?comment: string The comment of the feedback.
Returns 200 OK The insertion of the feedback was successful.
400 Bad Request The feedback insertion was invalid.
401 Unauthorized The feedback insertion was refused.
404 Not Found Key not found.
Permissions BUY
Table 88: Feedback Add Action

R706: Admin Report View

URL /admin/report/{id}
Description View a report made by a buyer.
Method GET
Parameters +id: integer ID of the report.
UI UI27 (Admin Page - Reports Details)
AJAX Calls R707 Used to add a message to the report.
Permissions ADM
Table 89: Admin Report View

R707: Admin Report Message Add Action

URL /admin/report/{id}
Description Action to submit a new message to a report by an admin.
Method PUT
Parameters +id: integer ID of the report.
Request Body +message: string The new message.
Returns 200 OK The insertion of the message was successful.
400 Bad Request The message insertion was invalid.
401 Unauthorized The message insertion was refused.
404 Not Found Report not found.
Permissions ADM
Table 90: Admin Report Message Add Action

4. JSON/XML Types

JSON300: General Return ID: {id}[]

{
  "id": "23"
}

JSON303: Product Listing Action: {products}[]

{
  "products": [
    {
      "id": "1",
      "title": "GTA V",
      "platform": "1",
      "image": "O8GHTDJN12UMHN4B9813128B1231",
      "price": "25.99"
    },
    {
      "id": "2",
      "title": "Rocket League",
      "platform": "3",
      "image": "873Q20HFR8934IVY804UN5GN409",
      "price": "12.99"
    }
  ]
}

JSON311: Category Listing Action: {categories}[]

{
  "categories": [
    {
      "id": "1",
      "name": "Game"
    },
    {
      "id": "2",
      "name": "DLC"
    }
  ]
}

JSON315: Genre Listing Action: {genres}[]

{
  "genres": [
    {
      "id": "1",
      "name": "Game"
    },
    {
      "id": "2",
      "name": "DLC"
    }
  ]
}

JSON320: Platform Listing Action: {platforms}[]

{
  "platforms": [
    {
      "id": "1",
      "name": "Game"
    },
    {
      "id": "2",
      "name": "DLC"
    }
  ]
}

JSON325: User Listing Action: {users}[]

{
  "users": [
    {
      "id": "1",
      "userName": "lockdownPT",
       "image": "O8GHTDJN12UMHN4B9813128B1231"
    },
    {
      "id": "2",
      "userName": "Motapinto",
       "image": "O8GHTDJN12UMHN4B9813128B1231"
    }
  ]
}

JSON328: Report Listing Action: {reports}[]

{
  "report": [
    {
      "id": "1",
      "reporter": "lockdownPT",
       "report": "He is Fake",
       "status":"Closed"
    },
    {
      "id": "2",
      "reporter": "Motapinto",
       "report": "He is Fake",
       "status":"Open"
    }
  ]
}

JSON330: Transaction Listing Action: {transactions}[]

{
  "transaction": [
    {
      "id": "1",
      "seller": "lockdownPT",
       "buyer": "Motapinto",
       "totalPrice":"50"
    },
    {
      "id": "2",
      "seller": "Motapinto",
       "buyer": "LockdownPT",
       "totalPrice":"50"
    }
  ]
}

JSON332: Review Listing Action: {reviews}[]

{
  "review": [
    {
      "id": "1",
      "date": "2019/05/04",
       "author": "LockdownPT",
       "target":"Ruben Almeida"
    },
    {
      "id": "2",
      "date": "2019/05/04",
      "author": "Ruben Almeida",
      "target":"LockdownPT"
    }
  ]
}

JSON335: FAQ Listing Action: {faq}[]

{
  "faq": [
    {
      "id": "1",
      "question": "This is a question",
       "answer": "This is an answer",
       "target":"Ruben Almeida"
    },
    {
      "id": "2",
      "date": "2019/05/04",
      "author": "Ruben Almeida",
      "target":"LockdownPT"
    }
  ]
}

JSON404: Listing Restriction Action: {products}[]

{
  "products": [
    {
      "id": "1",
      "title": "GTA V",
      "platform": "1",
      "image": "O8GHTDJN12UMHN4B9813128B1231",
      "price": "25.99"
    },
    {
      "id": "2",
      "title": "Rocket League",
      "platform": "3",
      "image": "873Q20HFR8934IVY804UN5GN409",
      "price": "12.99"
    }
  ]
}

JSON405: Offers Ordering Action: {offers}[]

{
  "offers": [
    {
      "id": "1",
      "seller": "bestseller439",
      "feedback": "99",
      "numSells": "1897",
      "stock": "10",
      "price": "39.00"
    },
    {
      "id": "29",
      "seller": "okseller583",
      "feedback": "70",
      "numSells": "156",
      "stock": "2",
      "price": "37.59"
    }
  ]
}

JSON606: Discount Listing Action: {discounts}[]

{
  "discounts": [
    {
        "id":"1",
        "rate":"42",
        "start_date":"2020/01/15",
        "end_date":"2020/01/20"
    },
    {
        "id":"5",
        "rate":"50",
        "start_date":"2020/01/30",
        "end_date":"2020/02/3"
    }
  ]
}

JSON610: Key Listing Action: {keys}[]

{
  "keys": [
    {
        "id":"1",
        "key":"UYBHHAEWF87G238DENWSSF",
        "price_sold":"50.39"
    },
    {
        "id":"14",
        "key":"AIJWBFVBEU8FG023BFFHIU",
        "price_sold":"45.79"
    }
  ]
}

JSON701: Feedback Listing Action: {feedback}[]

{
  "feedback": [
    {
        "id":"1",
        "evaluation":"true",
        "comment":"He is great",
        "evaluation_date":"2020/01/20",
        "author":"okseller583"      
    },
    {
        "id":"2",
        "evaluation":"false",
        "comment":"He is not great",
        "evaluation_date":"2020/02/20",
        "author":"notokseller583"      
    }
  ]
}

Revision history

First submission: 16/04/2020

Changes done to first submission: 17/04/2020

  • Changed all POST methods to PUT and all PUT methods to POST.
  • Fixed table 207 layout
  • Inserted logout's resources
  • Change search to be indexable
  • Removed the user id from the cart module URLs
  • Login and register are no longer AJAX Calls

Changes done to second submission: 26/04/2020

  • Changed routes to remove unnecessary authorizations
  • Added discount related routes
  • Fixed missing links
  • Changed all tables to markdown based layout Changes done to third submission: 3/05/2020
  • Added the password recovery section
  • Added links to relations

GROUP2043, 26/04/2020

Clone this wiki locally