Skip to content

Backend Routes

saphknight edited this page Mar 27, 2019 · 4 revisions

Backend Routes

HTML

  • GET / StaticPagesController#root

Api Endpoints

users

  • GET /api/users - returns all users
  • GET /api/users/:userId - returns the user's information and their messages, workspaces, and channels
  • POST /api/users - sign up

session

  • POST /api/session - login
  • DELETE /api/session - logout

workspaces

  • GET /api/workspaces/ - returns all the workspaces
  • GET /api/workspaces/:workspaceId - returns a specific workspace, with channel and user info
  • POST /api/workspaces/ - create a workspace
  • PATCH /api/worspaces/:workspaceId - updates a specific workspace

channels

  • GET /api/workspaces/:workspaceId/channels - returns all the channels in a given workspace
  • GET /api/workspaces/:workspaceId/channels/:channelId - get a specific channel with user info and messages info
  • POST /api/workspaces/:workspaceId/channels - create a new channel in a given workspace
  • DELETE /api/workspaces/:workspaceId/channels/:channelId - delete a specific channel
  • PATCH /api/workspaces/:workspaceId/channels/:channelId - edit a channel

messages

  • GET /api/channels/:channelId/messages - returns all messages for the specific channel
  • POST /api/channels/:channelId/messages - creates a message in a specific channel
  • PATCH /api/channels/:channelId/messages/:messageId - edit a message
  • DELETE /apit/channels/:channelId/messages/:messageId - deletes a message (check userId)
Clone this wiki locally