{"info":{"_postman_id":"73ffc760-3823-4f15-a1ca-86f62a6b7c7e","name":"Flyright API Docs","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"27853841","collectionId":"73ffc760-3823-4f15-a1ca-86f62a6b7c7e","publishedId":"2sA3XJmkR8","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-06-07T20:07:25.000Z"},"item":[{"name":"Auth service","item":[{"name":"sign in","event":[{"listen":"test","script":{"id":"7823d280-820d-459a-b291-44bbb47bac8b","exec":["// Parse the response JSON","let res = pm.response.json();","","// Extract the token from the response","const token = res.data;","","// Set the token as an environment variable","pm.collectionVariables.set(\"accessToken\", token);"],"type":"text/javascript"}}],"id":"8207d67c-7664-4f47-aba1-d1f5bb8c2e6d","request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"email","value":"sutharkeshav950@gmail.com","type":"text"},{"key":"password","value":"sutharkeshav950@gmail.com","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/api/v1/user/signin","description":"<p>Gets information about the authenticated user.</p>\n","urlObject":{"path":["user","signin"],"host":["https://flights.keshavcarpenter.tech/api/v1"],"query":[],"variable":[]}},"response":[{"id":"dfb3355a-f380-4f16-a23d-ed4b946e222d","name":"User not found","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"email","value":"usernotfound950@gmail.com","type":"text"},{"key":"password","value":"1234","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/api/v1/user/signin"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":{"content":"","type":"text/plain"}}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"message\": \"Something went wrong\",\n    \"data\": {},\n    \"error\": {\n        \"statusCode\": 404,\n        \"explanation\": \"User not found!\"\n    }\n}"}],"_postman_id":"8207d67c-7664-4f47-aba1-d1f5bb8c2e6d"},{"name":"admin-sign-in","event":[{"listen":"test","script":{"id":"7823d280-820d-459a-b291-44bbb47bac8b","exec":["// Parse the response JSON","let res = pm.response.json();","","// Extract the token from the response","const token = res.data;","","// Set the token as an environment variable","pm.collectionVariables.set(\"accessToken\", token);"],"type":"text/javascript"}}],"id":"1883a175-e834-4b3b-a30c-0b06c73c4f3c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"email","value":"admin4@mail.com","type":"text"},{"key":"password","value":"admin@mail.com","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/api/v1/user/signin","description":"<p>Gets information about the authenticated user.</p>\n","urlObject":{"path":["user","signin"],"host":["https://flights.keshavcarpenter.tech/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"1883a175-e834-4b3b-a30c-0b06c73c4f3c"},{"name":"sign up","id":"8d8cfe95-30cc-4ea9-b7f8-9cd5c1483abf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"email","value":"admin4@mail.com","type":"text"},{"key":"password","value":"admin@mail.com","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/api/v1/user/signup","urlObject":{"path":["user","signup"],"host":["https://flights.keshavcarpenter.tech/api/v1"],"query":[],"variable":[]}},"response":[{"id":"a6de570b-5d2c-4fe5-9eae-d68998b4290f","name":"Successful signup response","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"email","value":"youthoobpre951@gmail.com","type":"text"},{"key":"password","value":"1234","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/api/v1/user/signup"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Successfully completed the request\",\n    \"data\": {\n        \"id\": 1,\n        \"email\": \"youthoobpre950@gmail.com\",\n        \"password\": \"$2b$05$IC.2wm3ILutG8mW8GpB.Ye1XKReRZ24f6y2IvYGVI0OIQ92Ww8Fei\",\n        \"updatedAt\": \"2024-06-07T11:51:17.934Z\",\n        \"createdAt\": \"2024-06-07T11:51:17.934Z\"\n    },\n    \"error\": {}\n}"},{"id":"6a384668-d9c4-4d1d-9f51-9fa44bc02e4e","name":"invalidsign up request : password empty","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"email","value":"invalidrequestuser@gmail.com","type":"text"},{"key":"password","value":"","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/api/v1/user/signup"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"message\": \"Something went wrong while authenticating\",\n    \"data\": {},\n    \"error\": {},\n    \"explanation\": \"Password not found in the request body\"\n}"}],"_postman_id":"8d8cfe95-30cc-4ea9-b7f8-9cd5c1483abf"},{"name":"API_GATEWAY health check","id":"37f932c1-73fd-48df-a240-801f62d0b8b7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://flights.keshavcarpenter.tech/api/v1/info","urlObject":{"path":["info"],"host":["https://flights.keshavcarpenter.tech/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"37f932c1-73fd-48df-a240-801f62d0b8b7"}],"id":"214f0e01-7bbf-49fa-8e84-eda56063b506","description":"<h1 id=\"you-just-need-to-sign-in-and-postman-scripts-will-take-care-of-populating-access-token-to-all-requests\">You just need to sign in and postman scripts will take care of populating access-token to all requests.</h1>\n","_postman_id":"214f0e01-7bbf-49fa-8e84-eda56063b506"},{"name":"Flight-service","item":[{"name":"airplanes","item":[{"name":"get-all-plane","id":"87fedf84-f8a5-4368-9ae3-d5689aff392b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/airplanes/get-all-airplanes","urlObject":{"path":["airplanes","get-all-airplanes"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"87fedf84-f8a5-4368-9ae3-d5689aff392b"},{"name":"create airplane","id":"62ed707d-6fb3-4bee-bc2e-3a5911688811","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwiZW1haWwiOiJhZG1pbkBtYWlsLmNvbSIsImlhdCI6MTcxNzc4MTAwNSwiZXhwIjoxNzE4Mzg1ODA1fQ.69ZcfyD9j6-uHdq9ABpxsgybHU8lw-YB61b00E21HBo","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"modelNumber\": \"boeing 777-300er\",\n    \"capacity\": 512\n}","options":{"raw":{"language":"json"}}},"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/airplanes/add-airplane","urlObject":{"path":["airplanes","add-airplane"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"62ed707d-6fb3-4bee-bc2e-3a5911688811"},{"name":"update airplane","id":"4541eca3-c595-4c32-9ef7-e17e4651550d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"modelNumber\" : \"Boing777\",\n    \"capacity\" : 234\n}","options":{"raw":{"language":"json"}}},"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/airplanes/update-airplane/3","urlObject":{"path":["airplanes","update-airplane","3"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"4541eca3-c595-4c32-9ef7-e17e4651550d"},{"name":"delete-airplane","id":"e86b3565-aec9-4628-bce8-7f5256e38e2e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/airplanes/delete-airplane/3","urlObject":{"path":["airplanes","delete-airplane","3"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"e86b3565-aec9-4628-bce8-7f5256e38e2e"}],"id":"7a112ab3-366b-46dc-8507-a14d705f0656","_postman_id":"7a112ab3-366b-46dc-8507-a14d705f0656","description":""},{"name":"airport","item":[{"name":"get-all-airport","id":"cb111824-d36d-4ec4-83bc-5f8a0c3e9945","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/airports/get-all-airports","urlObject":{"path":["airports","get-all-airports"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"cb111824-d36d-4ec4-83bc-5f8a0c3e9945"},{"name":"create airport","id":"243ef60d-d126-4b6c-ae08-d28e4b107ab2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"modelNumber\": \"boeing 777-300er\",\n    \"capacity\": 450\n}","options":{"raw":{"language":"json"}}},"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/airplanes/add-airplane","urlObject":{"path":["airplanes","add-airplane"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"243ef60d-d126-4b6c-ae08-d28e4b107ab2"},{"name":"update airport","id":"dd3bd406-b524-4e12-9c15-1fd939fac1b4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"modelNumber\" : \"Boing777\",\n    \"capacity\" : 234\n}","options":{"raw":{"language":"json"}}},"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/airports/update-airpord/","urlObject":{"path":["airports","update-airpord",""],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"dd3bd406-b524-4e12-9c15-1fd939fac1b4"},{"name":"delete-airport","id":"5b3780d0-39b0-42e5-85ee-7780b483dd42","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/airplanes/delete-airplane/3","urlObject":{"path":["airplanes","delete-airplane","3"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"5b3780d0-39b0-42e5-85ee-7780b483dd42"}],"id":"4bf9f57e-27b6-4a0f-a727-2334e34dad89","_postman_id":"4bf9f57e-27b6-4a0f-a727-2334e34dad89","description":""},{"name":"flights","item":[{"name":"get-all-flights","id":"ad25cd4c-501c-4fa7-87e9-b42ffc124149","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/flights/get-all-flights","urlObject":{"path":["flights","get-all-flights"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"ad25cd4c-501c-4fa7-87e9-b42ffc124149"},{"name":"get-flights-by-id","id":"3de6985c-b8d0-4f83-bff4-f44893588067","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/flights/get-flight/25","urlObject":{"path":["flights","get-flight","25"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"3de6985c-b8d0-4f83-bff4-f44893588067"},{"name":"create-flight","id":"e0ba3e16-421b-4df7-8357-6b4aea60c87a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n      \"flightNumber\": \"6E 5267\",\n      \"airplaneId\": 1,\n      \"departureAirportId\": \"BOM\",\n      \"arrivalAirportId\": \"JAI\",\n      \"arrivalTime\": \"2024-06-15 22:00:00.000 +0530\",\n      \"departureTime\": \"2024-06-15 20:00:00.000 +0530\",\n      \"price\": 5000,\n      \"boardingGate\": \"G2\",\n      \"totalSeats\": 180\n}","options":{"raw":{"language":"json"}}},"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/flights/create-flight","urlObject":{"path":["flights","create-flight"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"e0ba3e16-421b-4df7-8357-6b4aea60c87a"},{"name":"update-seats","id":"dbf56544-e6ad-4d72-be3b-5bf32299639c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"seats","value":"2","type":"text"},{"key":"dec","value":"false","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/flights/update-flight/21/seats","urlObject":{"path":["flights","update-flight","21","seats"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"dbf56544-e6ad-4d72-be3b-5bf32299639c"}],"id":"ba485a9e-ff08-43cf-8967-276966020e56","_postman_id":"ba485a9e-ff08-43cf-8967-276966020e56","description":""},{"name":"flight-service-health-check-info","id":"23d89a7d-6588-4a33-a9d2-f5625e859824","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://flights.keshavcarpenter.tech/flightService/api/v1/info","urlObject":{"path":["info"],"host":["https://flights.keshavcarpenter.tech/flightService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"23d89a7d-6588-4a33-a9d2-f5625e859824"}],"id":"1edeceec-fb97-4473-8783-d5a77ba6568a","description":"<h1 id=\"most-of-the-apis-write-apis-of-this-folder-requires-admin-previllages-so-first-go-to-auth-folder-sign-in-as-admin-then-come-back-and-try-out-these\">Most of the APIs (write APIs) of this folder requires admin previllages. So first go to Auth folder, sign in as admin. Then come back and try out these.</h1>\n","_postman_id":"1edeceec-fb97-4473-8783-d5a77ba6568a"},{"name":"Booking-service","item":[{"name":"booking-health-check","id":"de8ddbfa-9d3d-470c-b5e0-ae4429cb0611","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://flights.keshavcarpenter.tech/bookingService/api/v1/info","urlObject":{"path":["info"],"host":["https://flights.keshavcarpenter.tech/bookingService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"de8ddbfa-9d3d-470c-b5e0-ae4429cb0611"},{"name":"get-all-booking-by-userid","id":"28b24ebf-56e7-43f6-a8ec-a319223324c2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://flights.keshavcarpenter.tech/bookingService/api/v1/booking/get-all-bookings/12","urlObject":{"path":["booking","get-all-bookings","12"],"host":["https://flights.keshavcarpenter.tech/bookingService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"28b24ebf-56e7-43f6-a8ec-a319223324c2"},{"name":"payment","event":[{"listen":"prerequest","script":{"id":"0f64a9b8-9f6d-47f6-95e1-65d5d1fbf89f","exec":["pm.request.headers.add({","    key: 'idempotent-key',","    value: generateIdempotentKey(10)","});","","function generateIdempotentKey(length) {","  const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","  const charactersLength = characters.length;","  let idempotentKey = '';","","  for (let i = 0; i < length; i++) {","    idempotentKey += characters.charAt(Math.floor(Math.random() * charactersLength));","  }","","  return idempotentKey;","}",""],"type":"text/javascript"}}],"id":"759221cf-b56b-45b5-8f70-f29c3f4d3b61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"bookingId","value":"","type":"text"},{"key":"totalCost","value":"","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/bookingService/api/v1/booking/payment","urlObject":{"path":["booking","payment"],"host":["https://flights.keshavcarpenter.tech/bookingService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"759221cf-b56b-45b5-8f70-f29c3f4d3b61"},{"name":"cancel booking","id":"ec3c1fc9-8997-4ca2-9578-0306fb4400e2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://flights.keshavcarpenter.tech/bookingService/api/v1/booking/cancel/","urlObject":{"path":["booking","cancel",""],"host":["https://flights.keshavcarpenter.tech/bookingService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"ec3c1fc9-8997-4ca2-9578-0306fb4400e2"},{"name":"create-booking","event":[{"listen":"test","script":{"id":"100edc54-c91a-4760-b1c0-75435037b62a","exec":["// Parse the response JSON","let bookingres = pm.response.json();","","// Extract the id from the response data","const bookingId = bookingres.data.id;","const totalCost = bookingres.data.totalCost;","","// Set the id as a collection variable","pm.collectionVariables.set(\"booking-id\", bookingId);","pm.collectionVariables.set(\"total-cost\", totalCost);","",""],"type":"text/javascript"}}],"id":"2ebf777d-719c-42de-849b-e7b1313329cf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"flightId","value":"25","type":"text"},{"key":"noOfSeats","value":"1","type":"text"}]},"url":"https://flights.keshavcarpenter.tech/bookingService/api/v1/booking/create-booking","urlObject":{"path":["booking","create-booking"],"host":["https://flights.keshavcarpenter.tech/bookingService/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"2ebf777d-719c-42de-849b-e7b1313329cf"}],"id":"67da35d9-f1ce-4328-a6ec-882c7085205e","_postman_id":"67da35d9-f1ce-4328-a6ec-882c7085205e","description":""}],"event":[{"listen":"prerequest","script":{"id":"e152f671-e019-43ea-a650-09805c97e7fe","type":"text/javascript","exec":["// Get the access token from the environment variable","const token = pm.collectionVariables.get(\"accessToken\");","","// Add the token as a header to the request","pm.request.headers.add({","    key: 'x-access-token',","    value: token","});",""]}},{"listen":"test","script":{"id":"b5a5f8e6-ebce-4971-bfb0-911436b69bc7","type":"text/javascript","exec":[""]}}],"variable":[{"key":"baseUrl","value":"https://flights.keshavcarpenter.tech/api/v1"},{"key":"flightservice_base_url","value":"https://flights.keshavcarpenter.tech/flightService/api/v1","type":"string"},{"key":"bookingservice_base_url","value":"https://flights.keshavcarpenter.tech/bookingService/api/v1","type":"string"},{"key":"accessToken","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTIsImVtYWlsIjoic3V0aGFya2VzaGF2OTUwQGdtYWlsLmNvbSIsImlhdCI6MTcxNzc4OTI3MCwiZXhwIjoxNzE4Mzk0MDcwfQ.kKTlh2C8wfCvQ_hPLC1tvqkFkrlMW4CPNpAYmi8THy0"},{"key":"booking-id","value":""},{"key":"total-cost","value":""},{"key":"admin-accessToken","value":""}]}