{"info":{"_postman_id":"8f8104f5-cb58-4844-b672-d7720a3c4958","name":"RESTful API basics:","description":"<html><head></head><body><h1 id=\"get-started-here\">🚀 Get started here</h1>\n<p>This template guides you through CRUD operations (GET, POST, PUT, DELETE), variables, and tests.</p>\n<h2 id=\"🔖-how-to-use-this-template\">🔖 <strong>How to use this template</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 request.</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":"14219981","collectionId":"8f8104f5-cb58-4844-b672-d7720a3c4958","publishedId":"2s9Ykq6feQ","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-12-20T14:58:03.000Z"},"item":[{"name":"Get data","event":[{"listen":"test","script":{"id":"3c5459bc-c94c-46dd-92b5-62e1d9d8216f","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript"}}],"id":"7a55991c-2ba8-474a-9c94-d2c9297821d8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:8081/tutorials/12","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":"8081","path":["tutorials","12"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"7a55991c-2ba8-474a-9c94-d2c9297821d8"},{"name":"Post data","event":[{"listen":"test","script":{"id":"5889b89b-da9a-419c-a203-ba5752cba90a","exec":["pm.test(\"Successful POST request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 201]);","});",""],"type":"text/javascript"}}],"id":"b6e9219b-5469-4688-8846-4b2122a58377","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"title\": \"MySQL\",\n    \"description\": \"Tut #3 Description\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8081/tutorials","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":"8081","path":["tutorials"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"b6e9219b-5469-4688-8846-4b2122a58377"},{"name":"Update data","event":[{"listen":"test","script":{"id":"b157c32b-6f2e-4ae1-998d-50506f9a827e","exec":["pm.test(\"Successful PUT request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 201, 204]);","});",""],"type":"text/javascript"}}],"id":"bcb36154-46f1-47b2-b337-0b3edb1ea8a4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"description\": \"Tut #2 Description\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8081/tutorials/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":{"port":"8081","path":["tutorials","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"bcb36154-46f1-47b2-b337-0b3edb1ea8a4"},{"name":"Delete data","event":[{"listen":"test","script":{"id":"3cce7232-df11-44ec-b17e-b94133d81d26","exec":["pm.test(\"Successful DELETE request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 202, 204]);","});",""],"type":"text/javascript"}}],"id":"6a6cac59-a289-47a7-b60b-99a4f65f6f69","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"localhost:8081/tutorials/52","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":"8081","path":["tutorials","52"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"6a6cac59-a289-47a7-b60b-99a4f65f6f69"},{"name":"Get All Data","id":"6ba55f33-e4b2-4efb-8e9c-de834a9caa8c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:8081/tutorials","urlObject":{"port":"8081","path":["tutorials"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"6ba55f33-e4b2-4efb-8e9c-de834a9caa8c"},{"name":"Get Published","id":"e58e9ea3-3e82-4e93-9450-2d52a48c2c67","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:8081/tutorials/published","urlObject":{"port":"8081","path":["tutorials","published"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"e58e9ea3-3e82-4e93-9450-2d52a48c2c67"},{"name":"Get By Title Keyword","id":"f63be961-c441-4b94-be9d-f33420210915","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:8081/tutorials?title=tutorial","urlObject":{"port":"8081","path":["tutorials"],"host":["localhost"],"query":[{"key":"title","value":"tutorial"}],"variable":[]}},"response":[],"_postman_id":"f63be961-c441-4b94-be9d-f33420210915"},{"name":"Delete All","id":"768b76b9-8044-4842-b378-fa601817d53d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"localhost:8081/tutorials","urlObject":{"port":"8081","path":["tutorials"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"768b76b9-8044-4842-b378-fa601817d53d"}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""]}},{"listen":"test","script":{"type":"text/javascript","exec":[""]}}],"variable":[{"id":"cf5134dc-c11c-47ce-a12d-f8c43c3a7255","key":"id","value":"1"},{"id":"de87d5ec-53e3-4065-bbea-d34d786d16a4","key":"base_url","value":"https://postman-rest-api-learner.glitch.me/"}]}