extras/docs/Rest Api Slim PHP.postman_collection.json
{
"info": {
"_postman_id": "78eb728a-890c-6cc5-1036-fcd8f46a2243",
"name": "Rest Api Slim PHP",
"description": "[Example of REST API](https://github.com/maurobonfietti/rest-api-slim-php) with Slim PHP micro framework.\n\nThis simple API allows you to manage resources such as: users, tasks and notes.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Info",
"item": [
{
"name": "Get Help",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"tests[\"Response time is less than 200ms\"] = responseTime < 200;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches help\"] = responseBody.has(\"help\");",
""
]
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{domain-api-rest-slimphp}}",
"host": [
"{{domain-api-rest-slimphp}}"
]
},
"description": "Get help about this api."
},
"response": [
{
"name": "Get Help",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "{{domain-api-rest-slimphp}}",
"host": [
"{{domain-api-rest-slimphp}}"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Host",
"value": "localhost:8080"
},
{
"key": "Date",
"value": "Tue, 18 Jun 2019 22:39:02 +0000"
},
{
"key": "Connection",
"value": "close"
},
{
"key": "X-Powered-By",
"value": "PHP/7.3.4"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Content-Length",
"value": "463"
}
],
"cookie": [],
"body": "{\n \"code\": 200,\n \"status\": \"success\",\n \"message\": {\n \"endpoints\": {\n \"tasks\": \"http://localhost:8080/api/v1/tasks\",\n \"users\": \"http://localhost:8080/api/v1/users\",\n \"notes\": \"http://localhost:8080/api/v1/notes\",\n \"docs\": \"http://localhost:8080/docs/index.html\",\n \"status\": \"http://localhost:8080/status\",\n \"this help\": \"http://localhost:8080\"\n },\n \"version\": \"2.13.0\",\n \"timestamp\": 1624812953\n }\n}"
}
]
},
{
"name": "Get Status",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{domain-api-rest-slimphp}}/status",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"status"
]
},
"description": "Get status of this api."
},
"response": [
{
"name": "Get Status",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "{{domain-api-rest-slimphp}}/status",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"status"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Host",
"value": "localhost:8080"
},
{
"key": "Date",
"value": "Tue, 18 Jun 2019 22:39:39 +0000"
},
{
"key": "Connection",
"value": "close"
},
{
"key": "X-Powered-By",
"value": "PHP/7.3.4"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Content-Length",
"value": "228"
}
],
"cookie": [],
"body": "{\n \"code\": 200,\n \"status\": \"success\",\n \"message\": {\n \"stats\": {\n \"tasks\": 8,\n \"users\": 42,\n \"notes\": 63\n },\n \"MySQL\": \"OK\",\n \"Redis\": \"Disabled\",\n \"version\": \"2.12.0\",\n \"timestamp\": 1624808196\n }\n}"
}
]
}
],
"description": "Get information about API."
},
{
"name": "Login",
"item": [
{
"name": "Login",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"super.email@host.com\",\n \"password\": \"OnePass1\"\n}"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/login",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"login"
]
},
"description": "Login and get a JWT Token Authorization Bearer to use this api."
},
"response": [
{
"name": "Login OK",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"m@b.com.ar\",\n \"password\": \"123\"\n}"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/login",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"login"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Host",
"value": "localhost:8080"
},
{
"key": "Date",
"value": "Wed, 22 May 2019 19:24:12 +0000"
},
{
"key": "Connection",
"value": "close"
},
{
"key": "X-Powered-By",
"value": "PHP/7.3.4"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Content-Length",
"value": "291"
}
],
"cookie": [],
"body": "{\n \"code\": 200,\n \"status\": \"success\",\n \"message\": {\n \"Authorization\": \"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMSIsImVtYWlsIjoibUBiLmNvbS5hciIsIm5hbWUiOiJNTkIiLCJpYXQiOjE1NTg1NTMwNTIsImV4cCI6MTU1OTE1Nzg1Mn0.OQyICWlGW0oSUB-ANrYL2OJTdC2v0OQQO3RQQ3W_KLo\"\n }\n}"
},
{
"name": "Login Failed",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"myuser@mail.com\",\n \"password\": \"IDontKnow\"\n}"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/login",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"login"
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Host",
"value": "localhost:8080"
},
{
"key": "Date",
"value": "Wed, 22 May 2019 19:25:28 +0000"
},
{
"key": "Connection",
"value": "close"
},
{
"key": "X-Powered-By",
"value": "PHP/7.3.4"
},
{
"key": "Content-type",
"value": "application/json"
},
{
"key": "Content-Length",
"value": "133"
}
],
"cookie": [],
"body": "{\n \"message\": \"Login failed: Email or password incorrect.\",\n \"class\": \"UserException\",\n \"status\": \"error\",\n \"code\": 400\n}"
}
]
}
]
},
{
"name": "Users",
"item": [
{
"name": "Get All Users",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches user\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{jwt}}",
"type": "text"
}
],
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/users?page=1&perPage=10&name=&email=",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"users"
],
"query": [
{
"key": "page",
"value": "1",
"description": "Number of the page"
},
{
"key": "perPage",
"value": "10",
"description": "Quantity of items per page"
},
{
"key": "name",
"value": "",
"description": "Search by name"
},
{
"key": "email",
"value": "",
"description": "Search by email"
}
]
}
},
"response": []
},
{
"name": "Get One User",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches user\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{jwt}}",
"type": "text"
}
],
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/users/8",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"users",
"8"
]
}
},
"response": []
},
{
"name": "Create User",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 201\"] = responseCode.code === 201;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"Created\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches user\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"John User\",\n \"email\": \"super.email@host.com\",\n \"password\": \"OnePass1\"\n}"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/users",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"users"
]
},
"description": "Register a new user."
},
"response": []
},
{
"name": "Update User",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches user\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"value": "{{jwt}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"John The User 22\",\n \"email\": \"super.email@host.com.br\"\n}"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/users/12",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"users",
"12"
]
},
"description": "Update a user."
},
"response": []
},
{
"name": "Delete User",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Status code is 204\"] = responseCode.code === 204;",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "{{jwt}}",
"type": "text"
}
],
"body": {
"mode": "formdata",
"formdata": []
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/users/112",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"users",
"112"
]
},
"description": "Delete a user."
},
"response": []
}
],
"description": "Manage Users."
},
{
"name": "Tasks",
"item": [
{
"name": "Get All Tasks",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches task\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{jwt}}",
"type": "text"
}
],
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/tasks?page=1&perPage=5&name=&description=&status=",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"tasks"
],
"query": [
{
"key": "page",
"value": "1",
"description": "Number of the page"
},
{
"key": "perPage",
"value": "5",
"description": "Quantity of items per page"
},
{
"key": "name",
"value": "",
"description": "Search by name"
},
{
"key": "description",
"value": "",
"description": "Search by description"
},
{
"key": "status",
"value": "",
"description": "Search by status"
}
]
},
"description": "Get all tasks of a user."
},
"response": []
},
{
"name": "Get One Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 200ms\"] = responseTime < 200;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches task\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{jwt}}",
"type": "text"
}
],
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/tasks/13",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"tasks",
"13"
]
},
"description": "Get one task of a user."
},
"response": []
},
{
"name": "Create Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 201\"] = responseCode.code === 201;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"Created\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches help\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Authorization",
"type": "text",
"value": "{{jwt}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"Go To Sleep\",\n \"description\": \"It's too late, go to sleep man ;-)\",\n \"status\": 0\n}\n"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/tasks",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"tasks"
]
},
"description": "Create a task."
},
"response": []
},
{
"name": "Update Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches task\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "Authorization",
"type": "text",
"value": "{{jwt}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"Go To Sleep NOW!!\",\n \"description\": \"It's too late, go to sleep man haha...\",\n \"status\": 1\n}\n"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/tasks/29",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"tasks",
"29"
]
},
"description": "Update a task of a user."
},
"response": []
},
{
"name": "Delete Task",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 200ms\"] = responseTime < 200;",
"tests[\"Status code is 204\"] = responseCode.code === 204;",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "{{jwt}}",
"type": "text"
}
],
"body": {
"mode": "formdata",
"formdata": []
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/tasks/29",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"tasks",
"29"
]
},
"description": "Delete a task of a user."
},
"response": []
}
],
"description": "Manage Tasks."
},
{
"name": "Notes",
"item": [
{
"name": "Get All Notes",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches user\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/notes?page=1&perPage=10&name=&description=",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"notes"
],
"query": [
{
"key": "page",
"value": "1",
"description": "Number of the page"
},
{
"key": "perPage",
"value": "10",
"description": "Quantity of items per page"
},
{
"key": "name",
"value": "",
"description": "Search by name"
},
{
"key": "description",
"value": "",
"description": "Search by description"
}
]
}
},
"response": []
},
{
"name": "Get One Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches user\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/notes/3",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"notes",
"3"
]
}
},
"response": []
},
{
"name": "Create Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 201\"] = responseCode.code === 201;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"Created\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches user\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"New Soccer Note\",\n \"description\": \"Magic Goal...\"\n}"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/notes",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"notes"
]
}
},
"response": []
},
{
"name": "Update Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Content-Type is present\"] = postman.getResponseHeader(\"Content-Type\");",
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"tests[\"Status code name has string\"] = responseCode.name.has(\"OK\");",
"tests[\"Body matches success\"] = responseBody.has(\"success\");",
"tests[\"Body matches message\"] = responseBody.has(\"message\");",
"tests[\"Body matches user\"] = responseBody.has(\"name\");",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"My Note Number 433333\",\n \"description\": \"Free Note?!?!?!\"\n}"
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/notes/4",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"notes",
"4"
]
}
},
"response": []
},
{
"name": "Delete Note",
"event": [
{
"listen": "test",
"script": {
"exec": [
"tests[\"Response time is less than 250ms\"] = responseTime < 250;",
"tests[\"Status code is 204\"] = responseCode.code === 204;",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [],
"body": {
"mode": "formdata",
"formdata": []
},
"url": {
"raw": "{{domain-api-rest-slimphp}}/api/v1/notes/22",
"host": [
"{{domain-api-rest-slimphp}}"
],
"path": [
"api",
"v1",
"notes",
"22"
]
}
},
"response": []
}
],
"description": "Manage Notes.",
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}