{ "info": { "_postman_id": "35ea599d-83c0-4cde-8677-adcd55dc4d0f", "name": "SIGN DE V1 - disable one TSS when you have the TSS ID", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "21132140" }, "item": [ { "name": "Authentication - set variables in Pre-request Script", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);\r", "pm.environment.set(\"token\", data.access_token);\r", "\r", "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "// Please add here the correct data", "var apiKey = \"yourApiKey\"", "var apiSecret = \"yourApiSecret\"", "var tssIdToBeDisabled = \"theTssIdYouWantToDisable\"", "", "", "// This code set the variables in the environement for you", "pm.environment.set(\"api_key\", apiKey);", "pm.environment.set(\"api_secret\", apiSecret);", "pm.environment.set(\"tssId\", tssIdToBeDisabled);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "name": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "{\n\t\"api_key\": \"{{api_key}}\",\n\t\"api_secret\": \"{{api_secret}}\"\n}" }, "url": { "raw": "https://kassensichv.io/api/v1/auth", "protocol": "https", "host": [ "kassensichv", "io" ], "path": [ "api", "v1", "auth" ] }, "description": "Authentication" }, "response": [] }, { "name": "Disable TSS", "event": [ { "listen": "test", "script": { "exec": [ "var data = JSON.parse(responseBody);", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{token}}", "type": "string" } ] }, "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n\t\"state\": \"DISABLED\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "https://kassensichv.io/api/v1/tss/{{tssId}}", "protocol": "https", "host": [ "kassensichv", "io" ], "path": [ "api", "v1", "tss", "{{tssId}}" ] } }, "response": [] }, { "name": "Retrieve the TSS to check if the TSS was disabled", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "\r", " var data = JSON.parse(responseBody);\r", "\r", " pm.expect(data.state).to.eql('DISABLED');\r", " \r", "});\r", "" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "auth": { "type": "bearer", "bearer": [ { "key": "token", "value": "{{token}}", "type": "string" } ] }, "method": "GET", "header": [ { "key": "Content-Type", "name": "Content-Type", "type": "text", "value": "application/json" } ], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://kassensichv.io/api/v1/tss/{{tssId}}", "protocol": "https", "host": [ "kassensichv", "io" ], "path": [ "api", "v1", "tss", "{{tssId}}" ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "type": "text/javascript", "exec": [ "" ] } } ] }