Skip to content

Commit

Permalink
2.1.2
Browse files Browse the repository at this point in the history
Uploaded the rest of configuration files for Postman.
  • Loading branch information
1plam authored Jun 14, 2023
1 parent c419548 commit 1841248
Show file tree
Hide file tree
Showing 2 changed files with 431 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"info": {
"_postman_id": "da533853-8d5e-4aa1-9467-35732a5fb356",
"name": "FleetJourney.EmployeeService",
"description": "# 🚀 Get started here\n\nThis template guides you through CRUD operations (GET, POST, PUT, DELETE), variables, and tests.\n\n## 🔖 **How to use this template**\n\n#### **Step 1: Send requests**\n\nRESTful APIs allow you to perform CRUD operations using the POST, GET, PUT, and DELETE HTTP methods.\n\nThis collection contains each of these request types. Open each request and click \"Send\" to see what happens.\n\n#### **Step 2: View responses**\n\nObserve the response tab for status code (200 OK), response time, and size.\n\n#### **Step 3: Send new Body data**\n\nUpdate or add new data in \"Body\" in the POST request. Typically, Body data is also used in PUT request.\n\n```\n{\n \"name\": \"Add your name in the body\"\n}\n\n```\n\n#### **Step 4: Update the variable**\n\nVariables enable you to store and reuse values in Postman. We have created a variable called `base_url` with the sample request [https://postman-api-learner.glitch.me](https://postman-api-learner.glitch.me). Replace it with your API endpoint to customize this collection.\n\n#### **Step 5: Add tests in the \"Tests\" tab**\n\nTests help you confirm that your API is working as expected. You can write test scripts in JavaScript and view the output in the \"Test Results\" tab.\n\n<img src=\"https://content.pstmn.io/b5f280a7-4b09-48ec-857f-0a7ed99d7ef8/U2NyZWVuc2hvdCAyMDIzLTAzLTI3IGF0IDkuNDcuMjggUE0ucG5n\">\n\n## 💪 Pro tips\n\n- Use folders to group related requests and organize the collection.\n- Add more scripts in \"Tests\" to verify if the API works as expected and execute flows.\n \n\n## ℹ️ Resources\n\n[Building requests](https://learning.postman.com/docs/sending-requests/requests/) \n[Authorizing requests](https://learning.postman.com/docs/sending-requests/authorization/) \n[Using variables](https://learning.postman.com/docs/sending-requests/variables/) \n[Managing environments](https://learning.postman.com/docs/sending-requests/managing-environments/) \n[Writing scripts](https://learning.postman.com/docs/writing-scripts/intro-to-scripts/)",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
"_exporter_id": "25803935"
},
"item": [
{
"name": "GetAll",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.variables.get(\"variable_key\");"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": "{{base_url}}/api/employees",
"description": "This is a GET request and it is used to \"get\" data from an endpoint. There is no request body for a GET request, but you can use query parameters to help specify the resource you want data on (e.g., in this request, we have `id=1`).\n\nA successful GET response will have a `200 OK` status, and should include some kind of response body - for example, HTML web content or JSON data."
},
"response": []
},
{
"name": "GetById",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": "{{base_url}}/api/employees/f6842701-4cee-4895-b3fa-838c698343e4",
"description": "This is a GET request and it is used to \"get\" data from an endpoint. There is no request body for a GET request, but you can use query parameters to help specify the resource you want data on (e.g., in this request, we have `id=1`).\n\nA successful GET response will have a `200 OK` status, and should include some kind of response body - for example, HTML web content or JSON data."
},
"response": []
},
{
"name": "GetByEmail",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": "{{base_url}}/api/employees/nick@gmail.com",
"description": "This is a GET request and it is used to \"get\" data from an endpoint. There is no request body for a GET request, but you can use query parameters to help specify the resource you want data on (e.g., in this request, we have `id=1`).\n\nA successful GET response will have a `200 OK` status, and should include some kind of response body - for example, HTML web content or JSON data."
},
"response": []
},
{
"name": "Create",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n\t\"email\": \"manager@gmail.com\",\n \"name\": \"Danilo\",\n \"lastname\": \"Pasecinic\",\n \"birthdate\": \"2005-08-08\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "{{base_url}}/api/employees",
"description": "This is a POST request, submitting data to an API via the request body. This request submits JSON data, and the data is reflected in the response.\n\nA successful POST request typically returns a `200 OK` or `201 Created` response code."
},
"response": []
},
{
"name": "Update",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Successful PUT request\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([200, 201, 204]);",
"});",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"test@gmail.com\",\n \"name\": \"Daniel\",\n \"lastname\": \"Pasecinic\",\n \"birthdate\": \"2000-10-10\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "{{base_url}}/api/employees/c8d7795a-5728-41c5-a3a6-5a1b56c50ace",
"description": "This is a PUT request and it is used to overwrite an existing piece of data. For instance, after you create an entity with a POST request, you may want to modify that later. You can do that using a PUT request. You typically identify the entity being updated by including an identifier in the URL (eg. `id=1`).\n\nA successful PUT request typically returns a `200 OK`, `201 Created`, or `204 No Content` response code."
},
"response": []
},
{
"name": "Delete",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Successful DELETE request\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([200, 202, 204]);",
"});",
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "{{base_url}}/api/employees/93d440ee-cb6d-43ae-a805-1752a83375c5",
"description": "This is a DELETE request, and it is used to delete data that was previously created via a POST request. You typically identify the entity being updated by including an identifier in the URL (eg. `id=1`).\n\nA successful DELETE request typically returns a `200 OK`, `202 Accepted`, or `204 No Content` response code."
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "base_url",
"value": "http://localhost:8080"
}
]
}
Loading

0 comments on commit 1841248

Please sign in to comment.