{"info":{"_postman_id":"03b3ddaf-7576-49e6-98c9-3395fb072ddf","name":"API Documentation for Parking Lot System","description":"<html><head></head><body><h1 id=\"get-started-here\">🚀 Get started here</h1>\n<p>This collection guides you through CRUD operations (GET, POST, PUT, DELETE), variables, and tests.</p>\n<h2 id=\"🔖-how-to-use-this-collection\">🔖 <strong>How to use this collection</strong></h2>\n<h4 id=\"step-1-send-requests\"><strong>Step 1: Send requests</strong></h4>\n<p>RESTful APIs allow you to perform CRUD operations using the POST, GET, PUT, and DELETE HTTP methods.</p>\n<p>This collection contains each of these request types. Open each request and click \"Send\" to see what happens.</p>\n<h4 id=\"step-2-view-responses\"><strong>Step 2: View responses</strong></h4>\n<p>Observe the response tab for status code (200 OK), response time, and size.</p>\n<h4 id=\"step-3-send-new-body-data\"><strong>Step 3: Send new Body data</strong></h4>\n<p>Update or add new data in \"Body\" in the POST request. Typically, Body data is also used in PUT and PATCH requests.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"name\": \"Add your name in the body\"\n}\n\n</code></pre><h4 id=\"step-4-update-the-variable\"><strong>Step 4: Update the variable</strong></h4>\n<p>Variables enable you to store and reuse values in Postman. We have created a variable called <code>base_url</code> with the sample request <a href=\"https://postman-api-learner.glitch.me\">https://postman-api-learner.glitch.me</a>. Replace it with your API endpoint to customize this collection.</p>\n<h4 id=\"step-5-add-tests-in-the-tests-tab\"><strong>Step 5: Add tests in the \"Tests\" tab</strong></h4>\n<p>Tests 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.</p>\n<img src=\"https://content.pstmn.io/b5f280a7-4b09-48ec-857f-0a7ed99d7ef8/U2NyZWVuc2hvdCAyMDIzLTAzLTI3IGF0IDkuNDcuMjggUE0ucG5n\">\n\n<h2 id=\"💪-pro-tips\">💪 Pro tips</h2>\n<ul>\n<li>Use folders to group related requests and organize the collection.</li>\n<li>Add more scripts in \"Tests\" to verify if the API works as expected and execute flows.</li>\n</ul>\n<h2 id=\"ℹ️-resources\">ℹ️ Resources</h2>\n<p><a href=\"https://learning.postman.com/docs/sending-requests/requests/\">Building requests</a><br><a href=\"https://learning.postman.com/docs/sending-requests/authorization/\">Authorizing requests</a><br><a href=\"https://learning.postman.com/docs/sending-requests/variables/\">Using variables</a><br><a href=\"https://learning.postman.com/docs/sending-requests/managing-environments/\">Managing environments</a><br><a href=\"https://learning.postman.com/docs/writing-scripts/intro-to-scripts/\">Writing scripts</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"🚀 Get started here","slug":"get-started-here"}],"owner":"29632624","collectionId":"03b3ddaf-7576-49e6-98c9-3395fb072ddf","publishedId":"2sA2xh1C5a","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-03-08T09:31:01.000Z"},"item":[{"name":"To get data of parking spaces in the parking lot of given color","event":[{"listen":"test","script":{"id":"632c7387-38a5-4f0d-87d1-7b7cea420b36","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript"}}],"id":"ca17b9a4-c214-447c-b365-18480b899fb5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:8000/api/Slots?color=GREEN&parkingLotId=65e72adb1a811501c45afd72","description":"<p>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 <code>id=1</code>).</p>\n<p>A successful GET response will have a <code>200 OK</code> status, and should include some kind of response body - for example, HTML web content or JSON data.</p>\n","urlObject":{"port":"8000","path":["api","Slots"],"host":["localhost"],"query":[{"key":"color","value":"GREEN"},{"key":"parkingLotId","value":"65e72adb1a811501c45afd72"}],"variable":[]}},"response":[],"_postman_id":"ca17b9a4-c214-447c-b365-18480b899fb5"},{"name":"To Park the Car at Parking Lot","event":[{"listen":"test","script":{"id":"e4f652dc-ef3e-460a-9c5e-3d8884b42dd4","exec":["pm.test(\"Successful POST request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 201]);","});",""],"type":"text/javascript"}}],"id":"bc0a4aec-ab9d-466e-b92a-ce0195048129","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\n\"parkingLotId\": \"65e72adb1a811501c45afd72\",\n\"registrationNumber\": \"MH12A1234\",\n\"color\": \"YELLOW\"\n\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8000/api/Parkings","description":"<p>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.</p>\n<p>A successful POST request typically returns a <code>200 OK</code> or <code>201 Created</code> response code.</p>\n","urlObject":{"port":"8000","path":["api","Parkings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"bc0a4aec-ab9d-466e-b92a-ce0195048129"},{"name":"To get data of cars of given color and parkingLot","event":[{"listen":"test","script":{"id":"cc904d03-9dc6-45d4-848a-dfcf846b6e1a","exec":["pm.test(\"Successful PUT request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 201, 204]);","});",""],"type":"text/javascript"}}],"id":"69a5dc33-2168-462b-81f7-c55a0c6fa540","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{\n\t\"name\": \"Add your name in the body\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8000/api/Parkings?color=GREEN&parkingLotId=65e72adb1a811501c45afd72","description":"<p>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. <code>id=1</code>).</p>\n<p>A successful PUT request typically returns a <code>200 OK</code>, <code>201 Created</code>, or <code>204 No Content</code> response code.</p>\n","urlObject":{"port":"8000","path":["api","Parkings"],"host":["localhost"],"query":[{"key":"color","value":"GREEN"},{"key":"parkingLotId","value":"65e72adb1a811501c45afd72"}],"variable":[]}},"response":[],"_postman_id":"69a5dc33-2168-462b-81f7-c55a0c6fa540"},{"name":"Left Parking Space","event":[{"listen":"test","script":{"id":"a883e756-4813-4a27-9ca5-f98f6048df13","exec":["pm.test(\"Successful DELETE request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 202, 204]);","});",""],"type":"text/javascript"}}],"id":"37598e37-3691-43bf-942c-e5ba6ab876a5","request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\r\n\r\n\"parkingLotId\": \"65e72adb1a811501c45afd72\",\r\n\"registrationNumber\": \"MH12A1234\"\r\n\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8000/api/Parkings","description":"<p>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. <code>id=1</code>).</p>\n<p>A successful DELETE request typically returns a <code>200 OK</code>, <code>202 Accepted</code>, or <code>204 No Content</code> response code.</p>\n","urlObject":{"port":"8000","path":["api","Parkings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"37598e37-3691-43bf-942c-e5ba6ab876a5"},{"name":"Create Parking Lot","id":"22b547bd-703b-49b1-8ae8-fdf8fc5d9ea2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n\r\n\"id\": \"65e72adb1a811501c45afd72\",\r\n\"capacity\": 10\r\n\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8000/api/ParkingLots","urlObject":{"port":"8000","path":["api","ParkingLots"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"22b547bd-703b-49b1-8ae8-fdf8fc5d9ea2"}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""]}},{"listen":"test","script":{"type":"text/javascript","exec":[""]}}],"variable":[{"id":"c68e3e6b-2bd4-46a6-99cb-cca6ad3041a2","key":"id","value":"1"},{"id":"1d05ebaa-33ad-4e0b-a971-cf01e4574082","key":"base_url","value":"https://postman-rest-api-learner.glitch.me/"}]}