{"info":{"_postman_id":"135d7e6b-23d5-4b45-8faf-16692501aa2f","name":"Rest_Postman","description":"<html><head></head><body><p>REST_API_Demo:<br>This collection is for testing and for Basic Hands-on.<br>There are Two GET methods.</p>\n<ol>\n<li>GET method fetches the complete data of users</li>\n<li>GET method fetches the data of single user.</li>\n<li>POST method to create a new user with id=given.</li>\n<li>PATCH method to modify the user email.</li>\n<li>PUT method to modify the complete user details.</li>\n<li>DELETE method to delete user at id=given.</li>\n<li>POST method to create a new user with id=given.</li>\n</ol>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"18134482","collectionId":"135d7e6b-23d5-4b45-8faf-16692501aa2f","publishedId":"UVC6hRNg","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-11-10T12:17:10.000Z"},"item":[{"name":"User","item":[{"name":"Get_Request","event":[{"listen":"test","script":{"id":"28680a9b-49dd-4396-881e-ad83ca79d158","exec":["pm.test(\"Status code is 200\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Body matches string\", function () {\r","    pm.expect(pm.response.text()).to.include(\"kracine1@dailymotion.com\");\r","});\r","\r",""],"type":"text/javascript"}}],"id":"cbbf6ae9-5f5f-4165-abea-4011383941fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/users","description":"<p>Get all User details.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"cbbf6ae9-5f5f-4165-abea-4011383941fa"},{"name":"Get_Single_User","event":[{"listen":"test","script":{"id":"4754523d-5e4e-4f61-9c85-903007bc5db9","exec":["pm.test(\"Status code is 200\", function () {\r","        pm.response.to.have.status(200);\r","});\r","pm.test(\"Verify First Name \", function () {\r","    pm.expect(pm.response.text()).to.include(\"Harry\");\r","});\r","pm.test(\"Verify the Post Request\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.email).to.eql(\"harry_trevor@mail.com\");\r","});\r",""],"type":"text/javascript"}}],"id":"a136f4f4-99ce-494a-aa12-d30467f8b9ee","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/users/2","description":"<p>Get user details with id=2</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"a136f4f4-99ce-494a-aa12-d30467f8b9ee"},{"name":"Post_Request","event":[{"listen":"test","script":{"id":"9a396458-5416-42c3-ba8d-7d2de088dba8","exec":["pm.test(\"Successful POST request\", function () {\r","    pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r","});\r","\r","pm.test(\"Verify the Post Request\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.first_name).to.eql(\"Harry\");\r","});\r","bodydata = JSON.parse(responseBody)\r","id_val = bodydata.id\r","first_name = bodydata.first_name\r","pm.environment.set(\"id\",id_val);\r","pm.environment.set(\"firstname\", first_name);"],"type":"text/javascript"}}],"id":"f710e17d-6c25-4890-81d6-20afe13021a5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"id\": 11,\r\n    \"first_name\": \"Harry\",\r\n    \"last_name\": \"Trevor\",\r\n    \"email\": \"harry_trevor@mail.com\",\r\n    \"gender\": \"Male\",\r\n    \"departmentId\": 4\r\n  }","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users","description":"<p>POST will create a new user with the given details.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"f710e17d-6c25-4890-81d6-20afe13021a5"},{"name":"Patch_Request","event":[{"listen":"test","script":{"id":"340ced4e-ec9b-40e8-9b9b-40e9ae3602f2","exec":["pm.test(\"Status code is 200\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Verify the User email\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.email).to.eql(\"harry_tre@hogwarts.com\");\r","});"],"type":"text/javascript"}}],"id":"33e1809b-2adc-46ab-ae13-8424edfbb648","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n     \r\n     \"email\": \"harry_tre@hogwarts.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users/11","description":"<p>PATCH will update the email id of the given user</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users","11"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"33e1809b-2adc-46ab-ae13-8424edfbb648"},{"name":"Put_Request","event":[{"listen":"test","script":{"id":"0930965f-26a6-45a9-942c-399be519123b","exec":["pm.test(\"Status code is 200\", function () {\r","    pm.response.to.have.status(200);\r","});\r","\r","pm.test(\"Verifying the PUT Request data\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.email).to.eql(\"ron_wessely@mail.com\");\r","});\r","pm.test(\"Verifying the PUT Request data\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.first_name).to.eql(\"Ron\");\r","});"],"type":"text/javascript"}}],"id":"d60e4ebe-4649-426c-8468-b81d71e16504","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"id\": \"\",\r\n    \"first_name\": \"Ron\",\r\n    \"last_name\": \"Wessley\",\r\n    \"email\": \"ron_wessely@mail.com\",\r\n    \"gender\": \"Male\",\r\n    \"departmentId\": 3\r\n  }","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users/11","description":"<p>PUT will update the complete user details</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users","11"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"d60e4ebe-4649-426c-8468-b81d71e16504"},{"name":"Delete_Request","event":[{"listen":"test","script":{"id":"b6e921d5-0329-4bac-9918-28125076b3bd","exec":["pm.test(\"Status code is 200\", function () {\r","    pm.response.to.have.status(200);\r","});"],"type":"text/javascript"}}],"id":"fddff64c-7157-4477-a899-b50b90298ac6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:3000/users/11","urlObject":{"protocol":"http","port":"3000","path":["users","11"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"fddff64c-7157-4477-a899-b50b90298ac6"},{"name":"Post_Request","event":[{"listen":"test","script":{"id":"e7e74d5f-412e-4f60-90a8-e2ca74d901f1","exec":["pm.test(\"Successful POST request\", function () {\r","    pm.expect(pm.response.code).to.be.oneOf([201, 202]);\r","});\r","\r","pm.test(\"Verify the Post Request\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.first_name).to.eql(\"Tonya\");\r","});\r",""],"type":"text/javascript"}},{"listen":"prerequest","script":{"id":"4f83c4e0-c8b7-43e1-aba2-9ba866b21d82","exec":["\r",""],"type":"text/javascript"}}],"id":"6f978a6b-f9de-4ee9-83b4-3b2546a8594d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"    {\r\n        \"first_name\": \"Tonya\",\r\n    \"last_name\": \"Honnan\",\r\n    \"email\": \"thonnan1@google.com.hk\",\r\n        \"gender\": \"Male\",\r\n        \"departmentId\": 4\r\n    }","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users/","urlObject":{"protocol":"http","port":"3000","path":["users",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"6f978a6b-f9de-4ee9-83b4-3b2546a8594d"}],"id":"22c2fff9-3809-4c37-b76a-de5549bc91cd","description":"<p>User folder has data for all the user as per the db.json file.</p>\n","_postman_id":"22c2fff9-3809-4c37-b76a-de5549bc91cd"},{"name":"Department","item":[{"name":"GET_Department","event":[{"listen":"test","script":{"id":"63e13b12-03cb-435b-b354-74dc4ec88715","exec":["pm.test(\"Status code is 200\", function () {\r","    pm.response.to.have.status(200);\r","});"],"type":"text/javascript"}}],"id":"9d711ceb-ebb8-4b0e-a494-b1eb23515a35","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"http://localhost:3000/department","urlObject":{"protocol":"http","port":"3000","path":["department"],"host":["localhost"],"query":[{"disabled":true,"key":"id","value":"2"}],"variable":[]}},"response":[],"_postman_id":"9d711ceb-ebb8-4b0e-a494-b1eb23515a35"},{"name":"PATCH_Department","event":[{"listen":"test","script":{"id":"bbaa7b0a-6cf3-447e-87bb-bcfa4e7b0718","exec":["pm.test(\"Status code is 200\", function () {\r","    pm.response.to.have.status(200);\r","});\r","pm.test(\"Validate Department Change\", function () {\r","    var jsonData = pm.response.json();\r","    pm.expect(jsonData.department).to.eql(\"IT and Support\");\r","});"],"type":"text/javascript"}}],"id":"4c6f5580-ede8-4f85-9379-02d6cb9f0b10","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"department\": \"IT and Support\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/department/5","urlObject":{"protocol":"http","port":"3000","path":["department","5"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"4c6f5580-ede8-4f85-9379-02d6cb9f0b10"}],"id":"0cc9b2e9-fd29-4207-97e5-7d19b711bd6a","_postman_id":"0cc9b2e9-fd29-4207-97e5-7d19b711bd6a","description":""}],"variable":[{"key":"id","value":""}]}