{"info":{"_postman_id":"f63a9031-0f70-43ec-a808-2d547eb355b6","name":"Employee-Management-System-RESTful API Basics #blueprint","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":"23129267","collectionId":"f63a9031-0f70-43ec-a808-2d547eb355b6","publishedId":"2s9YsJBCER","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-01-07T13:47:59.000Z"},"item":[{"name":"All Employee","event":[{"listen":"test","script":{"id":"970d099d-4490-4504-969d-1c3012a25604","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript"}}],"id":"03d8a9b5-401d-487d-bb77-eda93e74a5b0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:8000/all_emp","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":{"protocol":"http","port":"8000","path":["all_emp"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"03d8a9b5-401d-487d-bb77-eda93e74a5b0"},{"name":"Add Employee","event":[{"listen":"test","script":{"id":"acbe9c8a-b769-48c0-853e-d55d8a6489e7","exec":["pm.test(\"Successful POST request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 201]);","});",""],"type":"text/javascript"}}],"id":"916eb801-180a-41cf-a6e5-07b8b5f08daa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"X-CSRFToken","value":"TeYQeNAV5k0g78JGC1186WLceL3rCMsz","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"fname","value":"Anant","type":"text"},{"key":"lname","value":"Sharma","type":"text"},{"key":"phoneNo","value":"947849476","type":"text"},{"key":"salary","value":"300000","type":"text"},{"key":"dept","value":"7","type":"text"},{"key":"role","value":"4","type":"text"},{"key":"bonus","value":"7000","type":"text"},{"key":"email","value":"ananat903@gmal.com","type":"text"},{"key":"joinDate","value":"2022-04-01","type":"text"}]},"url":"http://127.0.0.1:8000/add_emp","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":{"protocol":"http","port":"8000","path":["add_emp"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"916eb801-180a-41cf-a6e5-07b8b5f08daa"},{"name":"Remove Employee","event":[{"listen":"test","script":{"id":"54e83c7b-77ba-4557-ba1a-090fb7a6ec84","exec":["pm.test(\"Successful PUT request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 201, 204]);","});",""],"type":"text/javascript"}}],"id":"20e2f30b-eb8c-4c98-9786-0f4395abaa8a","request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\n\t\"name\": \"Add your name in the body\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:8000/remove_emp/2","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":{"protocol":"http","port":"8000","path":["remove_emp","2"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"20e2f30b-eb8c-4c98-9786-0f4395abaa8a"},{"name":"Delete data","event":[{"listen":"test","script":{"id":"0d106b1a-6592-44d1-85a3-c89f57006608","exec":["pm.test(\"Successful DELETE request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 202, 204]);","});",""],"type":"text/javascript"}}],"id":"74653787-89df-4cb9-98aa-3dd3fc9a0758","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"role","value":"4","type":"text"}]},"url":"http://127.0.0.1:8000/filter_emp","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":{"protocol":"http","port":"8000","path":["filter_emp"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"74653787-89df-4cb9-98aa-3dd3fc9a0758"}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""]}},{"listen":"test","script":{"type":"text/javascript","exec":[""]}}],"variable":[{"id":"a4a38b5e-df2d-4f01-be51-a5f9d6610345","key":"id","value":"1"},{"id":"e4bb3950-088d-41c9-a719-9acab94d78b1","key":"base_url","value":"https://postman-rest-api-learner.glitch.me/"}]}