{"info":{"_postman_id":"e20473ca-e120-4e1c-9557-708fb2df2bf6","name":"Ticket Booking Service API","description":"<html><head></head><body><p>The documentation below, demonstrates the use of the API on a local development server with port 5000.</p>\n<p>If you'd like to work on a different port, please modify the <code>.env</code> file.</p>\n<p>Additionally, this API is also hosted on a <a href=\"https://ticket-booking-service-api.herokuapp.com/\">Heroku Dyno</a>.</p>\n<p>The endpoints are available there as well. </p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"5400857","collectionId":"e20473ca-e120-4e1c-9557-708fb2df2bf6","publishedId":"T17CDA89","public":true,"customColor":{"top-bar":"000000","right-sidebar":"303030","highlight":"EB251F"},"publishDate":"2020-06-29T20:31:13.000Z"},"item":[{"name":"ticket/viewOpen","id":"8b3f3f66-b4b8-4392-9753-9869827b8f2a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/ticket/viewOpen","description":"<ul>\n<li>View all tickets with isBooked==false</li>\n<li>Returns a list of tickets if successful</li>\n</ul>\n","urlObject":{"protocol":"http","port":"5000","path":["api","ticket","viewOpen"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"c693a6f1-7588-4879-a176-cd4f45a3f78a","name":"http://localhost:5000/api/ticket/viewOpen","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/ticket/viewOpen"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"296"},{"key":"ETag","value":"W/\"128-LYr9OVcPjqZjuV87TX71bjSxInU\""},{"key":"Date","value":"Mon, 29 Jun 2020 21:01:06 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"isBooked\": false,\n        \"date\": \"2020-06-29T20:33:03.701Z\",\n        \"_id\": \"5efa5024a5dabe33821c17af\",\n        \"seatID\": 11,\n        \"passengerObj\": \"5efa5024a5dabe33821c17ae\",\n        \"__v\": 0\n    },\n    {\n        \"isBooked\": false,\n        \"date\": \"2020-06-29T20:33:03.701Z\",\n        \"_id\": \"5efa5241a5dabe33821c17b3\",\n        \"seatID\": 1,\n        \"passengerObj\": \"5efa5241a5dabe33821c17b2\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"8b3f3f66-b4b8-4392-9753-9869827b8f2a"},{"name":"ticket/viewClosed","id":"4c5dea4c-0e28-46cd-8f24-340801aeec7f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/ticket/viewClosed","description":"<ul>\n<li>View all tickets with isBooked==true</li>\n<li>Returns a list of tickets if successful</li>\n</ul>\n","urlObject":{"protocol":"http","port":"5000","path":["api","ticket","viewClosed"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"db417b20-1a4d-441a-9201-21124499a56b","name":"http://localhost:5000/api/ticket/viewClosed","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/ticket/viewClosed"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"442"},{"key":"ETag","value":"W/\"1ba-cSB0g4hU6/mgI8DEWqbrGzbo2L0\""},{"key":"Date","value":"Mon, 29 Jun 2020 21:02:16 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"isBooked\": true,\n        \"date\": \"2020-06-29T20:33:03.701Z\",\n        \"_id\": \"5efa5005a5dabe33821c17ad\",\n        \"seatID\": 15,\n        \"passengerObj\": \"5efa5005a5dabe33821c17ac\",\n        \"__v\": 0\n    },\n    {\n        \"isBooked\": true,\n        \"date\": \"2020-06-29T20:33:03.701Z\",\n        \"_id\": \"5efa51b6a5dabe33821c17b1\",\n        \"seatID\": 26,\n        \"passengerObj\": \"5efa51b6a5dabe33821c17b0\",\n        \"__v\": 0\n    },\n    {\n        \"isBooked\": true,\n        \"date\": \"2020-06-29T20:33:03.701Z\",\n        \"_id\": \"5efa5260a5dabe33821c17b5\",\n        \"seatID\": 39,\n        \"passengerObj\": \"5efa5260a5dabe33821c17b4\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"4c5dea4c-0e28-46cd-8f24-340801aeec7f"},{"name":"ticket/5efa5024a5dabe33821c17af","id":"d1df0c39-0a96-4c29-8bec-807dad9142b6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/ticket/5efa5024a5dabe33821c17af","description":"<ul>\n<li>View the status of a ticket with the specified ID</li>\n<li>returns a json with isBooked value of the ticket with status code 200</li>\n<li>Errors detected:</li>\n<li>ticketID is incorrect</li>\n</ul>\n","urlObject":{"protocol":"http","port":"5000","path":["api","ticket","5efa5024a5dabe33821c17af"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"27205e93-2b42-446f-9384-6f3230665aa4","name":"http://localhost:5000/api/ticket/5efa5024a5dabe33821c17af","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/ticket/5efa5024a5dabe33821c17af"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"18"},{"key":"ETag","value":"W/\"12-CWsEcnoLeKMyoNya2KCmGLzMGD0\""},{"key":"Date","value":"Mon, 29 Jun 2020 21:03:18 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"isBooked\": false\n}"}],"_postman_id":"d1df0c39-0a96-4c29-8bec-807dad9142b6"},{"name":"ticket/5efa51b6a5dabe33821c17b1","id":"3521840e-bb9e-425e-a7e4-e69ad6347785","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"isBooked\": true,\r\n    \"passenger\": {\r\n        \"name\": \"My Name Changed\",\r\n        \"age\": 25\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/ticket/5efa51b6a5dabe33821c17b1","description":"<ul>\n<li>Update/Edit the ticket status and/or the passenger details</li>\n<li>All attributes are optional</li>\n<li>returns the updated ticket data is successful, with status code 200</li>\n<li>Errors detected:</li>\n<li>Incorrect ticketID provided</li>\n</ul>\n","urlObject":{"protocol":"http","port":"5000","path":["api","ticket","5efa51b6a5dabe33821c17b1"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"6bac693d-fd85-4eaa-9c6a-a37d03f3d283","name":"http://localhost:5000/api/ticket/5efa51b6a5dabe33821c17b1","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"isBooked\": true,\r\n    \"passenger\": {\r\n        \"name\": \"My Name Changed\",\r\n        \"age\": 25\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/ticket/5efa51b6a5dabe33821c17b1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"43"},{"key":"ETag","value":"W/\"2b-CYWTmkR0L5nGD2ylzUN6McRkxZo\""},{"key":"Date","value":"Mon, 29 Jun 2020 21:07:13 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Successfully Updated Details!\"\n}"}],"_postman_id":"3521840e-bb9e-425e-a7e4-e69ad6347785"},{"name":"passenger/5efa5241a5dabe33821c17b3","id":"dc4dca15-1fcc-4c9c-8d33-f7819b08eaf9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/passenger/5efa5241a5dabe33821c17b3","urlObject":{"protocol":"http","port":"5000","path":["api","passenger","5efa5241a5dabe33821c17b3"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"2962b9e3-4c0e-46ee-b8f9-6241f8277c85","name":"http://localhost:5000/api/passenger/5efa5241a5dabe33821c17b3","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/passenger/5efa5241a5dabe33821c17b3"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"106"},{"key":"ETag","value":"W/\"6a-HEOn7kFSILdC5E7dlSRNmyFwqRU\""},{"key":"Date","value":"Mon, 29 Jun 2020 21:32:52 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"5efa5241a5dabe33821c17b2\",\n    \"name\": \"Jojo Berry\",\n    \"sex\": \"F\",\n    \"age\": 19,\n    \"email\": \"jojo@gmail.com\",\n    \"__v\": 0\n}"}],"_postman_id":"dc4dca15-1fcc-4c9c-8d33-f7819b08eaf9"},{"name":"admin/signup","id":"b965f212-d5a6-414e-88b8-b5e88b2fae8c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"admin@gmail.com\",\r\n    \"password\": \"mypassword\",\r\n    \"isAdmin\" : true\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/admin/signup","description":"<ul>\n<li>Sign up through this API with the email, password and by setting the isAdmin field</li>\n<li>From the response, receive JWT</li>\n<li>Hit reset api with <code>x-auth-token</code> header set to JWT received</li>\n</ul>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","signup"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"0281d015-738e-4466-bcd2-df39a23404b3","name":"http://localhost:5000/api/admin/signup","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"admin@gmail.com\",\r\n    \"password\": \"mypassword\",\r\n    \"isAdmin\" : true\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/admin/signup"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"212"},{"key":"ETag","value":"W/\"d4-n5WNaTIh1lvnKI5+Jnw0mfgsqX0\""},{"key":"Date","value":"Mon, 29 Jun 2020 21:45:50 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"SignUp Successful!\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZWZhNjEwZWI2Y2M1MDM1M2E2ODU3YzEiLCJpc0FkbWluIjp0cnVlLCJpYXQiOjE1OTM0NjcxNTB9.HxdUSI0mqPCH53yQOZdePGRgET2usI1NQPpBkbeKQVw\"\n}"}],"_postman_id":"b965f212-d5a6-414e-88b8-b5e88b2fae8c"},{"name":"admin/login","id":"d60142aa-08f9-42c9-9115-29f75af342b1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"admin@gmail.com\",\r\n    \"password\": \"mypassword\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/admin/login","description":"<ul>\n<li>Login through this API with the email, password</li>\n<li>From the response, receive JWT</li>\n<li>Hit reset api with <code>x-auth-token</code> header set to JWT received</li>\n<li>Errors detected:</li>\n<li>Invalid Email</li>\n<li>Incorrect Password</li>\n<li>Incorrect JWT</li>\n</ul>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"6e7bb357-7a8b-47d9-81b7-885c04167639","name":"http://localhost:5000/api/admin/login","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"admin@gmail.com\",\r\n    \"password\": \"mypassword\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/admin/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"x-auth-header","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZWZhNjEwZWI2Y2M1MDM1M2E2ODU3YzEiLCJpc0FkbWluIjp0cnVlLCJpYXQiOjE1OTM0NjcyOTJ9.7N1gRRFyylzTlQGqN0262rrpx1QNoWh7NSd5-3ZhjpU"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"31"},{"key":"ETag","value":"W/\"1f-MSd2aLtKlx1QcKcqnosUEkRXT7Y\""},{"key":"Date","value":"Mon, 29 Jun 2020 21:48:12 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Login Successful!\"\n}"}],"_postman_id":"d60142aa-08f9-42c9-9115-29f75af342b1"},{"name":"admin/reset","id":"355dc7f8-97aa-4586-9990-23ea8c684f23","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"x-auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZWZhNjEwZWI2Y2M1MDM1M2E2ODU3YzEiLCJpc0FkbWluIjp0cnVlLCJpYXQiOjE1OTM0NjcxNTB9.HxdUSI0mqPCH53yQOZdePGRgET2usI1NQPpBkbeKQVw","type":"text"}],"url":"http://localhost:5000/api/admin/reset","description":"<ul>\n<li>Admin only API</li>\n<li>Get token from sign-up/log-in and paste in <code>x-auth-token</code> header</li>\n<li>Middleware authenticates and proceeds with request</li>\n<li>Status 200 if successful</li>\n</ul>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","reset"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"a44c4d62-e782-44fb-ad91-5a64b444d903","name":"http://localhost:5000/api/admin/reset","originalRequest":{"method":"POST","header":[{"key":"x-auth-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZWZhNjEwZWI2Y2M1MDM1M2E2ODU3YzEiLCJpc0FkbWluIjp0cnVlLCJpYXQiOjE1OTM0NjcxNTB9.HxdUSI0mqPCH53yQOZdePGRgET2usI1NQPpBkbeKQVw","type":"text"}],"url":"http://localhost:5000/api/admin/reset"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"43"},{"key":"ETag","value":"W/\"2b-TjC/RgCoI/6wGcapToyxeiflPoE\""},{"key":"Date","value":"Mon, 29 Jun 2020 21:51:57 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Successfully Reset all seats!\"\n}"}],"_postman_id":"355dc7f8-97aa-4586-9990-23ea8c684f23"}],"event":[{"listen":"prerequest","script":{"id":"655fdc6d-c2c9-4ab3-9db4-45d6da2b282d","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"61b4b293-29d2-4bfc-b5b9-752f43d93771","type":"text/javascript","exec":[""]}}]}