{ "info": { "_postman_id": "a039f478-23de-4977-b204-b166faf48064", "name": "Sample", "description": "This contains a simple set of requests that log in, get configuration information, create a DNC, and then logs out.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "login", "event": [ { "listen": "test", "script": { "id": "bc77d2e3-2950-4695-a60b-a0fa8eac7600", "type": "text/javascript", "exec": [ "pm.test(\"response is ok\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"response should be okay to process\", function () { ", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", "var jsonData = JSON.parse(responseBody);", "", "postman.setEnvironmentVariable(\"SessionID\", jsonData.sessionId);", "postman.setEnvironmentVariable(\"ClientID\", jsonData.clientId);", "" ] } } ], "request": { "method": "POST", "header": [ { "key": "LV-Access", "value": "{{APIToken}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\"clientName\": \"{{ClientName}}\", \"userName\": \"{{UserName}}\", \"password\": \"{{UserPass}}\" }" }, "url": { "raw": "https://{{APIHost}}/session/login", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "session", "login" ] } }, "response": [] }, { "name": "list call centers", "event": [ { "listen": "test", "script": { "id": "2383921e-0cce-40ad-bde8-b5027ad3fe96", "type": "text/javascript", "exec": [ "pm.test(\"response is ok\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"response should be okay to process\", function () { ", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", "var jsonData = JSON.parse(responseBody);", "", "// pick first item", "postman.setEnvironmentVariable(\"CallCenterID\", jsonData.callCenter[0].callCenterId);" ] } } ], "request": { "method": "GET", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" } ], "body": {}, "url": { "raw": "https://{{APIHost}}/configuration/callCenters?count=10&offset=0", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "configuration", "callCenters" ], "query": [ { "key": "count", "value": "10" }, { "key": "offset", "value": "0" } ] } }, "response": [] }, { "name": "list services", "event": [ { "listen": "test", "script": { "id": "6e1d18f0-6588-400b-b499-7bc27ef600da", "type": "text/javascript", "exec": [ "pm.test(\"response is ok\", function () {", " pm.response.to.have.status(200);", "});", "", "pm.test(\"response should be okay to process\", function () { ", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", "var jsonData = JSON.parse(responseBody);", "", "// pick second item", "postman.setEnvironmentVariable(\"ServiceID\", jsonData.service[1].serviceId);" ] } } ], "request": { "method": "GET", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" } ], "body": {}, "url": { "raw": "https://{{APIHost}}/configuration/services?callCenter={{CallCenterID}}&count=3&offset=0", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "configuration", "services" ], "query": [ { "key": "callCenter", "value": "{{CallCenterID}}" }, { "key": "count", "value": "3" }, { "key": "offset", "value": "0" } ] } }, "response": [] }, { "name": "update service name", "event": [ { "listen": "test", "script": { "id": "a3679ec6-9fb9-4d10-ba0a-441079f497dd", "type": "text/javascript", "exec": [ "" ] } } ], "request": { "method": "POST", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{ \"name\": \"Sample\" }" }, "url": { "raw": "https://{{APIHost}}/configuration/services/{{ServiceID}}", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "configuration", "services", "{{ServiceID}}" ] } }, "response": [] }, { "name": "read service", "event": [ { "listen": "test", "script": { "id": "1e801491-893d-40bf-b097-18eb49de5faa", "type": "text/javascript", "exec": [ "" ] } } ], "request": { "method": "GET", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" } ], "body": { "mode": "raw", "raw": "{ \"name\": \"Sample\" }" }, "url": { "raw": "https://{{APIHost}}/configuration/services/{{ServiceID}}", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "configuration", "services", "{{ServiceID}}" ] } }, "response": [] }, { "name": "reset service name", "event": [ { "listen": "test", "script": { "id": "2e5301c8-60ab-48ca-bcd5-1b751e6c5255", "type": "text/javascript", "exec": [ "" ] } } ], "request": { "method": "POST", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{ \"name\": \"AgentReg\" }" }, "url": { "raw": "https://{{APIHost}}/configuration/services/{{ServiceID}}", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "configuration", "services", "{{ServiceID}}" ] } }, "response": [] }, { "name": "create DNC", "event": [ { "listen": "test", "script": { "id": "7e8af121-b3e4-4272-9279-aa9dec2b6ecc", "type": "text/javascript", "exec": [ "pm.test(\"response is ok\", function () {", " pm.response.to.have.status(201);", "});", "", "pm.test(\"response should be okay to process\", function () { ", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", "var jsonData = JSON.parse(responseBody);", "", "//save id", "postman.setEnvironmentVariable(\"DNCID\", jsonData.id)" ] } } ], "request": { "method": "POST", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" }, { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\r\n \"phone\": \"40855501212\"\r\n}" }, "url": { "raw": "https://{{APIHost}}/compliance/dialtime/dnc", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "compliance", "dialtime", "dnc" ] } }, "response": [] }, { "name": "read DNC", "event": [ { "listen": "test", "script": { "id": "58e03edf-a374-4618-abdb-a963d61456ca", "type": "text/javascript", "exec": [ "" ] } } ], "request": { "method": "GET", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"phone\": \"40855501212\"\r\n}" }, "url": { "raw": "https://{{APIHost}}/compliance/dialtime/dnc/{{DNCID}}", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "compliance", "dialtime", "dnc", "{{DNCID}}" ] } }, "response": [] }, { "name": "delete DNC", "event": [ { "listen": "test", "script": { "id": "e3622058-5891-4ffd-8874-5be0b535617d", "type": "text/javascript", "exec": [ "" ] } } ], "request": { "method": "DELETE", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" } ], "body": { "mode": "raw", "raw": "{\r\n \"phone\": \"40855501212\"\r\n}" }, "url": { "raw": "https://{{APIHost}}/compliance/dialtime/dnc/{{DNCID}}", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "compliance", "dialtime", "dnc", "{{DNCID}}" ] } }, "response": [] }, { "name": "logout", "event": [ { "listen": "test", "script": { "id": "2bf56f6d-7586-48c3-9ac0-a4c8b9dee188", "type": "text/javascript", "exec": [ "", "" ] } } ], "request": { "method": "DELETE", "header": [ { "key": "LV-Session", "value": "{{SessionID}}" } ], "body": { "mode": "raw", "raw": "{\"clientName\": \"{{ClientName}}\", \"userName\": \"{{UserName}}\", \"password\": \"{{UserPass}}\" }" }, "url": { "raw": "https://{{APIHost}}/session/logout/{{SessionID}}", "protocol": "https", "host": [ "{{APIHost}}" ], "path": [ "session", "logout", "{{SessionID}}" ] } }, "response": [] } ] }