{"info":{"_postman_id":"b9c32101-ead8-4420-92da-6a6b6f3fbcb5","name":"API DOCUMENTATION SAMPLE","description":"<html><head></head><body><h1 id=\"sample-api-documentation\">Sample API Documentation</h1>\n<p>This collection contains sample requests.</p>\n<p>It contains the following requests:</p>\n<ul>\n<li>Register User</li>\n<li>View one or all Users</li>\n<li>Update User</li>\n<li>Delete User</li>\n<li>Create Question</li>\n<li>View one or all Question</li>\n<li>Update Question / Upvote or Downvote Questions</li>\n<li>Delete Question</li>\n<li>Create Answer</li>\n<li>View one or all Answers</li>\n<li>Update one or all Answers</li>\n<li>Delete Answer</li>\n<li>finally search for (user, answer and question).</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Sample API Documentation","slug":"sample-api-documentation"}],"owner":"6648981","collectionId":"b9c32101-ead8-4420-92da-6a6b6f3fbcb5","publishedId":"SWTD8wu2","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-02-02T11:16:00.000Z"},"item":[{"name":"http://localhost:3000/user/create","id":"c973856b-f060-426e-bb8c-2496d3a71368","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"firstname\" : \"Test\",\n    \"middlename\" : \"Testing\",\n    \"lastname\" : \"Testings\",\n    \"email\" : \"test@email.com\",\n    \"password\" : \"password\"\n}"},"url":"http://localhost:3000/user/create","description":"<p>Api endpoint to <strong>Register</strong> a User in the system:</p>\n<p>A successful registration <strong>(POST request)</strong> will result in an <strong>HTTP 201</strong> Status code. </p>\n<p>A bad request will result in an HTTP <strong>500 or 400</strong> Status code</p>\n","urlObject":{"protocol":"http","port":"3000","path":["user","create"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c973856b-f060-426e-bb8c-2496d3a71368"},{"name":"http://localhost:3000/user","id":"9064ac0c-6a60-4c53-82ec-720f0ff50b94","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/user","description":"<p>Api endpoint to <strong>view</strong> all the Usesr in the system:</p>\n<p>A successful <strong>Get request</strong> will result in an <strong>HTTP 200</strong> Status code. </p>\n<p>A bad request will result in an <strong>HTTP 500</strong> or *<em>400</em> Status code</p>\n","urlObject":{"protocol":"http","port":"3000","path":["user"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"9064ac0c-6a60-4c53-82ec-720f0ff50b94"},{"name":"http://localhost:3000/user/userId","id":"73428dff-f40c-4f07-8224-195519174fb2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/user/userId","description":"<p>Api endpoint to <strong>view</strong> one User in the system using the <strong>ID</strong> of the User:</p>\n<p>A successful <strong>Get request</strong> will result in an <strong>HTTP 200</strong> Status code. </p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code</p>\n","urlObject":{"protocol":"http","port":"3000","path":["user","userId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"73428dff-f40c-4f07-8224-195519174fb2"},{"name":"http://localhost:3000/user/update/userId","id":"93b23262-c886-4e6d-9021-57b4da2aa70c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"lastname\" : \"hello world\"\n}"},"url":"http://localhost:3000/user/update/userId","description":"<p>Api endpoint to <strong>Update</strong> one User in the system using the <strong>ID</strong> of the User:</p>\n<p>A successful <strong>PUT request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>Message:** “User Updated successfully”**</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["user","update","userId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"93b23262-c886-4e6d-9021-57b4da2aa70c"},{"name":"http://localhost:3000/user/delete/userId","id":"79ec99ca-1210-4f9c-b46b-93b063972369","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:3000/user/delete/userId","description":"<p>Api endpoint to <strong>Delete</strong> one User in the system using the <strong>ID</strong> of the User:</p>\n<p>A successful <strong>DELETE request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>Message:<strong>“User Deleted successfully”</strong></p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["user","delete","userId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"79ec99ca-1210-4f9c-b46b-93b063972369"},{"name":"http://localhost:3000/user/login","id":"b3db023d-8fd7-42a2-bc69-cb46e3167d03","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"test@email.com\",\n\t\"password\": \"password\"\n}"},"url":"http://localhost:3000/user/login","description":"<p>Api endpoint used by registered users to <strong>login and generate token</strong> </p>\n<p>A successful <strong>POST request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>Message:** “User loggedin successfully” **along with the generated <strong>Token<code> </code></strong>. the <strong>Token</strong> is also sent to the header with name <strong>auth-token</strong></p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["user","login"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"b3db023d-8fd7-42a2-bc69-cb46e3167d03"},{"name":"http://localhost:3000/user/logout","id":"6e8a4414-7d17-424a-832b-e34bf51d9e43","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"http://localhost:3000/user/logout","description":"<p>Api endpoint used by users to logout from the system\n<strong>Note:</strong> Just a placeholder but not fully implemented yet</p>\n","urlObject":{"protocol":"http","port":"3000","path":["user","logout"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"6e8a4414-7d17-424a-832b-e34bf51d9e43"},{"name":"http://localhost:3000/question/create","id":"1879c0fb-4dd3-4399-bd87-bd846215bf59","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZTM1YTZlY2IwNmUzYzI5NGU2MjQ4YmYiLCJpYXQiOjE1ODA1NzUxMDd9.dm910w6d0_ZWdLB2DDcMBarx5lVVSosiQnK4RmhXzaY","type":"text","description":"<p>You need to add this key auth-token and the token generated when you logged in to perform any post,put or delete operation or else the system will ask you to login</p>\n"}],"body":{"mode":"raw","raw":"{\n\t\"title\" : \"modified title\",\n    \"question\" : \"Define SUBSCRIBE (verb) and get synonyms. What is SUBSCRIBE (verb)? SUBSCRIBE (verb) meaning, pronunciation and more by Macmillan Dictionary.\"\n}"},"url":"http://localhost:3000/question/create","description":"<p>Api endpoint for <strong>Creating</strong> Question in the system</p>\n<p>**Note: **you need to add the <strong>auth-token</strong> key and <strong>token</strong> value to the header to perform this action</p>\n<p>A successful <strong>POST request</strong> will result in an <strong>HTTP 201</strong> Status code and a response </p>\n<p>Message: “Question Created successfully” with created question</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> or <strong>401</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["question","create"],"host":["localhost"],"query":[{"disabled":true,"key":"auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZTM1YTZlY2IwNmUzYzI5NGU2MjQ4YmYiLCJpYXQiOjE1ODA1NzUxMDd9.dm910w6d0_ZWdLB2DDcMBarx5lVVSosiQnK4RmhXzaY"}],"variable":[]}},"response":[],"_postman_id":"1879c0fb-4dd3-4399-bd87-bd846215bf59"},{"name":"http://localhost:3000/question/questionId","id":"919a4b11-d15e-48f4-ae44-b58e6a75cb6a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZTM1YTZlY2IwNmUzYzI5NGU2MjQ4YmYiLCJpYXQiOjE1ODA1NzUxMDd9.dm910w6d0_ZWdLB2DDcMBarx5lVVSosiQnK4RmhXzaY","description":"<p>You need to add this key auth-token and the token generated when you logged in to perform any post,put or delete operation or else the system will ask you to login</p>\n","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"title\":\"Test Title for update\"\n}"},"url":"http://localhost:3000/question/questionId","description":"<p>Api endpoint for <strong>Updating</strong> Question in the system</p>\n<p>**Note: **you need to add the <strong>auth-token</strong> key and <strong>token</strong> to the header to perform this action</p>\n<p>A successful <strong>PUT request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>Message: “Question Updated successfully” with Updated question</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> or <strong>401</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["question","questionId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"919a4b11-d15e-48f4-ae44-b58e6a75cb6a"},{"name":"http://localhost:3000/question/questionId","id":"e36cc062-0c3c-4cc3-9427-aa477d008bb7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZTM1YTZlY2IwNmUzYzI5NGU2MjQ4YmYiLCJpYXQiOjE1ODA1NzUxMDd9.dm910w6d0_ZWdLB2DDcMBarx5lVVSosiQnK4RmhXzaY","type":"text","description":"<p>You need to add this key auth-token and the token generated when you logged in to perform any post,put or delete operation or else the system will ask you to login</p>\n"}],"body":{"mode":"raw","raw":"{\n\t\"votequestion\":\"upvote\",\n\t\"subscribe\": true\n}"},"url":"http://localhost:3000/question/questionId","description":"<p>Api endpoint for <strong>Updating</strong> Question in the system using the question <strong>ID</strong></p>\n<p><strong>Note</strong>: Just to demonstrate upvote or downvote and also subscribe to email</p>\n<p>**Note: **you need to add the <strong>auth-token</strong> key and <strong>token</strong> to the header to perform this action</p>\n<p>A successful <strong>PUT request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>Message: “Question Updated successfully” with Updated question</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> or <strong>401</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["question","questionId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"e36cc062-0c3c-4cc3-9427-aa477d008bb7"},{"name":"http://localhost:3000/question/","id":"cf6fe20b-3c1c-469f-b6dc-27276e2c300c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/question/","description":"<p>Api endpoint to <strong>VIEW</strong> all the questions in the system:</p>\n<p>A successful <strong>GET request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["question",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"cf6fe20b-3c1c-469f-b6dc-27276e2c300c"},{"name":"http://localhost:3000/question/questionId","id":"129b74a2-3cf2-4148-8178-a98f51e04762","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/question/questionId","description":"<p>Api endpoint to <strong>VIEW</strong> one question in the system using the <strong>ID</strong> of the question:</p>\n<p>A successful <strong>GET request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["question","questionId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"129b74a2-3cf2-4148-8178-a98f51e04762"},{"name":"http://localhost:3000/question/questionId","id":"98904baa-9f44-4a8e-8433-38c65b1d1c08","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZTM1YTZlY2IwNmUzYzI5NGU2MjQ4YmYiLCJpYXQiOjE1ODA1NzUxMDd9.dm910w6d0_ZWdLB2DDcMBarx5lVVSosiQnK4RmhXzaY","type":"text","description":"<p>You need to add this key auth-token and the token generated when you logged in to perform any post,put or delete operation or else the system will ask you to login</p>\n"}],"url":"http://localhost:3000/question/delete/questionId","description":"<p>Api endpoint to <strong>Delete</strong> one question in the system using the <strong>ID of</strong> the question:</p>\n<p>A successful <strong>DELETE request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>Message:** “Question Deleted successfully”<code> </code>**</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["question","delete","questionId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"98904baa-9f44-4a8e-8433-38c65b1d1c08"},{"name":"http://localhost:3000/answer/questionId","id":"aecaba5e-8b2e-4f0d-9442-15d9b8879405","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZTM1YTZlY2IwNmUzYzI5NGU2MjQ4YmYiLCJpYXQiOjE1ODA1NzUxMDd9.dm910w6d0_ZWdLB2DDcMBarx5lVVSosiQnK4RmhXzaY","type":"text","description":"<p>You need to add this key auth-token and the token generated when you logged in to perform any post,put or delete operation or else the system will ask you to login</p>\n"}],"body":{"mode":"raw","raw":"{\n\t\"body\": \"Answered Question\"\n}"},"url":"http://localhost:3000/answer/questionId","description":"<p>Api endpoint for <strong>Answering</strong> a users Question in the system using the question <strong>ID</strong></p>\n<p>**Note: **you need to add the <strong>auth-token</strong> key and <strong>token</strong> to the header to perform this action</p>\n<p>A successful <strong>POST request</strong> will result in an <strong>HTTP 201</strong> Status code and a response </p>\n<p>Message: “Thank you for your answer” with the amswer payload</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> or <strong>401</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["answer","questionId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"aecaba5e-8b2e-4f0d-9442-15d9b8879405"},{"name":"http://localhost:3000/answer","id":"ff64d7da-4d2a-4740-ad7b-30e8e424970a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/answer","description":"<p>Api endpoint for <strong>GETTING</strong> all answers in the system.</p>\n<p>A successful <strong>GET request</strong> will result in an <strong>HTTP 200</strong> Status code and a response</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["answer"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"ff64d7da-4d2a-4740-ad7b-30e8e424970a"},{"name":"http://localhost:3000/answer/answerId","id":"be7371d4-c337-4ace-8295-7eac7d5336ee","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/answer/answerId","description":"<p>Api endpoint for <strong>Getting</strong> one answer in the system using the <strong>ID of</strong> the answer:</p>\n<p>A successful <strong>GET request</strong> will result in an <strong>HTTP 200</strong> Status code and a payload <code> </code></p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["answer","answerId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"be7371d4-c337-4ace-8295-7eac7d5336ee"},{"name":"http://localhost:3000/answer/update/answerId","id":"35ee11ba-f651-4347-aea1-2c089fb7a4e6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZTM1YTZlY2IwNmUzYzI5NGU2MjQ4YmYiLCJpYXQiOjE1ODA1NzUxMDd9.dm910w6d0_ZWdLB2DDcMBarx5lVVSosiQnK4RmhXzaY","type":"text","description":"<p>You need to add this key auth-token and the token generated when you logged in to perform any post,put or delete operation or else the system will ask you to login</p>\n"}],"body":{"mode":"raw","raw":"{\n\t\"body\":\"Testing\"\n}"},"url":"http://localhost:3000/answer/update/answerId","description":"<p>Api endpoint for <strong>Updating</strong> one answer in the system using the <strong>ID of</strong> the answer:</p>\n<p>A successful <strong>PUT request</strong> will result in an <strong>HTTP 200</strong> Status code and a response <code> </code></p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["answer","update","answerId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"35ee11ba-f651-4347-aea1-2c089fb7a4e6"},{"name":"http://localhost:3000/answer/answerId","id":"a7a36ff4-414c-45d5-951e-a8b123927582","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"description":"<p>You need to add this key auth-token and the token generated when you logged in to perform any post,put or delete operation or else the system will ask you to login</p>\n","key":"auth-token","type":"text","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZTM1YTZlY2IwNmUzYzI5NGU2MjQ4YmYiLCJpYXQiOjE1ODA1NzUxMDd9.dm910w6d0_ZWdLB2DDcMBarx5lVVSosiQnK4RmhXzaY"}],"body":{"mode":"raw","raw":""},"url":"http://localhost:3000/answer/delete/answerId","description":"<p>Api endpoint for <strong>Deleting</strong> an answer in the system using the answer <strong>ID</strong></p>\n<p>**Note: **you need to add the <strong>auth-token</strong> key and <strong>token</strong> to the header to perform this action</p>\n<p>A successful <strong>DELETE request</strong> will result in an <strong>HTTP 200</strong> Status code and a response </p>\n<p>Message: “Answer deleted successfully”</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> or <strong>401</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["answer","delete","answerId"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"a7a36ff4-414c-45d5-951e-a8b123927582"},{"name":"http://localhost:3000/search?type=user&search=test@email.com","id":"59cbd698-62d4-48c4-9d42-2e6196d535eb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/search?type=user&search=test@email.com","description":"<p>Api endpoint for <strong>Searching</strong> any of the Schemas</p>\n<p>Note: the type takes the name of the schema** user,question and answer** while search takes what you want to search. <strong>Eg . {type=user,search=name},</strong> this will search for name in user schema; </p>\n<p>A successful <strong>GET request</strong> will result in an <strong>HTTP 200</strong> Status code and a response</p>\n<p>A bad request will result in an <strong>HTTP 500 or 400</strong> or <strong>401</strong> Status code and the error message</p>\n","urlObject":{"protocol":"http","port":"3000","path":["search"],"host":["localhost"],"query":[{"key":"type","value":"user"},{"key":"search","value":"test@email.com"}],"variable":[]}},"response":[],"_postman_id":"59cbd698-62d4-48c4-9d42-2e6196d535eb"}],"event":[{"listen":"prerequest","script":{"id":"c171a978-57ef-4c9c-b697-5e28bea21a47","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"23545ce5-577b-4f1a-b67e-2759ed724c5e","type":"text/javascript","exec":[""]}}]}