Skip to content

Backend Routes

Dillon Rice edited this page May 1, 2020 · 13 revisions

Backend Routes

HTML

  • GET /StaticPagesController#root

API Endpoints

users

GET /api/users - return all users for users index

POST /api/users - sign up

session

POST /api/session - log in and return all conversations the user is subscribed to

DELETE /api/session - log out

messages

GET /api/conversations/:conversation_id/messages - returns messages, attachments, and reactions for a given channel/dm/gm

POST /api/messages - adds a message

PATCH /api/messages/:id - edits a message

DELETE /api/messages/:id - deletes a message

Conversations

GET /api/users/:user_id/conversations - get all conversations currently available to a specific user

GET /api/conversations/:id - get specific conversation details

POST /api/conversations - create new conversation

DELETE /api/conversations/:id - delete channel

PATCH /api/conversations/:id - edit channel (add new user, change topic, etc)

Memberships

POST /api/memberships - subscribe to a conversation

DELETE /api/memberships/:id - delete a subscription to a conversation

PATCH /api/memberships/:id - edit a subscription (for adding admin privileges)

Clone this wiki locally