{"info":{"_postman_id":"a1dfcadb-c6c0-4818-8a09-69999622cb66","name":"Natours","description":"<html><head></head><body><p>This API contains endpoints for Tours, Users, Reviews and Bookings for a fictional tours company called Natours. Please note that {{ URL }} is just an environment variable, to use the actual API simply replace it with <a href=\"https://natours-nachiketa.herokuapp.com/\">https://natours-nachiketa.herokuapp.com/</a>.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"13036021","collectionId":"a1dfcadb-c6c0-4818-8a09-69999622cb66","publishedId":"TWDfEZ3P","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-03-03T07:14:58.000Z"},"item":[{"name":"Tours","item":[{"name":"Get all tours","id":"5b30216f-91fb-4e91-81f3-14c178b6017d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/tours","description":"<p>Use this endpoint to get all the tours stored in the database. All tours include their reviews and guides by default.</p>\n<p>Query Features:</p>\n<h2 id=\"1-filtering\">1) FILTERING</h2>\n<p>You can query for any tour property. These are the available operators: gte, ft, lte, lt.</p>\n<p>For example: <code>api/v1/tours/?difficulty=easy&amp;duration[gte]=5</code></p>\n<p>This will return all the tours with a difficulty of easy and duration greater than or equal to 5.</p>\n<h2 id=\"2-sorting\">2) SORTING</h2>\n<p>Use 'sort' and add a comma between the properties you want to sort by. Everything is sorted in ascending order by default. Add a minus sign to sort in descending order.</p>\n<p>For example: <code>api/v1/tours/?sort=-price,ratingsAverage</code></p>\n<p>This will return all tours sorted by the largest price, and if there's a tie it'll display the tours with a lower ratingsAverage first.</p>\n<h2 id=\"3-limit-fields\">3) LIMIT FIELDS</h2>\n<p>You can also choose the tour properties you want to get back (or exclude) by using the 'fields' parameter.</p>\n<p>For example:</p>\n<ol>\n<li><p><code>api/v1/tours/?fields=-startLocation</code>,-ratingsAverage would return all tours without their start location and ratingsAverage.</p>\n</li>\n<li><p><code>api/v1/tours/?fields=name</code> would only return the tour names.</p>\n</li>\n</ol>\n<h2 id=\"4-paginate\">4) PAGINATE</h2>\n<p>This API allows you to organize the results you get from the queries into pages. To do so, just specify the 'page' and 'limit' parameters. Note how you can use 'limit' to set how many results you want to get back.</p>\n<ol>\n<li><p><code>api/v1/tours/?page=1&amp;limit=3</code> would return the first 3 tours.</p>\n</li>\n<li><p><code>api/v1/tours/?page=2&amp;limit=4</code> would only return tours 5-8.</p>\n</li>\n</ol>\n<p>REMEMBER THAT YOU CAN COMBINE ALL THESE FILTERS</p>\n<h3 id=\"all-of-these-features-allow-you-to-perform-really-specific-queries\">All of these features allow you to perform really specific queries.</h3>\n<p>This one, for example, returns the first two tours whose difficulty is easy and the price is less than or equal to 1500 sorted by the smaller price.</p>\n<p><code>api/v1/tours/?difficulty=easy&amp;price[lte]=1500&amp;sort=price&amp;page=1&amp;limit=2</code></p>\n","urlObject":{"path":["v1","tours"],"host":["{{URL}}api"],"query":[{"disabled":true,"key":"difficulty","value":"easy"},{"disabled":true,"key":"sort","value":"-price,-ratingsAverage"},{"disabled":true,"key":"fields","value":"name,duration,difficulty,price"},{"disabled":true,"key":"sort","value":"-ratingsAverage"},{"disabled":true,"key":"page","value":"1"},{"disabled":true,"key":"limit","value":"3"},{"disabled":true,"key":"name","value":"New Test Tour"},{"disabled":true,"key":"name","value":"The Snow Adventurer"},{"disabled":true,"key":"price[lt]","value":"1000"},{"disabled":true,"key":"ratingsAverage[gte]","value":"4.7"},{"disabled":true,"description":{"content":"<p>Query for tour duration. Supports gte, lte, gt, lt operators</p>\n","type":"text/plain"},"key":"duration[gte]","value":"7"}],"variable":[]}},"response":[],"_postman_id":"5b30216f-91fb-4e91-81f3-14c178b6017d"},{"name":"Get tour","id":"9f345482-74be-44ac-bbe5-a4ebac85b0bb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}api/v1/tours/5ffd4710732be83aec3bce14","description":"<p>Simply add the tour id to the GET all tours route to get information about a single tour.</p>\n","urlObject":{"path":["v1","tours","5ffd4710732be83aec3bce14"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"9f345482-74be-44ac-bbe5-a4ebac85b0bb"},{"name":"Top 5 tours","id":"77f5a31c-a71b-43cf-8ac2-917046a83906","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}v1/tours/top-5-cheap","description":"<p>This end point has been designed to get the 'top 5' tours that has been pre customized using 'Aggregation Pipeline'.</p>\n","urlObject":{"path":["tours","top-5-cheap"],"host":["{{URL}}v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"77f5a31c-a71b-43cf-8ac2-917046a83906"},{"name":"Tour stats","id":"0ab5f812-9e1f-406e-9dac-8e92d0eea495","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}api/v1/tours/tour-stats","description":"<p>Get tour stats based on their difficulty, like the average rating of all easy tours so you can compare them with the hard and medium ones.</p>\n<p>These are all the properties that you can see stats of:</p>\n<ol>\n<li>numTours</li>\n<li>numRatings</li>\n<li>avgRating</li>\n<li>avgPrice</li>\n<li>minPrice</li>\n<li>maxPrice</li>\n</ol>\n","urlObject":{"path":["v1","tours","tour-stats"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"0ab5f812-9e1f-406e-9dac-8e92d0eea495"},{"name":"Get monthly plan","id":"332fb8b0-5851-479b-a63b-4bdf64dfa6b3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/tours/monthly-plan/2021","description":"<p>Get all the tours starting in a given year. You will also see in which month of that year they start, nicely organized.</p>\n<p>Only admins, guides and lead-guides have access to this route.</p>\n","urlObject":{"path":["v1","tours","monthly-plan","2021"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"332fb8b0-5851-479b-a63b-4bdf64dfa6b3"},{"name":"Get Tours Within radius","id":"1082152d-d25c-4f49-811e-4d5f79c7c407","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}api/v1/tours/tours-within/236/center/34.092088759669174,-118.19766545708312/unit/mi","description":"<p>Get tours whose <code>startLocation</code> is within a provided radius.</p>\n<p>Given the following route: <code>(/tours-within/:distance/center/:latlng/unit/:unit)</code></p>\n<ol>\n<li><p>Replace <code>:distance</code> with the distance that you want to cover, this will be the radius of your search.</p>\n</li>\n<li><p>Provide the latitude and longitude of your starting point in <code>:latlng</code>, separated by commas.</p>\n</li>\n<li><p>Finally, specify your unit in <code>:unit</code>. The default is km, but you can also say 'mi' for miles. This is the unit of the distance you specified in step 1.</p>\n</li>\n</ol>\n","urlObject":{"path":["v1","tours","tours-within","236","center","34.092088759669174,-118.19766545708312","unit","mi"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"1082152d-d25c-4f49-811e-4d5f79c7c407"},{"name":"Get Distances to Tours from Point","id":"23e5c304-a9d5-4a65-aa0d-a121eedf3c63","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}api/v1/tours/distances/34.092088759669174,-118.19766545708312/unit/km","description":"<p>Get tours in order of nearest to farthest from a specified point. You will also get the distance between them and that specified point.</p>\n<p>Given the following route: <code>(/distances/:latlng/unit/:unit)</code></p>\n<ol>\n<li><p>Replace <code>:distances</code> with the latitude and longitude of the point where you want to start your search.</p>\n</li>\n<li><p>Specify the unit in which you want to get your results in <code>:unit</code>, it can be either 'mi' or 'km', which is the default.</p>\n</li>\n</ol>\n","urlObject":{"path":["v1","tours","distances","34.092088759669174,-118.19766545708312","unit","km"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"23e5c304-a9d5-4a65-aa0d-a121eedf3c63"},{"name":"Create new tour","id":"165dd20b-68e2-4d9d-9bdb-d9bbb58dfbdf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"New Test Tour\",\r\n    \"duration\": 1,\r\n    \"maxGroupSize\": 1,\r\n    \"difficulty\": \"easy\",\r\n    \"price\": 200,\r\n    \"summary\": \"Test tour\",\r\n    \"imageCover\": \"tour-3-cover.jpg\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/tours","description":"<p>Create a new tour, these are the required fields that you must send in the body of the request:</p>\n<ol>\n<li><code>name</code>: A string with a length of 10-40 characters.</li>\n<li><code>duration</code>: A number (the number of days the tour lasts).</li>\n<li><code>maxGroupSize</code>: The maximum number of people that the tour can have.</li>\n<li><code>difficulty</code>: A string that can be either 'easy', 'medium' or 'difficult'.</li>\n<li><code>price</code>: The price (in USD).</li>\n<li><code>summary</code>: A short description of the tour.</li>\n<li><code>imageCover</code>: The main image of the tour, saved as the name of the file.</li>\n<li><code>startLocation</code>: An object with many properties describing the location where the tour starts. The coordinates are mandatory.</li>\n<li><code>locations</code>: An array of objects describing all the locations that you will visit during the tour. The coordinates are mandatory.\nNote: The coordinates array in both startLocation and locations must be expressed like this: [longitude, latidude]. When specifying latitude and longitude coordinates, the first field, regardless of the field name, must contain the longitude value and the second field, the latitude value.</li>\n</ol>\n","urlObject":{"path":["v1","tours"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"165dd20b-68e2-4d9d-9bdb-d9bbb58dfbdf"},{"name":"Update tour","id":"87693944-febf-479a-8eb3-4deb2d4919a7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"formdata","formdata":[{"key":"imageCover","type":"file","src":"/N:/Programming/Node js/natours/code/dev-data/img/new-tour-1.jpg"},{"key":"images","type":"file","src":"/N:/Programming/Node js/natours/code/dev-data/img/new-tour-2.jpg"},{"key":"images","type":"file","src":"/N:/Programming/Node js/natours/code/dev-data/img/new-tour-3.jpg"},{"key":"images","type":"file","src":"/N:/Programming/Node js/natours/code/dev-data/img/new-tour-4.jpg"},{"key":"price","value":"997","type":"text"}]},"url":"{{URL}}api/v1/tours/60043fea1923ad28a88eee0d","description":"<p>Add the id of the tour you want to update and pass the new data in the body (select 'raw' and 'JSON' in Postman).</p>\n<p>Note that if you want to update images and imageCover, you need to use form-data instead of raw in the body, please see this example. By the way, we only accept JPG, JPEG and GIF images (these are converted to JPEG).</p>\n<p>Also, only users whose roles are admin or lead-guide can update tours.</p>\n","urlObject":{"path":["v1","tours","60043fea1923ad28a88eee0d"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"87693944-febf-479a-8eb3-4deb2d4919a7"},{"name":"Delete tour","id":"3c3900b0-0f0d-4e3a-9318-871da6742505","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"DELETE","header":[],"url":"{{URL}}api/v1/tours/5c88fa8cf4afda39709c295a","description":"<p>Add the id of the tour that you wish to delete. Expect a 204 No Content status code back and no data.</p>\n<p>Note: Only users whose roles are admin or lead-guide can delete tours.</p>\n","urlObject":{"path":["v1","tours","5c88fa8cf4afda39709c295a"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"3c3900b0-0f0d-4e3a-9318-871da6742505"}],"id":"078022a7-d2e1-4f73-b588-764cdacf91f1","description":"<p>This folder contains routes that will allow you to get all tours, get a specific one, delete a tour, create your own (if your user role is admin or lead-guide), update a tour, get its stats and even geospatial data like getting a tour within a specified radius and the distances of all tours from a specific point.</p>\n<h3 id=\"have-fun-playing-around-with-our-tours\">Have fun playing around with our tours!</h3>\n","event":[{"listen":"prerequest","script":{"id":"e77182dc-f589-48db-b06c-7e6144cb0d2e","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"79f3400e-9c53-4e12-a525-88cd3247f42b","type":"text/javascript","exec":[""]}}],"_postman_id":"078022a7-d2e1-4f73-b588-764cdacf91f1"},{"name":"Authentication","item":[{"name":"signup","event":[{"listen":"test","script":{"id":"f32de2aa-026e-4bc5-8bfc-311199f4a566","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"30bee739-6935-4878-bf2c-2fc520ba14d8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Test Nachi\",\r\n    \"email\": \"bnachiketa26@gmail.com\",\r\n    \"password\": \"test1234\",\r\n    \"passwordConfirm\": \"test1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/signup","description":"<p>Sign up providing your name, email, and password. You can set your profile picture later.</p>\n<p>The email must be unique (never used to create an account before). Also, you'll receive a welcome email.</p>\n","urlObject":{"path":["v1","users","signup"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"30bee739-6935-4878-bf2c-2fc520ba14d8"},{"name":"Forgot Password","id":"f29e3417-3bc9-4992-ad5c-c6d8e5d54924","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"test@test.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/forgotpassword/","description":"<p>Send your email in the body of this request as 'raw' and 'JSON'. You'll immediately get an email with a link to reset your password, and it will expire in 10 minutes, so please be quick.</p>\n<p>In order for this one to work, the Postman environment must be set to Prod: Natours.</p>\n","urlObject":{"path":["v1","users","forgotpassword",""],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"f29e3417-3bc9-4992-ad5c-c6d8e5d54924"},{"name":"Login","event":[{"listen":"test","script":{"id":"918b1ede-ffc5-4bcc-a250-84b1babcd82c","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"e276ece8-586b-40cf-85aa-b1831b3043e9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"admin@natours.io\",\r\n    \"password\": \"{{password}}\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/login","description":"<p>Login using your email and password. Your session will last 5 days, after that you'll have to login again.</p>\n","urlObject":{"path":["v1","users","login"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"e276ece8-586b-40cf-85aa-b1831b3043e9"},{"name":"Reset Password","event":[{"listen":"test","script":{"id":"b1f5da25-9f7f-4ae1-a22b-c58c4b9847b0","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"3de8902f-d35c-4b45-9e48-4bcc90e50311","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"password\": \"test1234\",\r\n    \"passwordConfirm\": \"test1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/resetpassword/5fc43d9ec33983bce81dc26cdcf74d18578688819a7e490e117c7d41b59b3171","description":"<p>This is the link that was sent to your email (logically, it's different every time you request to reset your password).</p>\n<p>Submit password and passwordConfirm in the body of the request to reset your password and you'll be logged in automatically.</p>\n<p>If 10 minutes have passed since you requested to reset your password, this link won't work anymore and you'll have to request a new one.</p>\n","urlObject":{"path":["v1","users","resetpassword","5fc43d9ec33983bce81dc26cdcf74d18578688819a7e490e117c7d41b59b3171"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"3de8902f-d35c-4b45-9e48-4bcc90e50311"},{"name":"Update Password of Loggedin user","event":[{"listen":"test","script":{"id":"6619dbfa-2b50-42f4-a284-37c234ff7d59","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"a2598a52-f913-4645-9002-790e7a33ec54","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"passwordCurrent\": \"12345679\",\r\n    \"password\": \"12345678\",\r\n    \"passwordConfirm\": \"12345678\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/updatepassword","description":"<p>Update your password when you still remember it. In order to use this route, you must be logged in.</p>\n<p>Send the following data in the body:</p>\n<ol>\n<li><code>passwordCurrent</code>: Your current password, the one you just used to log in.</li>\n<li><code>password</code>: Your new password.</li>\n<li><code>passwordConfirm</code>: Confirm your new password.</li>\n</ol>\n","urlObject":{"path":["v1","users","updatepassword"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"a2598a52-f913-4645-9002-790e7a33ec54"}],"id":"c264ddd5-fd16-4199-a8a2-7ac3884a1c15","description":"<p>Here you'll find routes that will allow you to sign up, login, and manage your password.</p>\n","event":[{"listen":"prerequest","script":{"id":"6f4d1b02-c94a-4752-954f-ff3f2b0ee084","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"ffe96976-c32e-4e2e-bdf8-77b3fa6cff31","type":"text/javascript","exec":[""]}}],"_postman_id":"c264ddd5-fd16-4199-a8a2-7ac3884a1c15"},{"name":"Users","item":[{"name":"Get all users","id":"8c1cc6fd-97a5-4323-8fd0-b4c01afeb466","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/users","description":"<p>Use this endpoint to get all the users stored in the database. Only admins can get all users.</p>\n<h2 id=\"query-features\">Query Features:</h2>\n<h2 id=\"1-filtering\">1) FILTERING</h2>\n<p>You can query for any user property. These are the available operators: gte, ft, lte, lt.</p>\n<p>For example: <code>api/v1/users/?role=guide</code></p>\n<p>This will return all the users whose role is 'guide'.</p>\n<h2 id=\"2-sorting\">2) SORTING</h2>\n<p>Use 'sort' and add a comma between the properties you want to sort by. Everything is sorted in ascending order by default. Add a minus sign to sort in descending order.</p>\n<p>For example: <code>api/v1/users/?sort=name</code></p>\n<p>This will return all users sorted alphabetically by name (from A to Z, to go from Z to A use <code>api/v1/users/?sort=-name</code>).</p>\n<h2 id=\"3-limit-fields\">3) LIMIT FIELDS</h2>\n<p>You can also choose the user properties you want to get back (or exclude) by using the 'fields' parameter.</p>\n<p>For example:\n<code>api/v1/users/?fields=email</code> would return all users but only displaying their emails.</p>\n<h2 id=\"4-paginate\">4) PAGINATE</h2>\n<p>Organize the users into pages. Just specify the 'page' and 'limit' parameters to suit your taste.</p>\n<p>Note how you can use 'limit' to set how many results you want to get back. Suppose that we have 25 users in total.</p>\n<ol>\n<li><code>api/v1/users/?page=3&amp;limit=5</code> would return users 11-15.</li>\n<li><code>api/v1/users/?page=2&amp;limit=10</code> would return users 11-20.</li>\n</ol>\n<h3 id=\"remember-that-you-can-combine-all-these-filters\">REMEMBER THAT YOU CAN COMBINE ALL THESE FILTERS</h3>\n<p>Here's an example combining sorting and pagination. This query returns page 2 with a limit of 2 users alphabetically sorted by their name, so you can expect names starting with 'a' and 'b'.</p>\n<p><code>api/v1/users/?sort=name&amp;page=2&amp;limit=2</code></p>\n","urlObject":{"path":["v1","users"],"host":["{{URL}}api"],"query":[{"disabled":true,"key":"role","value":"admin"}],"variable":[]}},"response":[],"_postman_id":"8c1cc6fd-97a5-4323-8fd0-b4c01afeb466"},{"name":"Get user","id":"a3c97ff1-424f-48ff-900d-8d02f4b88060","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/users/7","description":"<p>Get a user passing his id as a parameter. Only admins can perform this action.</p>\n","urlObject":{"path":["v1","users","7"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"a3c97ff1-424f-48ff-900d-8d02f4b88060"},{"name":"Get Current LoggedIn User","id":"c4733c89-694d-4e12-ba61-71df29ff839a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/users/me","description":"<p>This end point has been designed to 'get' the details of a 'Logged in' account.</p>\n","urlObject":{"path":["v1","users","me"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"c4733c89-694d-4e12-ba61-71df29ff839a"},{"name":"Inactive Users","id":"1ff046ef-0d5d-4f40-8816-0208a3af55d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/users/inactiveusers","description":"<p>This end point has been designed to 'get' the details about all the 'inactive' users in the Database(Restricted to 'admin' only).</p>\n","urlObject":{"path":["v1","users","inactiveusers"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"1ff046ef-0d5d-4f40-8816-0208a3af55d6"},{"name":"Update User","id":"9342fc5a-6f11-4185-87ef-1caf74e0b1c5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Nachiketa\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/5ff6906ee323053a88ad7dd1","description":"<p>Admins are also able to edit every user passing in their id. Regular users can't use this route, not even if they pass in their own id (to update your own user data, please use <code>/updateMe</code>.</p>\n","urlObject":{"path":["v1","users","5ff6906ee323053a88ad7dd1"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"9342fc5a-6f11-4185-87ef-1caf74e0b1c5"},{"name":"Update Current User Data","id":"1f6b934c-f358-4a83-936a-c667ac620643","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"Leo J. Gillespie","type":"text","disabled":true},{"key":"photo","type":"file","src":"/N:/Programming/Node js/natours/code/dev-data/img/leo.jpg"}]},"url":"{{URL}}api/v1/users/updateme/","description":"<p>Get your own user data. Obviously, you must be logged in to use this route.</p>\n","urlObject":{"path":["v1","users","updateme",""],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"1f6b934c-f358-4a83-936a-c667ac620643"},{"name":"Delete Account of Loggedin user","id":"318f36e1-4bdd-4796-99cf-dedb9e99597b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"DELETE","header":[],"url":"{{URL}}api/v1/users/deleteme","description":"<p>Delete your account. Expect a 204 No Content status code and no data back. You must be logged in to use this route.</p>\n<p>You will no longer be able to log in with the email address of your deleted account. Also, you won't be able to register with that email again.</p>\n","urlObject":{"path":["v1","users","deleteme"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"318f36e1-4bdd-4796-99cf-dedb9e99597b"},{"name":"Delete User(Admins only)","id":"0438ccfa-737d-4334-9a17-fc2fd0b62d34","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"DELETE","header":[],"url":"{{URL}}api/v1/users/5ffc23caf18c000cb8c154d9","description":"<p>Passing in the user id, admins are able to delete users. Expect a 204 No Content status code and no data back.</p>\n","urlObject":{"path":["v1","users","5ffc23caf18c000cb8c154d9"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"0438ccfa-737d-4334-9a17-fc2fd0b62d34"}],"id":"a90e02dd-5194-4430-a57f-fbc7e806c28b","description":"<p>Users need to sign up in order to purchase tours. This folder will allow you to manage all operations related to users</p>\n","event":[{"listen":"prerequest","script":{"id":"8053bfd1-6b09-43f3-be17-09f4e239b4cf","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"55e2da84-8af5-454d-8162-2c82c07edb7f","type":"text/javascript","exec":[""]}}],"_postman_id":"a90e02dd-5194-4430-a57f-fbc7e806c28b"},{"name":"Reviews","item":[{"name":"Get All Reviews","id":"61350cc9-96cc-42bb-a0b8-c81df8c57564","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/reviews","description":"<p>Use this endpoint to get all the reviews stored in the database. All reviews include their author by default, you can exclude it like this: api/v1/reviews/?fields=-user.</p>\n<p>Query Features:</p>\n<h2 id=\"1-filtering\">1) FILTERING</h2>\n<p>You can query for any user property. These are the available operators: gte, ft, lte, lt.</p>\n<p>For example: <code>api/v1/reviews/?rating[lt]=4</code></p>\n<p>This will return all the reviews with a rating under 4.</p>\n<h2 id=\"2-sorting\">2) SORTING</h2>\n<p>Use 'sort' and add a comma between the properties you want to sort by. Everything is sorted in ascending order by default. Add a minus sign to sort in descending order.</p>\n<p>For example: <code>api/v1/reviews/?sort=-rating</code></p>\n<p>This will return all reviews sorted by the largest rating (from 5 to 1). Remove the minus to sort from 1 to 5.</p>\n<h2 id=\"3-limit-fields\">3) LIMIT FIELDS</h2>\n<p>You can also choose the review properties you want to get back by using the 'fields' parameter. Use a minus ('-') to exclude a property and get all the others.</p>\n<p>For example:</p>\n<ol>\n<li><code>api/v1/reviews/?fields=-user</code>,-rating would return all review data without the user and rating.</li>\n</ol>\n<p>2.<code> api/v1/reviews/?fields=rating</code> would only return the rating.</p>\n<h2 id=\"4-paginate\">4) PAGINATE</h2>\n<p>Organize the reviews into pages. Just specify the 'page' and 'limit' parameters to suit your taste.</p>\n<p>Note how you can use 'limit' to set how many results you want to get back. Suppose that we have 60 reviews in total.</p>\n<ol>\n<li><code>api/v1/reviews/?page=4&amp;limit=10</code> would return reviews 41-50.</li>\n<li><code>api/v1/reviews/?page=3&amp;limit=3</code> would return reviews 7-9.</li>\n</ol>\n<h3 id=\"remember-that-you-can-combine-all-these-filters\">REMEMBER THAT YOU CAN COMBINE ALL THESE FILTERS</h3>\n<p>Here's an example combining filtering, sorting, and pagination. This query will return page 1 with 30 results of the reviews with a rating equal to or greater than 4 sorted in ascending order.</p>\n<p><code>api/v1/reviews/?rating[gte]=4&amp;sort=rating&amp;page=1&amp;limit=30</code></p>\n","urlObject":{"path":["v1","reviews"],"host":["{{URL}}api"],"query":[{"disabled":true,"key":"rating","value":"5"}],"variable":[]}},"response":[],"_postman_id":"61350cc9-96cc-42bb-a0b8-c81df8c57564"},{"name":"Get Review","id":"5eceabb0-58c8-41d6-9eb7-3afb0a8a9859","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/reviews/5ffd4710732be83aec3bce14","description":"<p>Get a specific review passing in its id.</p>\n","urlObject":{"path":["v1","reviews","5ffd4710732be83aec3bce14"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"5eceabb0-58c8-41d6-9eb7-3afb0a8a9859"},{"name":"Create Review","id":"20791ba8-e2b7-4e7c-ac28-75b224040574","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"review\": \"Must Go!\",\r\n    \"rating\": 4.9,\r\n    \"user\": \"5ff9bf9f10add325b43e4903\",\r\n    \"tour\": \"5ff9925e6a548219385b2139\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/reviews/","description":"<p>Only users with the <code>user</code> role can post reviews. It'd be weird if those with the role of <code>guide</code>, <code>lead-guide</code> and <code>admin</code> could post reviews, right?</p>\n<p>Also, you can only review tours that you have booked (refer to the Bookings section) and you can't write reviews on behalf of other users. You can only write one review on the same tour.</p>\n<p>To create a new review using this route, send the following data in the body as raw (JSON):</p>\n<ol>\n<li><code>review</code>: Your review (as a String).</li>\n<li><code>rating</code>: Your rating. We only accept numbers from 1-5.</li>\n<li><code>tour</code>: The id of the tour you're writing the review of.</li>\n<li><code>user</code>: Your own user id. Get it from <code>api/v1/users/me</code>.</li>\n</ol>\n","urlObject":{"path":["v1","reviews",""],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"20791ba8-e2b7-4e7c-ac28-75b224040574"},{"name":"Update Review","id":"c476b261-8c4e-47bc-93f7-693cc6eaa545","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"rating\": 5,\r\n    \"review\": \"Sorry I canged my mind!\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/reviews/5ffd4afcec7d17252c9aa7ab","description":"<p>Pass in the id of the review that you want to update and send the updated fields in the body.</p>\n<p>You can't modify other user's reviews, so passing the id of a review that you didn't write and trying to update it will result in an error.</p>\n<p>Admins can edit anyone's review. Lead-guides and guides cannot edit any review.</p>\n","urlObject":{"path":["v1","reviews","5ffd4afcec7d17252c9aa7ab"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"c476b261-8c4e-47bc-93f7-693cc6eaa545"},{"name":"Delete Review","id":"2cac2586-cb43-4ba1-bf72-e17dc790ee98","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"DELETE","header":[],"url":"{{URL}}api/v1/reviews/5ffd55211ba965390cb52555","description":"<p>Pass in the id of the tour that you want to delete. You can only delete your own reviews.</p>\n<p>Admins can delete any review.</p>\n","urlObject":{"path":["v1","reviews","5ffd55211ba965390cb52555"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"2cac2586-cb43-4ba1-bf72-e17dc790ee98"}],"id":"86fdb187-6ace-4f42-bdd0-857b6f37563d","description":"<p>Users who booked a tour can write a review on it, this folder will help you to perform CRUD operations on all the review documents.</p>\n","event":[{"listen":"prerequest","script":{"id":"7a38b19e-835c-436c-9138-3a6e2d6a43aa","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"347d013b-5b8a-4cfe-937f-1ae7b7f2527d","type":"text/javascript","exec":[""]}}],"_postman_id":"86fdb187-6ace-4f42-bdd0-857b6f37563d"},{"name":"Tour/Review","item":[{"name":"Get All Reviews On Tour","id":"5a977f22-9204-44e0-8a9a-5fbe9cacd6dd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/tours/5ffd4710732be83aec3bce14/reviews","description":"<p>Pass in the id of the tour that you want to get the reviews of.</p>\n","urlObject":{"path":["v1","tours","5ffd4710732be83aec3bce14","reviews"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"5a977f22-9204-44e0-8a9a-5fbe9cacd6dd"},{"name":"Create New Review On Tour","id":"87c72da7-20e6-428b-a498-eb4c545295a1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"rating\": 1,\r\n    \"review\": \"Bad\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/tours/5ffdc07e7b3e143e78cbd546/reviews","description":"<p>Pass the id of the tour that you want to create the review on and send the data in the body, this time you only need to specify <code>review</code> and <code>rating</code>.</p>\n<p>Remember that you must buy a tour to review it and you can only create one review on the same tour, if you want to change it use the 'Update Review' route defined in the Reviews folder.</p>\n","urlObject":{"path":["v1","tours","5ffdc07e7b3e143e78cbd546","reviews"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"87c72da7-20e6-428b-a498-eb4c545295a1"}],"id":"87c00bf8-bd6f-4432-816d-5e38a66e13ac","description":"<p>This folder allows you to create/get/delete reviews easily thanks to nested routes.</p>\n","event":[{"listen":"prerequest","script":{"id":"23c01a95-6dab-4ea9-a7ea-3c37e9f6fbbd","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"dc2ba6dd-89ca-435d-bd27-fb97f9f116fc","type":"text/javascript","exec":[""]}}],"_postman_id":"87c00bf8-bd6f-4432-816d-5e38a66e13ac"},{"name":"Bookings","item":[{"name":"Get All Bookings","id":"8fec2b04-c0b1-4c3c-b665-ef168221d6e5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/bookings/","description":"<p>Get all the booking stored in the database. They show the booked tour and the user who bought it by default, exclude those properties in the output by using <code>api/v1/bookings/?fields=-tour,-user</code>.</p>\n<p>Query Features:</p>\n<h2 id=\"1-filtering\">1) FILTERING</h2>\n<p>You can query for any booking property. These are the available operators: gte, ft, lte, lt.</p>\n<p>For example: <code>api/v1/bookings/?price[gt]=400</code></p>\n<p>This will return all the bookings with a price of over 400 dollars.</p>\n<h2 id=\"2-sorting\">2) SORTING</h2>\n<p>Use 'sort' and add a comma between the properties you want to sort by. Everything is sorted in ascending order by default. Add a minus sign to sort in descending order.</p>\n<p>For example: <code>api/v1/bookings/?sort=-createdAt</code></p>\n<p>This will return the bookings sorted by the date in which they were created, starting with the most recent one. To start with the oldest bookings, remove the minus sign.</p>\n<h2 id=\"3-limit-fields\">3) LIMIT FIELDS</h2>\n<p>You can also choose the booking properties you want to get back by using the 'fields' parameter. Use a minus ('-') to exclude a property and get all the others.</p>\n<p>For example:</p>\n<ol>\n<li><p><code>api/v1/bookings/?fields=-tour,-user,-createdAt</code> would exclude the tour, user and createdAt properties from the output.</p>\n</li>\n<li><p><code>api/v1/bookings/?fields=price</code> would only return the price.</p>\n</li>\n</ol>\n<h2 id=\"4-paginate\">4) PAGINATE</h2>\n<p>Organize the bookings into pages. Just specify the 'page' and 'limit' parameters to suit your taste.</p>\n<p>Note how you can use 'limit' to set how many results you want to get back. Suppose that we have 8 bookings in total.</p>\n<ol>\n<li><code>api/v1/bookings/?page=1&amp;limit=4</code> would return the first 4 bookings.</li>\n<li><code>api/v1/bookings/?page=2&amp;limit=3</code> would return bookings 4-6.</li>\n</ol>\n<h3 id=\"remember-that-you-can-combine-all-these-filters\">REMEMBER THAT YOU CAN COMBINE ALL THESE FILTERS</h3>\n<p>Here's an example that will return page 2 with a limit of 3 results sorted from the largest to the smallest price greater than 999, excluding the tour data.</p>\n<p><code>api/v1/bookings/?price[gt]=999&amp;fields=price,-tour&amp;sort=-price&amp;limit=3&amp;page=2</code></p>\n","urlObject":{"path":["v1","bookings",""],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"8fec2b04-c0b1-4c3c-b665-ef168221d6e5"},{"name":"Get One Booking","id":"79c574d3-0ad1-45e8-892f-aede116d7f3a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/bookings/6007ad93257b72169498c0c7","description":"<p>Get an individual booking by passing in its id.</p>\n","urlObject":{"path":["v1","bookings","6007ad93257b72169498c0c7"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"79c574d3-0ad1-45e8-892f-aede116d7f3a"}],"id":"4527ec4a-c5bc-4c0d-94a5-39f0d25caa1c","description":"<p>A new booking is generated every time someone books a tour and it contains information about the purchase. Only admins and lead-guides have access to this data.</p>\n","event":[{"listen":"prerequest","script":{"id":"97afbef5-f3d0-4305-9038-dd969cf890a7","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"3fdb5be5-adbc-4389-9a9a-592f575782d3","type":"text/javascript","exec":[""]}}],"_postman_id":"4527ec4a-c5bc-4c0d-94a5-39f0d25caa1c"},{"name":"{{URL}}api/v1/bookings/checkout-session/5c88fa8cf4afda39709c2955","id":"ca7ef402-32c8-412f-a391-0f5503169f56","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/bookings/checkout-session/5c88fa8cf4afda39709c2955","urlObject":{"path":["v1","bookings","checkout-session","5c88fa8cf4afda39709c2955"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[],"_postman_id":"ca7ef402-32c8-412f-a391-0f5503169f56"}],"event":[{"listen":"prerequest","script":{"id":"a4c93344-e7d3-4ab4-8bef-ebb6c5975e46","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"e36428de-66cb-43bd-b246-975590c016f8","type":"text/javascript","exec":[""]}}]}