Skip to content

API Documentation

Daniel Upchurch edited this page Feb 26, 2021 · 3 revisions

The Community Table API is organized around REST. Our API has predictable resource oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.

API routes are not user-facing and should only be used by developers.

Backend Routes

  • /api/auth
  • /api/resources

/api/auth

Routes associates with user authentication.

  • GET /: Check if a user is authenticated
  • POST /login: Attempts to log in a user
  • GET /logout: Logs out a user

/api/resources

Routes for querying and accessing all resource data, all of which return the data as JSON.

  • GET /: Returns a list of all resources.
  • GET /:id: Returns a specific resource.
  • DELETE/:id: Delete the specified resource and return a response if deleted correctly or the error otherwise.
  • GET /categories/:id: Returns a list of all resources of a specified resource category.
  • POST /create_resource: Posts a new resource to the resource database and returns the resource if successful or the error if unsuccessful.