{"info":{"_postman_id":"770d3f26-80bd-4923-9985-2b6a882a00f2","name":"Natours","description":"<html><head></head><body><p>this is the full catalogue and how to use this API.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"9281864","collectionId":"770d3f26-80bd-4923-9985-2b6a882a00f2","publishedId":"SVzxaLDV","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-10-26T17:07:18.000Z"},"item":[{"name":"users","item":[{"name":"get all users","id":"5aeaa11a-e89e-433e-90e6-b3887af1255b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}/api/v1/users?role=user","urlObject":{"path":["api","v1","users"],"host":["{{URL}}"],"query":[{"key":"role","value":"user"}],"variable":[]}},"response":[],"_postman_id":"5aeaa11a-e89e-433e-90e6-b3887af1255b"},{"name":"get user","id":"3a4c130c-80fc-4f22-92c3-c8edff9b3c8f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}/api/v1/users/2","urlObject":{"path":["api","v1","users","2"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3a4c130c-80fc-4f22-92c3-c8edff9b3c8f"},{"name":"Delete User","id":"8d1c6cb1-5078-4e50-9a69-b2f53f4a07ba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"DELETE","header":[],"url":"{{URL}}/api/v1/users/5dab5c46c19236042c74c1e6","urlObject":{"path":["api","v1","users","5dab5c46c19236042c74c1e6"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"8d1c6cb1-5078-4e50-9a69-b2f53f4a07ba"},{"name":"Update User","id":"062cacdf-fcbb-4400-ae5b-9cb59ae7ecb2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"name\": \"nabil\"\n}"},"url":"{{URL}}/api/v1/users/5dacc6f895f8ef172cd08417","urlObject":{"path":["api","v1","users","5dacc6f895f8ef172cd08417"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"062cacdf-fcbb-4400-ae5b-9cb59ae7ecb2"},{"name":"update current user","id":"5c3496b5-a499-4dc5-9383-4ccf8e0e9dbb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"name\": \"Yafettt\",\n\t\"role\": \"admin\"\n}"},"url":"{{URL}}/api/v1/users/updateMe","urlObject":{"path":["api","v1","users","updateMe"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"5c3496b5-a499-4dc5-9383-4ccf8e0e9dbb"},{"name":"delete current user","id":"08a92d6c-9d57-4d4a-896f-a7e9fb97bfbb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"DELETE","header":[],"url":"{{URL}}/api/v1/users/deleteMe","urlObject":{"path":["api","v1","users","deleteMe"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"08a92d6c-9d57-4d4a-896f-a7e9fb97bfbb"},{"name":"Get current user","id":"a8c383b1-38c4-42a2-b14a-c83e37c7ca40","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}/api/v1/users/me","urlObject":{"path":["api","v1","users","me"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a8c383b1-38c4-42a2-b14a-c83e37c7ca40"}],"id":"51abaff1-a50a-476c-a3a4-595797018575","_postman_id":"51abaff1-a50a-476c-a3a4-595797018575","description":""},{"name":"tours","item":[{"name":"get top 5 and cheap","id":"7292f861-e340-4ed2-904f-507e1ed7007f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}/api/v1/tours/top-5-cheap?duration[gte]=5&difficulty=easy&limit=5&price[lt]=1500","urlObject":{"path":["api","v1","tours","top-5-cheap"],"host":["{{URL}}"],"query":[{"key":"duration[gte]","value":"5"},{"key":"difficulty","value":"easy"},{"disabled":true,"key":"sort","value":"price,ratingsAverage"},{"key":"limit","value":"5"},{"key":"price[lt]","value":"1500"}],"variable":[]}},"response":[],"_postman_id":"7292f861-e340-4ed2-904f-507e1ed7007f"},{"name":"Get tour","id":"ba8dbba9-e451-4fe9-8c1e-9c71126ca7f4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}/api/v1/tours/5db22ee08ecdee1c4457cfd3","urlObject":{"path":["api","v1","tours","5db22ee08ecdee1c4457cfd3"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ba8dbba9-e451-4fe9-8c1e-9c71126ca7f4"},{"name":"Create New Tour","id":"18651ee2-c805-4d4e-9b2d-f560e56d0d8e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"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  }"},"url":"{{URL}}/api/v1/tours","urlObject":{"path":["api","v1","tours"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"18651ee2-c805-4d4e-9b2d-f560e56d0d8e"},{"name":"Update tour","id":"560cb479-39bc-4d92-b16b-f372f734a74d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\"ratingAverage\": 6,\n\"difficulty\": \"sdfdsf\",\n\"name\": \"short\"\n}"},"url":"{{URL}}/api/v1/tours/5d96c25c84436a1df040b182","urlObject":{"path":["api","v1","tours","5d96c25c84436a1df040b182"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"560cb479-39bc-4d92-b16b-f372f734a74d"},{"name":"Delete tour","id":"369cabe0-5085-43fe-a252-e0a1d1510da2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"DELETE","header":[],"url":"{{URL}}/api/v1/tours/5daf24388b1a5e1e54ae6349","urlObject":{"path":["api","v1","tours","5daf24388b1a5e1e54ae6349"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"369cabe0-5085-43fe-a252-e0a1d1510da2"},{"name":"get all tours","id":"548fdd08-f3b3-477b-aebf-9307ebecd900","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}/api/v1/tours?duration[gte]=5&sort=price,ratingsAverage","description":"<p>Use this endpoint to get all tours</p>\n","urlObject":{"path":["api","v1","tours"],"host":["{{URL}}"],"query":[{"description":{"content":"<p>query for tour duration. Supports gte, lte, gt, lt operators</p>\n","type":"text/plain"},"key":"duration[gte]","value":"5"},{"disabled":true,"key":"difficulty","value":"easy"},{"key":"sort","value":"price,ratingsAverage"},{"disabled":true,"key":"authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkYWEwZTE0NTYyYmZmMjQ0YzhjNGM3YiIsImlhdCI6MTU3MTQ5Mjk3MywiZXhwIjoxNTc5MjY4OTczfQ.VciY3M4bWVYd9eJHBkvRNRPDimF1AzcCkgC0xNVRjMU"},{"disabled":true,"key":"price[lt]","value":"1000"},{"disabled":true,"key":"ratingsAverage[gte]","value":"4.7"}],"variable":[]}},"response":[],"_postman_id":"548fdd08-f3b3-477b-aebf-9307ebecd900"},{"name":"Get Tours Within radius","id":"2448f81a-ced6-451e-b2d9-044f8123da8a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}/api/v1/tours/tours-within/400/center/34.111745,-118.113491/unit/mi","urlObject":{"path":["api","v1","tours","tours-within","400","center","34.111745,-118.113491","unit","mi"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2448f81a-ced6-451e-b2d9-044f8123da8a"},{"name":"Get Distances to Tours From Points","id":"3ab611fd-7e27-4ef9-8cb7-9977b89a3238","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}/api/v1/tours/distances/34.111745,-118.113491/unit/kmnn","urlObject":{"path":["api","v1","tours","distances","34.111745,-118.113491","unit","kmnn"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3ab611fd-7e27-4ef9-8cb7-9977b89a3238"}],"id":"4ef3e3f9-1319-4236-aa29-2d48b4366520","description":"<p><strong>You can get all tours, create new ones, edit and delete tours.</strong> there are also special enpoints for some special requirements</p>\n","event":[{"listen":"prerequest","script":{"id":"2c54579e-2063-437d-b71b-9befb409e521","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"361a8263-c277-4a9e-aea1-8bca5dffefd3","type":"text/javascript","exec":[""]}}],"_postman_id":"4ef3e3f9-1319-4236-aa29-2d48b4366520"},{"name":"authentication","item":[{"name":"updatePassword","event":[{"listen":"test","script":{"id":"86556daa-8022-47b5-b8bc-999aa7ee80b2","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"ef6289f4-a9ff-46db-b7f9-febf9b2c36c6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"passwordCurrent\": \"yafet1230\",\n\t\"password\": \"newpassword\",\n\t\"passwordConfirm\": \"newpassword\"\n}"},"url":"{{URL}}/api/v1/users/updateMyPassword","urlObject":{"path":["api","v1","users","updateMyPassword"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ef6289f4-a9ff-46db-b7f9-febf9b2c36c6"},{"name":"resetPassword","event":[{"listen":"test","script":{"id":"f6bb80c4-f312-404b-9119-f356063c76b4","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"b7f36782-4689-43f3-8a7f-f1afb97912ad","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"password\": \"newpass123\",\n\t\"passwordConfirm\": \"newpass123\"\n}"},"url":"{{URL}}/api/v1/users/resetPassword/","urlObject":{"path":["api","v1","users","resetPassword",""],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b7f36782-4689-43f3-8a7f-f1afb97912ad"},{"name":"forgotPassword","id":"2b6ecbe3-4398-4563-baa1-0faa6d0d45cf","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\": \"admin@gmail.com\"\n\t\n}"},"url":"{{URL}}/api/v1/users/forgotPassword","urlObject":{"path":["api","v1","users","forgotPassword"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2b6ecbe3-4398-4563-baa1-0faa6d0d45cf"},{"name":"LOGIN","event":[{"listen":"test","script":{"id":"e72bc12a-2222-402d-a384-ec976b607ccd","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"dc876bd7-382e-417e-8fde-9e176859ca88","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\": \"leo@example.com\",\n\t\"password\": \"test1234\"\n}"},"url":"{{URL}}/api/v1/users/login","urlObject":{"path":["api","v1","users","login"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"dc876bd7-382e-417e-8fde-9e176859ca88"},{"name":"signup","event":[{"listen":"test","script":{"id":"ad2cce0d-d8e6-4c61-b939-0b77744f81e3","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"3a43b45b-6883-485e-943a-1896dce2115f","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\": \"admin6@gmail.com\",\n\t\"password\": \"pass1234\",\n\t\"passwordConfirm\": \"pass1234\",\n\t\"name\" : \"yafet\",\n\t\"role\": \"user\"\n}"},"url":"{{URL}}/api/v1/users/signup","urlObject":{"path":["api","v1","users","signup"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3a43b45b-6883-485e-943a-1896dce2115f"}],"id":"e195ca96-106f-4127-b8d9-35ac4219b054","_postman_id":"e195ca96-106f-4127-b8d9-35ac4219b054","description":""},{"name":"reviews","item":[{"name":"Get all reviews","id":"a7082d02-f6ca-4159-8a50-8651384c2983","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}/api/v1/reviews","urlObject":{"path":["api","v1","reviews"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a7082d02-f6ca-4159-8a50-8651384c2983"},{"name":"Get One Review","id":"7f847837-c08b-43a5-a1da-d10fbbb96794","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}/api/v1/reviews/5daf7c6d4f804e12b82820f5","urlObject":{"path":["api","v1","reviews","5daf7c6d4f804e12b82820f5"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7f847837-c08b-43a5-a1da-d10fbbb96794"},{"name":"Create New Review","id":"e12a62de-1764-4b6a-beef-d304693bb9c8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"review\": \"loved it\",\n\t\"rating\": 4,\n\t\"tour\": \"5c88fa8cf4afda39709c2961\",\n\t\"user\": \"5daf7c154f804e12b82820f3\"\n}"},"url":"{{URL}}/api/v1/reviews","urlObject":{"path":["api","v1","reviews"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e12a62de-1764-4b6a-beef-d304693bb9c8"},{"name":"Delete review","id":"bf7337a7-3222-42ea-b271-635b1c35d398","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"DELETE","header":[],"url":"{{URL}}/api/v1/reviews/5db393688b85b71d40081493","urlObject":{"path":["api","v1","reviews","5db393688b85b71d40081493"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"bf7337a7-3222-42ea-b271-635b1c35d398"},{"name":"Update Review","id":"b53591cc-4a77-4356-a9f3-92735644d403","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"PATCH","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"rating\": 3\n}"},"url":"{{URL}}/api/v1/reviews/5db2334436eac62734d988dc","urlObject":{"path":["api","v1","reviews","5db2334436eac62734d988dc"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b53591cc-4a77-4356-a9f3-92735644d403"}],"id":"da145d42-0496-468d-91c8-ca378701506d","_postman_id":"da145d42-0496-468d-91c8-ca378701506d","description":""},{"name":"tours/reviews","item":[{"name":"Create New Review On Tour","id":"b3a54caf-b89a-49e0-ac24-075aac56af79","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"rating\": 5,\n\t\"review\": \"okay\"\n}"},"url":"{{URL}}/api/v1/tours/5db22ee08ecdee1c4457cfd3/reviews","urlObject":{"path":["api","v1","tours","5db22ee08ecdee1c4457cfd3","reviews"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b3a54caf-b89a-49e0-ac24-075aac56af79"},{"name":"Get all reviews on specific tour","id":"93df41e5-7dc6-40f2-ab52-62c9c6aa3d86","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"{{jwt}}"},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}/api/v1/tours/5c88fa8cf4afda39709c2961/reviews","urlObject":{"path":["api","v1","tours","5c88fa8cf4afda39709c2961","reviews"],"host":["{{URL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"93df41e5-7dc6-40f2-ab52-62c9c6aa3d86"}],"id":"c8032ecb-be82-476f-bfd1-d26aac08bef0","_postman_id":"c8032ecb-be82-476f-bfd1-d26aac08bef0","description":""}],"event":[{"listen":"prerequest","script":{"id":"25132379-4911-4273-a49c-9a818dbfeaa8","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"84487c25-7497-4356-8cda-9f1d447a9e2f","type":"text/javascript","exec":[""]}}]}