Backend Routes - fjswayze/Shack GitHub Wiki
Backend Routes
HTML
GET /
StaticPagesController#root
API Endpoints
users
GET /api/users/:id
- returns info for the specified user.
- Info includes profile picture, display name, status (optional).
POST /api/users/
GET /api/channels/:id/users
- returns the users who belong to this channel
- Users are displayed with their name + profile picture
GET /api/direct_messages/:id/users
- returns the users who belong to this direct_message conversation
- Users are displayed with their name + profile picture
messages
GET /api/channels/:id/messages
- returns the messages for the specified channel
- messages are displayed with a timestamp and their sender's name + profile picture
POST /api/channels/:id/messages/
- creates a message in the channel
GET /api/direct_messages/:id/messages
- returns the messages for the specified conversation
- messages are displayed with a timestamp and their sender's name + profile picture
POST /api/direct_messages/:id/messages/
- create a message in a direct_message conversation
PATCH /api/messages/:id
DELETE /api/messages/:id
channels
GET /api/channels/
GET /api/channels/:id
GET /api/users/:id/channels/
- returns all of the specified user's channels
POST /api/channels/
DELETE /api/channels/:id
PATCH /api/channels/:id/
direct_messages
GET /api/direct_messages/
- return the users direct messages
GET /api/direct_messages/:id
- returns direct message conversation
POST /api/direct_messages/
- create a direct_message conversation
DELETE /api/direct_messages/
- deletes a direct_message conversation
memberships
POST /api/direct_messages/:id/memberships
- add a user to a direct message convo
Delete /api/direct_messages/:id/memberships
- remove a user to a direct message convo
POST /api/channels/:id/memberships
Delete /api/channels/:id/memberships
- remove a user from a channel