Skip to content

API‐Routes

Chase Agee edited this page Feb 13, 2024 · 5 revisions

This web app uses the following API routes to dynamically update the page to create a single-page-app-like feel for the user for specific features.

Projects

Get all projects

Returns a list of all the projects

  • Request
    • Method: GET
    • URL: /api/projects
    • Body: None

!!!BONUS GOAL!!! Add Query Filters to Get All Projects

Return projects filtered by query parameters

  • Request
    • Method: GET
    • URL: /api/projects
    • Body: None
    • Query Params
      • page: integer, minimum: 1, maximum: 10, default: 1
      • size: integer, minimum: 1, maximum: 20, default: 10
      • title: string, optional
      • location: string, optional
      • endDate: string, optional

Get the details of one project

Returns the details of one project

  • Request
    • Method: GET
    • URL: /api/projects/int:projectId
    • Body: None

Create a new project

Creates and returns a new project

  • Requires: AUTHENTICATION
  • Request
    • Method: POST
    • URL: /api/projects
    • Body: True

Edit an existing project

Edits and returns an existing project

  • Requires: AUTHORIZATION
  • Request
    • Method: PUT
    • URL: /api/projects/int:projectId

Delete a project

Deletes an existing project

  • Requires: AUTHORIZATION
  • Request
    • Method: DELETE
    • URL: /api/projects/int:projectId

Categories

!!!KICKSTARTER doesn't have this!!! Get all of the categories

Returns a list of all of the categories

  • Request
    • Method: GET
    • URL: /api/categories

Get all projects belonging to specified category

Returns a list of all of the projects belonging to the category

  • Request
    • Method: GET
    • URL: /api/categories/str:categoryName

Rewards

Get all of a project's rewards

Returns a list of the project's rewards

  • Request
    • Method: GET
    • URL: /api/int:projectId/rewards

Create a new reward for a project

Create and return new reward for a project

  • Requires: AUTHORIZATION
  • Request
    • Method: POST
    • URL: /api/projects/int:projectId/rewards

Edit an existing reward

Edit and return an existing reward

  • Requires: AUTHORIZATION
  • Request
    • Method: PUT
    • URL: /api/projects/int:projectId/rewards

Delete a reward

Delete a reward

  • Requires: AUTHORIZATION
  • Request
    • Method: DELETE
    • URL: /api/projects/int:projectId/rewards

Backing Projects

Get all of project's backers

Returns a list of the project's backers

  • Request
    • Method: GET
    • URL: /api/projects/int:projectId/backers

!!!GET CONFIRMATION!!! Get list of project's reward level's backers

Returns a list of the project's reward level's backers

  • Request
    • Method: GET
    • URL: /api/projects/int:projectId/rewards/int:rewardId/backers

Add the current user as a backer

Add user as a backer of the project at rewardId level

  • Required: AUTHENTICATION
  • Request
    • Method: POST
    • URL: /api/projects/int:projectId/rewards/int:rewardId

!!!BONUS GOAL!!! Edit current user's backing level

User edits backing the project at rewardId level

  • Required: AUTHORIZATION
  • Request
    • Method: PUT
    • URL: /api/projects/int:projectId/rewards/int:rewardId

!!!BONUS GOAL!!! Delete the current user's backing

Delete the current user's backing of this project

  • Required: AUTHORIZATION
  • Request
    • Method: DELETE
    • URL: /api/projects/int:projectId/rewards/int:rewardId

!!!BONUS GOAL!!! Likes

Get all of users's liked projects

Returns a list of the user's likes

  • Required: AUTHORIZATION
  • Request
    • Method: GET
    • URL: /api/users/int:userId/likes

Add project to current user's likes

Like a project

  • Required: AUTHORIZATION
  • Request
    • Method: POST
    • URL: /api/projects/int:projectId/like

Delete current user's like from a project

Unlike a project

  • Required: AUTHORIZATION
  • Request
    • Method: DELETE
    • URL: /api/projects/int:projectId/like