mirror of
https://github.com/kevin-DL/complete-node-bootcamp.git
synced 2026-01-11 19:14:26 +00:00
1195 lines
22 KiB
JSON
1195 lines
22 KiB
JSON
{
|
|
"info": {
|
|
"_postman_id": "460e30fe-57f6-4d86-8515-611a5a134b96",
|
|
"name": "Natours",
|
|
"description": "The Natours APi contains endpoints for Tours, Users, and Reviews.",
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
|
},
|
|
"item": [
|
|
{
|
|
"name": "Tours",
|
|
"item": [
|
|
{
|
|
"name": "Get All Tours",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours?duration[gte]=7&sort=price",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "duration[gte]",
|
|
"value": "7",
|
|
"description": "Query for tour duration. Supports gte, lte, gt, lt operators."
|
|
},
|
|
{
|
|
"key": "price[lte]",
|
|
"value": "500",
|
|
"disabled": true
|
|
},
|
|
{
|
|
"key": "sort",
|
|
"value": "price"
|
|
}
|
|
]
|
|
},
|
|
"description": "Use this endpoint to create a new tour."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Tour",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/5c88fa8cf4afda39709c2961",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"5c88fa8cf4afda39709c2961"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Create New Tour",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"name\": \"New Test Tour\",\n \"duration\": 1,\n \"maxGroupSize\": 1,\n \"difficulty\": \"easy\",\n \"price\": 200,\n \"summary\": \"Test tour\",\n \"imageCover\": \"tour-3-cover.jpg\"\n }"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update Tour",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "imageCover",
|
|
"type": "file",
|
|
"src": ""
|
|
},
|
|
{
|
|
"key": "images",
|
|
"type": "file",
|
|
"src": ""
|
|
},
|
|
{
|
|
"key": "images",
|
|
"type": "file",
|
|
"src": ""
|
|
},
|
|
{
|
|
"key": "images",
|
|
"type": "file",
|
|
"src": ""
|
|
},
|
|
{
|
|
"key": "price",
|
|
"value": "997",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/5cdb06c8d87ca1051d90eda9",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"5cdb06c8d87ca1051d90eda9"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Delete Tour",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/5c88fa8cf4afda39709c295a",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"5c88fa8cf4afda39709c295a"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Top 5 Cheap Tours",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/top-5-cheap",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"top-5-cheap"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Monthly Plan",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/monthly-plan/2021",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"monthly-plan",
|
|
"2021"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Tour Stats",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/tour-stats",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"tour-stats"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Tours Within Radius",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/tours-within/200/center/34.111745,-118.113491/unit/mi",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"tours-within",
|
|
"200",
|
|
"center",
|
|
"34.111745,-118.113491",
|
|
"unit",
|
|
"mi"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Distances to Tours From Point",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/distances/34.111745,-118.113491/unit/mi",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"distances",
|
|
"34.111745,-118.113491",
|
|
"unit",
|
|
"mi"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
],
|
|
"description": "**You can get all tours, create new ones, and edit and delete tours**. There are also special endpoints for some special requirements.",
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "63d5f51a-af4d-47e8-b68e-0760b5387fc7",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "8b4e60d2-1502-4aef-ab60-f1d558d23c48",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Reviews",
|
|
"item": [
|
|
{
|
|
"name": "Get All Reviews",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/reviews",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"reviews"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Review",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/reviews/5cd18f4e980a2725a50b3697",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"reviews",
|
|
"5cd18f4e980a2725a50b3697"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Create New Review",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"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\": \"5c88fa8cf4afda39709c2951\",\n\t\"user\": \"5cd14baa326b861fab416f56\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/reviews",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"reviews"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update Review",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n\t\"rating\": 5\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/reviews/5cd2fa8671a96a383912d910",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"reviews",
|
|
"5cd2fa8671a96a383912d910"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Delete Review",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/reviews/5cd2f257db447337b3ff3f00",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"reviews",
|
|
"5cd2f257db447337b3ff3f00"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Tours/Reviews",
|
|
"item": [
|
|
{
|
|
"name": "Create New Review on Tour",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"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\": \"Amazing\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/5cd2e336e4dc26366252ac14/reviews",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"5cd2e336e4dc26366252ac14",
|
|
"reviews"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get All Reviews on Tour",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/tours/5c88fa8cf4afda39709c2951/reviews",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"tours",
|
|
"5c88fa8cf4afda39709c2951",
|
|
"reviews"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Users",
|
|
"item": [
|
|
{
|
|
"name": "Get All Users",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users?role=user",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "role",
|
|
"value": "user"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get User",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/2",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"2"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update User",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n\t\"name\": \"Administrator\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/5ccb07c27e0cc24b1b44b7b5",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"5ccb07c27e0cc24b1b44b7b5"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Delete User",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/5cd1a3b341c1d027493464e3",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"5cd1a3b341c1d027493464e3"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Current User",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/me",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"me"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update Current User",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n\t\"name\": \"Jonas Schmedtmann\",\n\t\"role\": \"admin\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/updateMe",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"updateMe"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Delete Current User",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/deleteMe",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"deleteMe"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Authentication",
|
|
"item": [
|
|
{
|
|
"name": "Sign Up",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "4a5a1b58-6b97-4d86-9d49-719060cab8f5",
|
|
"exec": [
|
|
"pm.environment.set(\"jwt\", pm.response.json().token);"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n\t\"name\": \"Jonas\",\n \"email\": \"jonas@mailsac.com\",\n\t\"password\": \"pass1234\",\n\t\"passwordConfirm\": \"pass1234\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/signup",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"signup"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Login",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "a36e7176-54eb-4b09-9125-9707e20d3ffb",
|
|
"exec": [
|
|
"pm.environment.set(\"jwt\", pm.response.json().token);"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n\t\"email\": \"admin@natours.io\",\n\t\"password\": \"{{password}}\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/login",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"login"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Forgot Password",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n\t\"email\": \"test3@natours.io\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/forgotPassword",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"forgotPassword"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Reset Password",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "887b4615-1d19-442b-b104-1cc764105ffb",
|
|
"exec": [
|
|
"pm.environment.set(\"jwt\", pm.response.json().token);"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n\t\"password\": \"newpassword\",\n\t\"passwordConfirm\": \"newpassword\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/resetPassword/1652bfc347b939d3d19cea352d231d6dbe6dfef0884e68e6c61629019c44b9ca",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"resetPassword",
|
|
"1652bfc347b939d3d19cea352d231d6dbe6dfef0884e68e6c61629019c44b9ca"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update Current User Password",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "f3e69f3e-55b4-4a83-8206-f14411403fe7",
|
|
"exec": [
|
|
"pm.environment.set(\"jwt\", pm.response.json().token);"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PATCH",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n\t\"passwordCurrent\": \"pass1234\",\n\t\"password\": \"newpassword\",\n\t\"passwordConfirm\": \"newpassword\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/users/updateMyPassword",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"users",
|
|
"updateMyPassword"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Bookings",
|
|
"item": [
|
|
{
|
|
"name": "Get All Bookings",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/bookings",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"bookings"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Get Booking",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{jwt}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{URL}}api/v1/bookings/5ce3f70754eaa0063fd522e8",
|
|
"host": [
|
|
"{{URL}}api"
|
|
],
|
|
"path": [
|
|
"v1",
|
|
"bookings",
|
|
"5ce3f70754eaa0063fd522e8"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "18b4769a-4234-4964-a082-4f26694e5624",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "17f3f82d-7c5a-4be2-b419-83c1d5e408ea",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
} |