Skip to content

API Documentation

Moiz Ahmad edited this page Jul 27, 2021 · 9 revisions

Creating

POST /users/signup

Submit the user registration form to create a new user

POST /users/login

Submit the user login form to log in and create a session

POST /questions/:id/answers

Submit an answer to a specific question which will dynamically be added to the answers list

POST /questions/:id/comments

Submit an comment to a specific question which will dynamically be added to the comments list

POST answers/:id/comments

Submit an comment to a specific answer which will dynamically be added to the comments list

Reading (DO NOT IMPLEMENT YET)

GET /questions/:id/answers

Returns a json of all answers associated with that question

GET /questions/:id/comments

Returns a json of all comments associated with that question

GET /answers/:id/comments

Returns a json of all comments associated with that answer

Updating

PUT /questions/:id

Used to dynamically alter any of the question's attributes (question, details, votes, etc) with a JSON request

PUT /answers/:id

Used to dynamically alter any of the answer's attributes (answer, votes, etc) with a JSON request

PUT /comments/:id

Used to dynamically alter any of the comment's attributes (comment, votes, etc) with a JSON request

Deleting

DELETE /questions/:id

Used to delete and dynamically remove a question

DELETE /answers/:id

Used to delete and dynamically remove an answer from a question

DELETE /comments/:id

Used to delete and dynamically remove a comment from a question or answer

Clone this wiki locally