DPigeon / Edge

A web-base application kind of like a social media site to allow parents to communicate with teachers and vice-versa.
0 stars 1 forks source link

Implementation of basic Threads and Messages API logic #39

Closed AnasBuyumad closed 6 years ago

AnasBuyumad commented 6 years ago

Refers to Issues #33 and #38 The basic logic and concept of threads and messages is implemented. Below are the different endpoints.


All responses are either 200 OK (or 201 CREATED for POST requests) on success and 400 BAD REQUEST on error.


GET /threads -> Get all threads Response : Array of Thread Object


POST /threads -> Creates a thread Response : Thread Object with inserted id


GET /threads/id -> Gets a thread by id Response : Thread Object


PUT /threads/id -> Updates a thread Response : Success message


GET /threads/id/messages -> Gets the list of messages inside the thread Response : Array of Message Object


POST /messages -> Creates a message Response : Message Object with inserted id


GET /messages/id -> Gets a message by id Response : Message Object


PUT /messages/id -> Updates a message by id Response : Success message


DELETE /messages/id -> Deletes a message by id (not totally functional yet) Response : Success message


Details of the bodies and responses JSON format will be uploaded on the wiki at a later date.