api_doc_collection.json
{ "variables": [], "info": { "name": "API DocTests via sweeter", "_postman_id": "1ea2622f-899e-be8f-7e99-2a08267eb0a6", "description": "Integration test suite automatically generated from api documentation.", "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json" }, "item": [ { "name": "Agent", "description": "", "item": [ { "name": "CountAgent", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Number of Agents in the specified Callqueue.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agent&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Agents in a Callqueue", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countagent_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{countagent_queue}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{countagent_device}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateAgent", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agent&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create an Agent in a Callqueue", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createagent_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{createagent_queue}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{createagent_device}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteAgent", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agent&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete Agents in a Callqueue", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deleteagent_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{deleteagent_queue}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{deleteagent_device}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadAgent", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"device_aor\": {\n \"type\": \"string\",\n \"description\": \"<p>Device used by Agent<\\\/p>\"\n },\n \"huntgroup_name\": {\n \"type\": \"string\",\n \"description\": \"<p>huntgroup\\\/callqueue name for the agent<\\\/p>\"\n },\n \"huntgroup_domain\": {\n \"type\": \"string\",\n \"description\": \"<p>domain for the agent<\\\/p>\"\n },\n \"entry_option\": {\n \"type\": \"string\",\n \"description\": \"<p>Login status for the agent<\\\/p>\"\n },\n \"wrap_up_sec\": {\n \"type\": \"string\",\n \"description\": \"<p>Wrap-up time for Agent in seconds.<\\\/p>\"\n },\n \"auto_ans\": {\n \"type\": \"string\",\n \"description\": \"<p>Specifies whether or not an Agent auto answers.<\\\/p>\"\n },\n \"entry_order\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"entry_priority\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"call_limit\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"confirm_required\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"entry_device\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"entry_status\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"owner_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"owner_domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"session_count\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"error_info\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"last_update\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"device\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"stat\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"sub_firstname\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"sub_lastname\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"sub_login\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"sub_fullname\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['agent'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agent&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Agents in a Callqueue", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readagent_domain}}", "enabled": true }, { "key": "queue_name", "type": "text", "value": "{{readagent_queue_name}}", "enabled": true }, { "key": "queue_list", "type": "text", "value": "{{readagent_queue_list}}", "enabled": false }, { "key": "device", "type": "text", "value": "{{readagent_device}}", "enabled": false }, { "key": "period", "type": "text", "value": "{{readagent_period}}", "enabled": false }, { "key": "stats", "type": "text", "value": "{{readagent_stats}}", "enabled": false }, { "key": "start_date", "type": "text", "value": "{{readagent_start_date}}", "enabled": false }, { "key": "end_date", "type": "text", "value": "{{readagent_end_date}}", "enabled": false }, { "key": "range_interval", "type": "text", "value": "{{readagent_range_interval}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateAgent", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agent&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update Agents in a Callqueue", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updateagent_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{updateagent_queue}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{updateagent_device}}", "enabled": true }, { "key": "huntgroup_name", "type": "text", "value": "{{updateagent_huntgroup_name}}", "enabled": true }, { "key": "huntgroup_domain", "type": "text", "value": "{{updateagent_huntgroup_domain}}", "enabled": true }, { "key": "entry_option", "type": "text", "value": "{{updateagent_entry_option}}", "enabled": true }, { "key": "wrap_up_sec", "type": "text", "value": "{{updateagent_wrap_up_sec}}", "enabled": true }, { "key": "auto_ans", "type": "text", "value": "{{updateagent_auto_ans}}", "enabled": true }, { "key": "entry_order", "type": "text", "value": "{{updateagent_entry_order}}", "enabled": true }, { "key": "entry_priority", "type": "text", "value": "{{updateagent_entry_priority}}", "enabled": true }, { "key": "call_limit", "type": "text", "value": "{{updateagent_call_limit}}", "enabled": true }, { "key": "confirm_required", "type": "text", "value": "{{updateagent_confirm_required}}", "enabled": true }, { "key": "entry_device", "type": "text", "value": "{{updateagent_entry_device}}", "enabled": true }, { "key": "entry_status", "type": "text", "value": "{{updateagent_entry_status}}", "enabled": true }, { "key": "owner_user", "type": "text", "value": "{{updateagent_owner_user}}", "enabled": true }, { "key": "owner_domain", "type": "text", "value": "{{updateagent_owner_domain}}", "enabled": true }, { "key": "session_count", "type": "text", "value": "{{updateagent_session_count}}", "enabled": true }, { "key": "error_info", "type": "text", "value": "{{updateagent_error_info}}", "enabled": true }, { "key": "last_update", "type": "text", "value": "{{updateagent_last_update}}", "enabled": true }, { "key": "stat", "type": "text", "value": "{{updateagent_stat}}", "enabled": true }, { "key": "sub_firstname", "type": "text", "value": "{{updateagent_sub_firstname}}", "enabled": true }, { "key": "sub_lastname", "type": "text", "value": "{{updateagent_sub_lastname}}", "enabled": true }, { "key": "sub_login", "type": "text", "value": "{{updateagent_sub_login}}", "enabled": true }, { "key": "sub_fullname", "type": "text", "value": "{{updateagent_sub_fullname}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateStatusAgent", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agent&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Change status of Agent in a Callqueue", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatestatusagent_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{updatestatusagent_queue}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{updatestatusagent_device}}", "enabled": true }, { "key": "entry_action", "type": "text", "value": "{{updatestatusagent_entry_action}}", "enabled": true }, { "key": "entry_option", "type": "text", "value": "{{updatestatusagent_entry_option}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Agent_Log", "description": "", "item": [ { "name": "CreateAgent_Log", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agentlog&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create an Agentlog", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "agent", "type": "text", "value": "{{createagent_log_agent}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{createagent_log_user}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createagent_log_domain}}", "enabled": true }, { "key": "mode", "type": "text", "value": "{{createagent_log_mode}}", "enabled": true }, { "key": "loggedin_sec", "type": "text", "value": "{{createagent_log_loggedin_sec}}", "enabled": false }, { "key": "available_sec", "type": "text", "value": "{{createagent_log_available_sec}}", "enabled": false }, { "key": "unavailable_sec", "type": "text", "value": "{{createagent_log_unavailable_sec}}", "enabled": false }, { "key": "break_sec", "type": "text", "value": "{{createagent_log_break_sec}}", "enabled": false }, { "key": "lunch_sec", "type": "text", "value": "{{createagent_log_lunch_sec}}", "enabled": false }, { "key": "meeting_sec", "type": "text", "value": "{{createagent_log_meeting_sec}}", "enabled": false }, { "key": "other_sec", "type": "text", "value": "{{createagent_log_other_sec}}", "enabled": false }, { "key": "acw_sec", "type": "text", "value": "{{createagent_log_acw_sec}}", "enabled": false }, { "key": "web_sec", "type": "text", "value": "{{createagent_log_web_sec}}", "enabled": false }, { "key": "timestamp", "type": "text", "value": "{{createagent_log_timestamp}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadAgent_Log", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"agent\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"timestamp\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"mode\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"loggedin_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"available_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"unavailable_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"break_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"lunch_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"meeting_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"other_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"acw_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"web_sec\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['agent_log'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agentlog&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Agent Logs in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{readagent_log_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readagent_log_domain}}", "enabled": true }, { "key": "find", "type": "text", "value": "{{readagent_log_find}}", "enabled": false }, { "key": "select", "type": "text", "value": "{{readagent_log_select}}", "enabled": false }, { "key": "queue_list", "type": "text", "value": "{{readagent_log_queue_list}}", "enabled": false }, { "key": "queue_name", "type": "text", "value": "{{readagent_log_queue_name}}", "enabled": false }, { "key": "start_date", "type": "text", "value": "{{readagent_log_start_date}}", "enabled": false }, { "key": "end_date", "type": "text", "value": "{{readagent_log_end_date}}", "enabled": false }, { "key": "range_interval", "type": "text", "value": "{{readagent_log_range_interval}}", "enabled": false }, { "key": "agent", "type": "text", "value": "{{readagent_log_agent}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{readagent_log_user}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readagent_log_start}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readagent_log_limit}}", "enabled": false }, { "key": "period", "type": "text", "value": "{{readagent_log_period}}", "enabled": false }, { "key": "department", "type": "text", "value": "{{readagent_log_department}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Answer_Rule", "description": "", "item": [ { "name": "CountAnswer_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of AnswerRules in the specified domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=answerrule&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count AnswerRules", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{countanswer_rule_uid}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countanswer_rule_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{countanswer_rule_user}}", "enabled": false }, { "key": "time_frame", "type": "text", "value": "{{countanswer_rule_time_frame}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateAnswer_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=answerrule&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create an AnswerRule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "time_frame", "type": "text", "value": "{{createanswer_rule_time_frame}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{createanswer_rule_uid}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{createanswer_rule_user}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{createanswer_rule_domain}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteAnswer_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=answerrule&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete an AnswerRule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "time_frame", "type": "text", "value": "{{deleteanswer_rule_time_frame}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{deleteanswer_rule_uid}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{deleteanswer_rule_user}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{deleteanswer_rule_domain}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadAnswer_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"subscriber_login\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"pwd\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"pwd_hash\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"group\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dir\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"presence\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"message\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_provisioned\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_enabled\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_greeting\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_notify\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_annc_time\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_annc_cid\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_sort_lifo\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_transcribe\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"data_limit\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"call_limit\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dial_plan\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dial_policy\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"area_code\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"callid_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"callid_nmbr\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"callid_emgr\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"no_answer_timeout\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_zone\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dir_anc\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dir_list\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"date_created\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"scope\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rej_anony\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"directory_order\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"screen\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"srv_code\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"ntfy_missed_call\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"ntfy_data_limit\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"language\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gauSession\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"last_update\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['answer_rule'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=answerrule&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read a User's AnswerRules", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{readanswer_rule_uid}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{readanswer_rule_user}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readanswer_rule_domain}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readanswer_rule_limit}}", "enabled": false }, { "key": "time_frame", "type": "text", "value": "{{readanswer_rule_time_frame}}", "enabled": false }, { "key": "caller_match", "type": "text", "value": "{{readanswer_rule_caller_match}}", "enabled": false }, { "key": "for_numbers", "type": "text", "value": "{{readanswer_rule_for_numbers}}", "enabled": false }, { "key": "fna_numbers", "type": "text", "value": "{{readanswer_rule_fna_numbers}}", "enabled": false } ] } }, "response": [] }, { "name": "ReorderAnswer_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['answer_rule'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=answerrule&action=reorder", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Reorder AnswerRule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{reorderanswer_rule_uid}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{reorderanswer_rule_user}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{reorderanswer_rule_domain}}", "enabled": true }, { "key": "priority", "type": "text", "value": "{{reorderanswer_rule_priority}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateAnswer_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=answerrule&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update an AnswerRule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "time_frame", "type": "text", "value": "{{updateanswer_rule_time_frame}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{updateanswer_rule_uid}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updateanswer_rule_user}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{updateanswer_rule_domain}}", "enabled": false }, { "key": "rej_parameters", "type": "text", "value": "{{updateanswer_rule_rej_parameters}}", "enabled": false }, { "key": "rej_control", "type": "text", "value": "{{updateanswer_rule_rej_control}}", "enabled": false }, { "key": "acp_parameters", "type": "text", "value": "{{updateanswer_rule_acp_parameters}}", "enabled": false }, { "key": "acp_control", "type": "text", "value": "{{updateanswer_rule_acp_control}}", "enabled": false }, { "key": "deletesok", "type": "text", "value": "{{updateanswer_rule_deletesok}}", "enabled": false }, { "key": "enable", "type": "text", "value": "{{updateanswer_rule_enable}}", "enabled": false }, { "key": "order", "type": "text", "value": "{{updateanswer_rule_order}}", "enabled": false }, { "key": "first_name", "type": "text", "value": "{{updateanswer_rule_first_name}}", "enabled": false }, { "key": "last_name", "type": "text", "value": "{{updateanswer_rule_last_name}}", "enabled": false }, { "key": "subscriber_login", "type": "text", "value": "{{updateanswer_rule_subscriber_login}}", "enabled": false }, { "key": "pwd", "type": "text", "value": "{{updateanswer_rule_pwd}}", "enabled": false }, { "key": "pwd_hash", "type": "text", "value": "{{updateanswer_rule_pwd_hash}}", "enabled": false }, { "key": "group", "type": "text", "value": "{{updateanswer_rule_group}}", "enabled": false }, { "key": "dir", "type": "text", "value": "{{updateanswer_rule_dir}}", "enabled": false }, { "key": "email", "type": "text", "value": "{{updateanswer_rule_email}}", "enabled": false }, { "key": "presence", "type": "text", "value": "{{updateanswer_rule_presence}}", "enabled": false }, { "key": "message", "type": "text", "value": "{{updateanswer_rule_message}}", "enabled": false }, { "key": "vmail_provisioned", "type": "text", "value": "{{updateanswer_rule_vmail_provisioned}}", "enabled": false }, { "key": "vmail_enabled", "type": "text", "value": "{{updateanswer_rule_vmail_enabled}}", "enabled": false }, { "key": "vmail_greeting", "type": "text", "value": "{{updateanswer_rule_vmail_greeting}}", "enabled": false }, { "key": "vmail_notify", "type": "text", "value": "{{updateanswer_rule_vmail_notify}}", "enabled": false }, { "key": "vmail_annc_time", "type": "text", "value": "{{updateanswer_rule_vmail_annc_time}}", "enabled": false }, { "key": "vmail_annc_cid", "type": "text", "value": "{{updateanswer_rule_vmail_annc_cid}}", "enabled": false }, { "key": "vmail_sort_lifo", "type": "text", "value": "{{updateanswer_rule_vmail_sort_lifo}}", "enabled": false }, { "key": "vmail_transcribe", "type": "text", "value": "{{updateanswer_rule_vmail_transcribe}}", "enabled": false }, { "key": "data_limit", "type": "text", "value": "{{updateanswer_rule_data_limit}}", "enabled": false }, { "key": "call_limit", "type": "text", "value": "{{updateanswer_rule_call_limit}}", "enabled": false }, { "key": "dial_plan", "type": "text", "value": "{{updateanswer_rule_dial_plan}}", "enabled": false }, { "key": "dial_policy", "type": "text", "value": "{{updateanswer_rule_dial_policy}}", "enabled": false }, { "key": "area_code", "type": "text", "value": "{{updateanswer_rule_area_code}}", "enabled": false }, { "key": "callid_name", "type": "text", "value": "{{updateanswer_rule_callid_name}}", "enabled": false }, { "key": "callid_nmbr", "type": "text", "value": "{{updateanswer_rule_callid_nmbr}}", "enabled": false }, { "key": "callid_emgr", "type": "text", "value": "{{updateanswer_rule_callid_emgr}}", "enabled": false }, { "key": "no_answer_timeout", "type": "text", "value": "{{updateanswer_rule_no_answer_timeout}}", "enabled": false }, { "key": "time_zone", "type": "text", "value": "{{updateanswer_rule_time_zone}}", "enabled": false }, { "key": "dir_anc", "type": "text", "value": "{{updateanswer_rule_dir_anc}}", "enabled": false }, { "key": "dir_list", "type": "text", "value": "{{updateanswer_rule_dir_list}}", "enabled": false }, { "key": "date_created", "type": "text", "value": "{{updateanswer_rule_date_created}}", "enabled": false }, { "key": "scope", "type": "text", "value": "{{updateanswer_rule_scope}}", "enabled": false }, { "key": "rej_anony", "type": "text", "value": "{{updateanswer_rule_rej_anony}}", "enabled": false }, { "key": "directory_order", "type": "text", "value": "{{updateanswer_rule_directory_order}}", "enabled": false }, { "key": "screen", "type": "text", "value": "{{updateanswer_rule_screen}}", "enabled": false }, { "key": "srv_code", "type": "text", "value": "{{updateanswer_rule_srv_code}}", "enabled": false }, { "key": "ntfy_missed_call", "type": "text", "value": "{{updateanswer_rule_ntfy_missed_call}}", "enabled": false }, { "key": "ntfy_data_limit", "type": "text", "value": "{{updateanswer_rule_ntfy_data_limit}}", "enabled": false }, { "key": "language", "type": "text", "value": "{{updateanswer_rule_language}}", "enabled": false }, { "key": "gauSession", "type": "text", "value": "{{updateanswer_rule_gauSession}}", "enabled": false }, { "key": "last_update", "type": "text", "value": "{{updateanswer_rule_last_update}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Audio", "description": "", "item": [ { "name": "CountAudio", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Audio files in the specified Domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=audio&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Audio files in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countaudio_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{countaudio_user}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{countaudio_type}}", "enabled": false }, { "key": "index", "type": "text", "value": "{{countaudio_index}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteAudio", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=audio&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete an Audio File", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "owner_domain", "type": "text", "value": "{{deleteaudio_owner_domain}}", "enabled": true }, { "key": "index", "type": "text", "value": "{{deleteaudio_index}}", "enabled": true }, { "key": "owner", "type": "text", "value": "{{deleteaudio_owner}}", "enabled": false }, { "key": "type", "type": "text", "value": "{{deleteaudio_type}}", "enabled": false } ] } }, "response": [] }, { "name": "PlayAudio", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['audio'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=audio&action=play", "method": "get", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Play\/Download Audio files", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{playaudio_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{playaudio_user}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{playaudio_type}}", "enabled": true }, { "key": "file", "type": "text", "value": "{{playaudio_file}}", "enabled": false }, { "key": "index", "type": "text", "value": "{{playaudio_index}}", "enabled": false }, { "key": "time", "type": "text", "value": "{{playaudio_time}}", "enabled": true }, { "key": "auth", "type": "text", "value": "{{playaudio_auth}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadAudio", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['audio'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=audio&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Audio files in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readaudio_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{readaudio_user}}", "enabled": false }, { "key": "index", "type": "text", "value": "{{readaudio_index}}", "enabled": false }, { "key": "type", "type": "text", "value": "{{readaudio_type}}", "enabled": false }, { "key": "directurl", "type": "text", "value": "{{readaudio_directurl}}", "enabled": false }, { "key": "fax", "type": "text", "value": "{{readaudio_fax}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateAudio", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=audio&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update an Audio file", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "owner_domain", "type": "text", "value": "{{updateaudio_owner_domain}}", "enabled": true }, { "key": "index", "type": "text", "value": "{{updateaudio_index}}", "enabled": true }, { "key": "owner", "type": "text", "value": "{{updateaudio_owner}}", "enabled": false }, { "key": "type", "type": "text", "value": "{{updateaudio_type}}", "enabled": false }, { "key": "script", "type": "text", "value": "{{updateaudio_script}}", "enabled": false }, { "key": "forward", "type": "text", "value": "{{updateaudio_forward}}", "enabled": false } ] } }, "response": [] }, { "name": "UploadAudio", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['audio'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=audio&action=upload", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Upload one Audio file", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "owner_domain", "type": "text", "value": "{{uploadaudio_owner_domain}}", "enabled": true }, { "key": "owner", "type": "text", "value": "{{uploadaudio_owner}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{uploadaudio_type}}", "enabled": false }, { "key": "script", "type": "text", "value": "{{uploadaudio_script}}", "enabled": true }, { "key": "file", "type": "text", "value": "{{uploadaudio_file}}", "enabled": true }, { "key": "index", "type": "text", "value": "{{uploadaudio_index}}", "enabled": true }, { "key": "time", "type": "text", "value": "{{uploadaudio_time}}", "enabled": false }, { "key": "convert", "type": "text", "value": "{{uploadaudio_convert}}", "enabled": false }, { "key": "FromName", "type": "text", "value": "{{uploadaudio_FromName}}", "enabled": false }, { "key": "NmsAni", "type": "text", "value": "{{uploadaudio_NmsAni}}", "enabled": false }, { "key": "NmsRecDuration", "type": "text", "value": "{{uploadaudio_NmsRecDuration}}", "enabled": false }, { "key": "RecordTime", "type": "text", "value": "{{uploadaudio_RecordTime}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "CDR2", "description": "", "item": [ { "name": "CountByDomainCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of calls<\\\/p>\"\n },\n \"minutes\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of minutes<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "count CDR by Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "cdr_id", "type": "text", "value": "{{countbydomaincdr2_cdr_id}}", "enabled": false }, { "key": "start_date", "type": "text", "value": "{{countbydomaincdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{countbydomaincdr2_end_date}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countbydomaincdr2_domain}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{countbydomaincdr2_limit}}", "enabled": false } ] } }, "response": [] }, { "name": "CountByGroupCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of calls<\\\/p>\"\n },\n \"minutes\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of minutes<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "count CDR by Group", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{countbygroupcdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{countbygroupcdr2_end_date}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{countbygroupcdr2_limit}}", "enabled": false }, { "key": "orig_from_uri", "type": "text", "value": "{{countbygroupcdr2_orig_from_uri}}", "enabled": true }, { "key": "orig_to_user", "type": "text", "value": "{{countbygroupcdr2_orig_to_user}}", "enabled": false }, { "key": "group", "type": "text", "value": "{{countbygroupcdr2_group}}", "enabled": false } ] } }, "response": [] }, { "name": "CountByTerritoryCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of calls<\\\/p>\"\n },\n \"minutes\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of minutes<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "count CDR by Territory", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{countbyterritorycdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{countbyterritorycdr2_end_date}}", "enabled": true }, { "key": "territory", "type": "text", "value": "{{countbyterritorycdr2_territory}}", "enabled": true }, { "key": "cdr_id", "type": "text", "value": "{{countbyterritorycdr2_cdr_id}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{countbyterritorycdr2_limit}}", "enabled": false } ] } }, "response": [] }, { "name": "CountByUserCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of calls<\\\/p>\"\n },\n \"minutes\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of minutes<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "count CDR by User", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{countbyusercdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{countbyusercdr2_end_date}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{countbyusercdr2_limit}}", "enabled": false }, { "key": "uid", "type": "text", "value": "{{countbyusercdr2_uid}}", "enabled": true }, { "key": "name", "type": "text", "value": "{{countbyusercdr2_name}}", "enabled": false }, { "key": "number", "type": "text", "value": "{{countbyusercdr2_number}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadByDomainCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>The domain owning the cdr.<\\\/p>\"\n },\n \"territory\": {\n \"type\": \"string\",\n \"description\": \"<p>The Territory\\\/Reseller that the domain belongs to.<\\\/p>\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"<p>type 0=Outbound, 1=Inbound, 2=Missed, 3=On-net<\\\/p>\"\n },\n \"cdr_id\": {\n \"type\": \"string\",\n \"description\": \"<p>The unique ID that links back to the full CDR.<\\\/p>\"\n },\n \"orig_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the orig side of the call. May by null for inbound calls<\\\/p>\"\n },\n \"orig_from_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The callerid for the call.<\\\/p>\"\n },\n \"orig_from_name\": {\n \"type\": \"string\",\n \"description\": \"<p>The callerid name for the call.<\\\/p>\"\n },\n \"orig_req_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The dialed number (sip uri) for the call. Should be available both inbound and outbound<\\\/p>\"\n },\n \"orig_req_user\": {\n \"type\": \"string\",\n \"description\": \"<p>The dialed number just user for the call. Should be available both inbound and outbound<\\\/p>\"\n },\n \"by_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the by side of the call. May by null for calls without a transfer or user feature applied.<\\\/p>\"\n },\n \"term_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the term side of the call. May by null for outbound calls<\\\/p>\"\n },\n \"term_to_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The connected termination device or number in full sip uri format<\\\/p>\"\n },\n \"time_start\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the start time of the call in GMT<\\\/p>\"\n },\n \"time_answer\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the answer time of the call in GMT<\\\/p>\"\n },\n \"time_release\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the end time of the call in GMT<\\\/p>\"\n },\n \"duration\": {\n \"type\": \"string\",\n \"description\": \"<p>The duration of the call in seconds<\\\/p>\"\n },\n \"time_talking\": {\n \"type\": \"string\",\n \"description\": \"<p>The duration of the call in seconds that was in talking state.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read CDR by Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "cdr_id", "type": "text", "value": "{{readbydomaincdr2_cdr_id}}", "enabled": false }, { "key": "start_date", "type": "text", "value": "{{readbydomaincdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readbydomaincdr2_end_date}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readbydomaincdr2_domain}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{readbydomaincdr2_limit}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadByGroupCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>The domain owning the cdr.<\\\/p>\"\n },\n \"grp\": {\n \"type\": \"string\",\n \"description\": \"<p>The group name that owns the call.<\\\/p>\"\n },\n \"grp_type\": {\n \"type\": \"number\",\n \"description\": \"<p>0=department 1=Site<\\\/p>\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"<p>type 0=Outbound, 1=Inbound, 2=Missed, 3=On-net<\\\/p>\"\n },\n \"cdr_id\": {\n \"type\": \"string\",\n \"description\": \"<p>The unique ID that links back to the full CDR.<\\\/p>\"\n },\n \"orig_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the orig side of the call. May by null for inbound calls<\\\/p>\"\n },\n \"orig_from_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The callerid for the call.<\\\/p>\"\n },\n \"orig_from_name\": {\n \"type\": \"string\",\n \"description\": \"<p>The callerid name for the call.<\\\/p>\"\n },\n \"orig_req_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The dialed number (sip uri) for the call. Should be available both inbound and outbound<\\\/p>\"\n },\n \"orig_req_user\": {\n \"type\": \"string\",\n \"description\": \"<p>The dialed number just user for the call. Should be available both inbound and outbound<\\\/p>\"\n },\n \"by_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the by side of the call. May by null for calls without a transfer or user feature applied.<\\\/p>\"\n },\n \"term_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the term side of the call. May by null for outbound calls<\\\/p>\"\n },\n \"term_to_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The connected termination device or number in full sip uri format<\\\/p>\"\n },\n \"time_start\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the start time of the call in GMT<\\\/p>\"\n },\n \"time_answer\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the answer time of the call in GMT<\\\/p>\"\n },\n \"time_release\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the end time of the call in GMT<\\\/p>\"\n },\n \"duration\": {\n \"type\": \"string\",\n \"description\": \"<p>The duration of the call in seconds<\\\/p>\"\n },\n \"time_talking\": {\n \"type\": \"string\",\n \"description\": \"<p>The duration of the call in seconds that was in talking state.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read CDR by Group", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readbygroupcdr2_domain}}", "enabled": true }, { "key": "group", "type": "text", "value": "{{readbygroupcdr2_group}}", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{readbygroupcdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readbygroupcdr2_end_date}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{readbygroupcdr2_limit}}", "enabled": false }, { "key": "orig_from_uri", "type": "text", "value": "{{readbygroupcdr2_orig_from_uri}}", "enabled": true }, { "key": "orig_to_user", "type": "text", "value": "{{readbygroupcdr2_orig_to_user}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadByIdCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"id\": {\n \"type\": \"number\",\n \"description\": \"\"\n },\n \"hostname\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"mac\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"cdr_index\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_callid\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_ip\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_match\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_sub\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_group\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_from_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_from_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_from_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_from_host\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_req_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_req_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_req_host\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_to_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_to_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_to_host\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_action\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_sub\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_group\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_callid\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_callid\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_ip\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_match\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_sub\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_to_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_group\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_start\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_ringing\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_answer\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_release\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_talking\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_holding\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"duration\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_insert\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_disp\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"release_code\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"release_text\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"codec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rly_prt_0\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rly_prt_a\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rly_prt_b\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rly_cnt_a\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rly_cnt_b\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"image_codec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"image_prt_0\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"image_prt_a\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"image_prt_b\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"image_cnt_a\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"video_codec\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"video_prt_0\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"image_cnt_b\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"video_prt_a\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"video_prt_b\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"video_cnt_a\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"video_cnt_b\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"disp_type\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"disposition\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"notes\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"pac\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_logi_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_logi_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"batch_tim_beg\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"batch_tim_ans\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"batch_dura\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"batch_hold\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_id\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_id\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"route_to\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_id\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_territory\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_site\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_site\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"by_territory\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_territory\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"term_site\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read CDR by ID", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{readbyidcdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readbyidcdr2_end_date}}", "enabled": true }, { "key": "id", "type": "text", "value": "{{readbyidcdr2_id}}", "enabled": true }, { "key": "hostname", "type": "text", "value": "{{readbyidcdr2_hostname}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readbyidcdr2_limit}}", "enabled": false }, { "key": "orig_callid", "type": "text", "value": "{{readbyidcdr2_orig_callid}}", "enabled": false }, { "key": "term_callid", "type": "text", "value": "{{readbyidcdr2_term_callid}}", "enabled": false }, { "key": "time_release", "type": "text", "value": "{{readbyidcdr2_time_release}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadByTerritoryCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>The domain owning the cdr.<\\\/p>\"\n },\n \"territory\": {\n \"type\": \"string\",\n \"description\": \"<p>The Territory\\\/Reseller that the domain belongs to.<\\\/p>\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"<p>type 0=Outbound, 1=Inbound, 2=Missed, 3=On-net<\\\/p>\"\n },\n \"cdr_id\": {\n \"type\": \"string\",\n \"description\": \"<p>The unique ID that links back to the full CDR.<\\\/p>\"\n },\n \"orig_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the orig side of the call. May by null for inbound calls<\\\/p>\"\n },\n \"orig_from_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The callerid for the call.<\\\/p>\"\n },\n \"orig_from_name\": {\n \"type\": \"string\",\n \"description\": \"<p>The callerid name for the call.<\\\/p>\"\n },\n \"orig_req_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The dialed number (sip uri) for the call. Should be available both inbound and outbound<\\\/p>\"\n },\n \"orig_req_user\": {\n \"type\": \"string\",\n \"description\": \"<p>The dialed number just user for the call. Should be available both inbound and outbound<\\\/p>\"\n },\n \"by_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the by side of the call. May by null for calls without a transfer or user feature applied.<\\\/p>\"\n },\n \"term_sub\": {\n \"type\": \"string\",\n \"description\": \"<p>The user extension for the term side of the call. May by null for outbound calls<\\\/p>\"\n },\n \"term_to_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The connected termination device or number in full sip uri format<\\\/p>\"\n },\n \"time_start\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the start time of the call in GMT<\\\/p>\"\n },\n \"time_answer\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the answer time of the call in GMT<\\\/p>\"\n },\n \"time_release\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the end time of the call in GMT<\\\/p>\"\n },\n \"duration\": {\n \"type\": \"string\",\n \"description\": \"<p>The duration of the call in seconds<\\\/p>\"\n },\n \"time_talking\": {\n \"type\": \"string\",\n \"description\": \"<p>The duration of the call in seconds that was in talking state.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read CDR by Territory", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "cdr_id", "type": "text", "value": "{{readbyterritorycdr2_cdr_id}}", "enabled": false }, { "key": "start_date", "type": "text", "value": "{{readbyterritorycdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readbyterritorycdr2_end_date}}", "enabled": true }, { "key": "territory", "type": "text", "value": "{{readbyterritorycdr2_territory}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{readbyterritorycdr2_limit}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadByUserCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"uid\": {\n \"type\": \"string\",\n \"description\": \"<p>The UID (user id) owning the call.<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>The domain the user belongs to.<\\\/p>\"\n },\n \"cdr_id\": {\n \"type\": \"string\",\n \"description\": \"<p>The unique ID that links back to the full CDR.<\\\/p>\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"<p>0=Outbound, 1=Inbound, 2=Missed<\\\/p>\"\n },\n \"time_start\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the start time of the call in GMT<\\\/p>\"\n },\n \"time_answer\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the answer time of the call in GMT<\\\/p>\"\n },\n \"time_release\": {\n \"type\": \"string\",\n \"description\": \"<p>Unixtimestamp\\\/epoch for the end time of the call in GMT<\\\/p>\"\n },\n \"duration\": {\n \"type\": \"string\",\n \"description\": \"<p>The duration of the call in seconds<\\\/p>\"\n },\n \"orig_to_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>The dialled number for the call<\\\/p>\"\n },\n \"number\": {\n \"type\": \"string\",\n \"description\": \"<p>The remote number for the call<\\\/p>\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"<p>The remote name\\\/cname for the call.<\\\/p>\"\n },\n \"onnet\": {\n \"type\": \"string\",\n \"description\": \"<p>1=is onnet (inter domain), 0=offnet call<\\\/p>\"\n },\n \"The\": {\n \"type\": \"string\",\n \"description\": \"<p>default will be to hide cdrs like click to call legs, set to &quot;1&quot; to show.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read CDR by User", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{readbyusercdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readbyusercdr2_end_date}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{readbyusercdr2_limit}}", "enabled": false }, { "key": "uid", "type": "text", "value": "{{readbyusercdr2_uid}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{readbyusercdr2_type}}", "enabled": false }, { "key": "showhidden", "type": "text", "value": "{{readbyusercdr2_showhidden}}", "enabled": false } ] } }, "response": [] }, { "name": "ReportByDomainCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"Total\": {\n \"type\": \"string\",\n \"description\": \"<p>number of CDRs in the specified query.<\\\/p>\"\n },\n \"OnNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OnNet calls.<\\\/p>\"\n },\n \"OffNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OffNet calls.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=report", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Report CDRs by Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{reportbydomaincdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{reportbydomaincdr2_end_date}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{reportbydomaincdr2_domain}}", "enabled": true }, { "key": "report_by", "type": "text", "value": "{{reportbydomaincdr2_report_by}}", "enabled": false } ] } }, "response": [] }, { "name": "ReportByGroupCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"Total\": {\n \"type\": \"string\",\n \"description\": \"<p>number of CDRs in the specified query.<\\\/p>\"\n },\n \"OnNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OnNet calls.<\\\/p>\"\n },\n \"OffNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OffNet calls.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=report", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Report CDRs by Group", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{reportbygroupcdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{reportbygroupcdr2_end_date}}", "enabled": true }, { "key": "group_by", "type": "text", "value": "{{reportbygroupcdr2_group_by}}", "enabled": true }, { "key": "report_by", "type": "text", "value": "{{reportbygroupcdr2_report_by}}", "enabled": false } ] } }, "response": [] }, { "name": "ReportByGroupTypeCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"Total\": {\n \"type\": \"string\",\n \"description\": \"<p>number of CDRs in the specified query.<\\\/p>\"\n },\n \"OnNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OnNet calls.<\\\/p>\"\n },\n \"OffNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OffNet calls.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=report", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Report CDRs by Group Type", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{reportbygrouptypecdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{reportbygrouptypecdr2_end_date}}", "enabled": true }, { "key": "group_type", "type": "text", "value": "{{reportbygrouptypecdr2_group_type}}", "enabled": true }, { "key": "grp", "type": "text", "value": "{{reportbygrouptypecdr2_grp}}", "enabled": true }, { "key": "report_by", "type": "text", "value": "{{reportbygrouptypecdr2_report_by}}", "enabled": false } ] } }, "response": [] }, { "name": "ReportByHostnameCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"Total\": {\n \"type\": \"string\",\n \"description\": \"<p>number of CDRs in the specified query.<\\\/p>\"\n },\n \"OnNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OnNet calls.<\\\/p>\"\n },\n \"OffNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OffNet calls.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=report", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Report CDRs by Hostname", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{reportbyhostnamecdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{reportbyhostnamecdr2_end_date}}", "enabled": true }, { "key": "hostname", "type": "text", "value": "{{reportbyhostnamecdr2_hostname}}", "enabled": true }, { "key": "report_by", "type": "text", "value": "{{reportbyhostnamecdr2_report_by}}", "enabled": false } ] } }, "response": [] }, { "name": "ReportByResellerCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"Total\": {\n \"type\": \"string\",\n \"description\": \"<p>number of CDRs in the specified query.<\\\/p>\"\n },\n \"OnNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OnNet calls.<\\\/p>\"\n },\n \"OffNet\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of OffNet calls.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=report", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Report CDRs by Reseller", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{reportbyresellercdr2_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{reportbyresellercdr2_end_date}}", "enabled": true }, { "key": "reseller", "type": "text", "value": "{{reportbyresellercdr2_reseller}}", "enabled": true }, { "key": "report_by", "type": "text", "value": "{{reportbyresellercdr2_report_by}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateCDR2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdr2&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a CDR", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "cdr_id", "type": "text", "value": "{{updatecdr2_cdr_id}}", "enabled": true }, { "key": "domain_name", "type": "text", "value": "{{updatecdr2_domain_name}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{updatecdr2_uid}}", "enabled": true }, { "key": "notes", "type": "text", "value": "{{updatecdr2_notes}}", "enabled": false }, { "key": "disposition", "type": "text", "value": "{{updatecdr2_disposition}}", "enabled": false }, { "key": "reason", "type": "text", "value": "{{updatecdr2_reason}}", "enabled": false }, { "key": "pac", "type": "text", "value": "{{updatecdr2_pac}}", "enabled": false }, { "key": "time_disp", "type": "text", "value": "{{updatecdr2_time_disp}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "CDR_Export", "description": "", "item": [ { "name": "CreateCDR_Export", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrexport&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a new cdrexport", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{createcdr_export_schedule_name}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createcdr_export_domain}}", "enabled": true }, { "key": "reseller", "type": "text", "value": "{{createcdr_export_reseller}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{createcdr_export_user}}", "enabled": true }, { "key": "cdr_format", "type": "text", "value": "{{createcdr_export_cdr_format}}", "enabled": true }, { "key": "last_run_time", "type": "text", "value": "{{createcdr_export_last_run_time}}", "enabled": true }, { "key": "next_run_time", "type": "text", "value": "{{createcdr_export_next_run_time}}", "enabled": true }, { "key": "cdr_count", "type": "text", "value": "{{createcdr_export_cdr_count}}", "enabled": true }, { "key": "server", "type": "text", "value": "{{createcdr_export_server}}", "enabled": true }, { "key": "period", "type": "text", "value": "{{createcdr_export_period}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteCDR_Export", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrexport&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a cdrexport", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{deletecdr_export_schedule_name}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletecdr_export_domain}}", "enabled": true }, { "key": "reseller", "type": "text", "value": "{{deletecdr_export_reseller}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{deletecdr_export_user}}", "enabled": true }, { "key": "cdr_format", "type": "text", "value": "{{deletecdr_export_cdr_format}}", "enabled": true }, { "key": "last_run_time", "type": "text", "value": "{{deletecdr_export_last_run_time}}", "enabled": true }, { "key": "next_run_time", "type": "text", "value": "{{deletecdr_export_next_run_time}}", "enabled": true }, { "key": "cdr_count", "type": "text", "value": "{{deletecdr_export_cdr_count}}", "enabled": true } ] } }, "response": [] }, { "name": "DownloadCDR_Export", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr_export'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrexport&action=download", "method": "get", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Download a cdrexport", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{downloadcdr_export_schedule_name}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{downloadcdr_export_domain}}", "enabled": true }, { "key": "reseller", "type": "text", "value": "{{downloadcdr_export_reseller}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{downloadcdr_export_user}}", "enabled": true }, { "key": "cdr_format", "type": "text", "value": "{{downloadcdr_export_cdr_format}}", "enabled": true }, { "key": "last_run_time", "type": "text", "value": "{{downloadcdr_export_last_run_time}}", "enabled": true }, { "key": "next_run_time", "type": "text", "value": "{{downloadcdr_export_next_run_time}}", "enabled": true }, { "key": "cdr_count", "type": "text", "value": "{{downloadcdr_export_cdr_count}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadCDR_Export", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr_export'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrexport&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Cdrexports", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readcdr_export_domain}}", "enabled": true }, { "key": "reseller", "type": "text", "value": "{{readcdr_export_reseller}}", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{readcdr_export_schedule_name}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateCDR_Export", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrexport&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a new cdrexport", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{updatecdr_export_schedule_name}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatecdr_export_domain}}", "enabled": true }, { "key": "reseller", "type": "text", "value": "{{updatecdr_export_reseller}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updatecdr_export_user}}", "enabled": true }, { "key": "cdr_format", "type": "text", "value": "{{updatecdr_export_cdr_format}}", "enabled": true }, { "key": "last_run_time", "type": "text", "value": "{{updatecdr_export_last_run_time}}", "enabled": true }, { "key": "next_run_time", "type": "text", "value": "{{updatecdr_export_next_run_time}}", "enabled": true }, { "key": "cdr_count", "type": "text", "value": "{{updatecdr_export_cdr_count}}", "enabled": true }, { "key": "server", "type": "text", "value": "{{updatecdr_export_server}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "CDR_Schedule", "description": "", "item": [ { "name": "CountCDR_Schedule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"count\"],\n \"properties\": {\n \"count\": {\n \"type\": \"string\",\n \"description\": \"<p>Count of how many cdrschedules<\\\/p>\"\n },\n \"status\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrschedule&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Schedules for Call Data records (CDRs)", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{countcdr_schedule_schedule_name}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{countcdr_schedule_user}}", "enabled": false }, { "key": "reseller", "type": "text", "value": "{{countcdr_schedule_reseller}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{countcdr_schedule_domain}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateCDR_Schedule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrschedule&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a new cdrSchedule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{createcdr_schedule_schedule_name}}", "enabled": true }, { "key": "reseller", "type": "text", "value": "{{createcdr_schedule_reseller}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{createcdr_schedule_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{createcdr_schedule_user}}", "enabled": false }, { "key": "period", "type": "text", "value": "{{createcdr_schedule_period}}", "enabled": true }, { "key": "cdrschedule_preset", "type": "text", "value": "{{createcdr_schedule_cdrschedule_preset}}", "enabled": false }, { "key": "time_start_preset", "type": "text", "value": "{{createcdr_schedule_time_start_preset}}", "enabled": false }, { "key": "time_zone", "type": "text", "value": "{{createcdr_schedule_time_zone}}", "enabled": false }, { "key": "cdr_format", "type": "text", "value": "{{createcdr_schedule_cdr_format}}", "enabled": false }, { "key": "include_header", "type": "text", "value": "{{createcdr_schedule_include_header}}", "enabled": false }, { "key": "inbound", "type": "text", "value": "{{createcdr_schedule_inbound}}", "enabled": false }, { "key": "outbound", "type": "text", "value": "{{createcdr_schedule_outbound}}", "enabled": false }, { "key": "offnet", "type": "text", "value": "{{createcdr_schedule_offnet}}", "enabled": true }, { "key": "script_enable", "type": "text", "value": "{{createcdr_schedule_script_enable}}", "enabled": false }, { "key": "script_path", "type": "text", "value": "{{createcdr_schedule_script_path}}", "enabled": false }, { "key": "export_method", "type": "text", "value": "{{createcdr_schedule_export_method}}", "enabled": true }, { "key": "email", "type": "text", "value": "{{createcdr_schedule_email}}", "enabled": false }, { "key": "hostname", "type": "text", "value": "{{createcdr_schedule_hostname}}", "enabled": false }, { "key": "remote_path", "type": "text", "value": "{{createcdr_schedule_remote_path}}", "enabled": false }, { "key": "last_sequence_number", "type": "text", "value": "{{createcdr_schedule_last_sequence_number}}", "enabled": false }, { "key": "next_run_time", "type": "text", "value": "{{createcdr_schedule_next_run_time}}", "enabled": true }, { "key": "send_email", "type": "text", "value": "{{createcdr_schedule_send_email}}", "enabled": false }, { "key": "report_cycle", "type": "text", "value": "{{createcdr_schedule_report_cycle}}", "enabled": false }, { "key": "error_backoff", "type": "text", "value": "{{createcdr_schedule_error_backoff}}", "enabled": false }, { "key": "status", "type": "text", "value": "{{createcdr_schedule_status}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteCDR_Schedule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrschedule&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete an existing cdrSchedule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{deletecdr_schedule_schedule_name}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletecdr_schedule_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadCDR_Schedule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"schedule_name\",\"domain\"],\n \"properties\": {\n \"schedule_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Specifies name of new cdrSchedule to be created.<\\\/p>\"\n },\n \"reseller\": {\n \"type\": \"string\",\n \"description\": \"<p>Reseller\\\/territory name.<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain of schedule.<\\\/p>\"\n },\n \"user\": {\n \"type\": \"string\",\n \"description\": \"<p>User of schedule.<\\\/p>\"\n },\n \"period\": {\n \"type\": \"string\",\n \"description\": \"<p>Period for schedule.<\\\/p>\"\n },\n \"cdr_format\": {\n \"type\": \"string\",\n \"description\": \"<p>Format of schedule (Standard, Advanced, or any preconfigure format)<\\\/p>\"\n },\n \"include_header\": {\n \"type\": \"string\",\n \"description\": \"<p>Boolean, whether to add header or not<\\\/p>\"\n },\n \"inbound\": {\n \"type\": \"string\",\n \"description\": \"<p>Boolean, whether to show inBound or not<\\\/p>\"\n },\n \"outbound\": {\n \"type\": \"string\",\n \"description\": \"<p>Boolean, wehther to show outBound or not<\\\/p>\"\n },\n \"offnet\": {\n \"type\": \"string\",\n \"description\": \"<p>Boolean, whether should be offnet only or not<\\\/p>\"\n },\n \"prefixes\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"script_enable\": {\n \"type\": \"string\",\n \"description\": \"<p>Boolean, wehther scripts enabled or not<\\\/p>\"\n },\n \"script_path\": {\n \"type\": \"string\",\n \"description\": \"<p>Path for the script<\\\/p>\"\n },\n \"export_method\": {\n \"type\": \"string\",\n \"description\": \"<p>Method of export (email, SCP copy, FTP upload, sftp, backup locally)<\\\/p>\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"<p>Email for the export<\\\/p>\"\n },\n \"hostname\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"remote_path\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"username\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"password\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"last_sequence_number\": {\n \"type\": \"string\",\n \"description\": \"<p>Segment number<\\\/p>\"\n },\n \"last_run_time\": {\n \"type\": \"number\",\n \"description\": \"<p>In format: 'Y-m-d H:i:s' eg. Year-Month-Day Hour:Minute:Second, 0000-00-00 00:00:00<\\\/p>\"\n },\n \"next_run_time\": {\n \"type\": \"number\",\n \"description\": \"<p>In format: 'Y-m-d H:i:s' eg. Year-Month-Day Hour:Minute:Second, 0000-00-00 00:00:00<\\\/p>\"\n },\n \"error_backoff\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"status\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"send_email\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"report_cycle\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"previous_export_date\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"cdrschedule_preset\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_start_preset\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_zone\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['cdr_schedule'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrschedule&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Schedules for Call Data records (CDRs)", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{readcdr_schedule_schedule_name}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readcdr_schedule_domain}}", "enabled": false }, { "key": "reseller", "type": "text", "value": "{{readcdr_schedule_reseller}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{readcdr_schedule_sort}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readcdr_schedule_limit}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateCDR_Schedule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=cdrschedule&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a cdrSchedule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "schedule_name", "type": "text", "value": "{{updatecdr_schedule_schedule_name}}", "enabled": true }, { "key": "reseller", "type": "text", "value": "{{updatecdr_schedule_reseller}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{updatecdr_schedule_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updatecdr_schedule_user}}", "enabled": false }, { "key": "period", "type": "text", "value": "{{updatecdr_schedule_period}}", "enabled": false }, { "key": "cdr_format", "type": "text", "value": "{{updatecdr_schedule_cdr_format}}", "enabled": false }, { "key": "include_header", "type": "text", "value": "{{updatecdr_schedule_include_header}}", "enabled": false }, { "key": "inbound", "type": "text", "value": "{{updatecdr_schedule_inbound}}", "enabled": false }, { "key": "outbound", "type": "text", "value": "{{updatecdr_schedule_outbound}}", "enabled": false }, { "key": "offnet", "type": "text", "value": "{{updatecdr_schedule_offnet}}", "enabled": true }, { "key": "script_enable", "type": "text", "value": "{{updatecdr_schedule_script_enable}}", "enabled": false }, { "key": "script_path", "type": "text", "value": "{{updatecdr_schedule_script_path}}", "enabled": false }, { "key": "export_method", "type": "text", "value": "{{updatecdr_schedule_export_method}}", "enabled": true }, { "key": "email", "type": "text", "value": "{{updatecdr_schedule_email}}", "enabled": false }, { "key": "hostname", "type": "text", "value": "{{updatecdr_schedule_hostname}}", "enabled": false }, { "key": "remote_path", "type": "text", "value": "{{updatecdr_schedule_remote_path}}", "enabled": false }, { "key": "last_run_time", "type": "text", "value": "{{updatecdr_schedule_last_run_time}}", "enabled": false }, { "key": "next_run_time", "type": "text", "value": "{{updatecdr_schedule_next_run_time}}", "enabled": false }, { "key": "send_email", "type": "text", "value": "{{updatecdr_schedule_send_email}}", "enabled": false }, { "key": "report_cycle", "type": "text", "value": "{{updatecdr_schedule_report_cycle}}", "enabled": false }, { "key": "status", "type": "text", "value": "{{updatecdr_schedule_status}}", "enabled": false }, { "key": "server", "type": "text", "value": "{{updatecdr_schedule_server}}", "enabled": false }, { "key": "start_time", "type": "text", "value": "{{updatecdr_schedule_start_time}}", "enabled": false }, { "key": "kill_time", "type": "text", "value": "{{updatecdr_schedule_kill_time}}", "enabled": false }, { "key": "previous_export_date", "type": "text", "value": "{{updatecdr_schedule_previous_export_date}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Call", "description": "", "item": [ { "name": "AnswerCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=answer", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Answer an incoming call", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{answercall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{answercall_uid}}", "enabled": true }, { "key": "destination", "type": "text", "value": "{{answercall_destination}}", "enabled": true } ] } }, "response": [] }, { "name": "CallToRecordCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=call_to_record", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Record a message", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{calltorecordcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{calltorecordcall_uid}}", "enabled": true }, { "key": "destination", "type": "text", "value": "{{calltorecordcall_destination}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{calltorecordcall_type}}", "enabled": true }, { "key": "index", "type": "text", "value": "{{calltorecordcall_index}}", "enabled": true }, { "key": "auto", "type": "text", "value": "{{calltorecordcall_auto}}", "enabled": false }, { "key": "ani", "type": "text", "value": "{{calltorecordcall_ani}}", "enabled": false }, { "key": "script", "type": "text", "value": "{{calltorecordcall_script}}", "enabled": false }, { "key": "description", "type": "text", "value": "{{calltorecordcall_description}}", "enabled": false } ] } }, "response": [] }, { "name": "CountCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Number of active Calls.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count active Calls", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countcall_domain}}", "enabled": true }, { "key": "groupby", "type": "text", "value": "{{countcall_groupby}}", "enabled": false }, { "key": "territory", "type": "text", "value": "{{countcall_territory}}", "enabled": false } ] } }, "response": [] }, { "name": "DisconnectCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=disconnect", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Disconnect an active Call", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{disconnectcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{disconnectcall_uid}}", "enabled": true } ] } }, "response": [] }, { "name": "HoldOrigCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=hold_orig", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Place Call's source on hold", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{holdorigcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{holdorigcall_uid}}", "enabled": true } ] } }, "response": [] }, { "name": "HoldTermCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=hold_term", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Place Call's recipient on hold", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{holdtermcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{holdtermcall_uid}}", "enabled": true } ] } }, "response": [] }, { "name": "MakeCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=call", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Make a new Call", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{makecall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{makecall_uid}}", "enabled": true }, { "key": "destination", "type": "text", "value": "{{makecall_destination}}", "enabled": true }, { "key": "origination", "type": "text", "value": "{{makecall_origination}}", "enabled": false }, { "key": "application", "type": "text", "value": "{{makecall_application}}", "enabled": false }, { "key": "auto", "type": "text", "value": "{{makecall_auto}}", "enabled": false }, { "key": "cbani", "type": "text", "value": "{{makecall_cbani}}", "enabled": false }, { "key": "ani", "type": "text", "value": "{{makecall_ani}}", "enabled": false } ] } }, "response": [] }, { "name": "ParkCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"park\": {\n \"type\": \"string\",\n \"description\": \"<p>The park\\\/queue the call has been moved to.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=park", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Dynamically park a call in a open park slot", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{parkcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{parkcall_uid}}", "enabled": true }, { "key": "prefix", "type": "text", "value": "{{parkcall_prefix}}", "enabled": true } ] } }, "response": [] }, { "name": "PlaybackCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=call_to_playback", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Playback a recorded message", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{playbackcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{playbackcall_uid}}", "enabled": true }, { "key": "destination", "type": "text", "value": "{{playbackcall_destination}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{playbackcall_type}}", "enabled": true }, { "key": "index", "type": "text", "value": "{{playbackcall_index}}", "enabled": true }, { "key": "auto", "type": "text", "value": "{{playbackcall_auto}}", "enabled": false }, { "key": "ani", "type": "text", "value": "{{playbackcall_ani}}", "enabled": false }, { "key": "script", "type": "text", "value": "{{playbackcall_script}}", "enabled": false }, { "key": "description", "type": "text", "value": "{{playbackcall_description}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"orig_callid\": {\n \"type\": \"string\",\n \"description\": \"<p>SIP Call-ID for the Call's origin.<\\\/p>\"\n },\n \"orig_match\": {\n \"type\": \"string\",\n \"description\": \"<p>The originatiing device match for the call<\\\/p>\"\n },\n \"orig_user\": {\n \"type\": \"string\",\n \"description\": \"<p>User responsible for originating call.<\\\/p>\"\n },\n \"orig_domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain of Call's origin.<\\\/p>\"\n },\n \"orig_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>Uniform resource identifier for the Call's origin.<\\\/p>\"\n },\n \"orig_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of Call's origin.<\\\/p>\"\n },\n \"ani\": {\n \"type\": \"string\",\n \"description\": \"<p>Automatic number identification<\\\/p>\"\n },\n \"dnis\": {\n \"type\": \"string\",\n \"description\": \"<p>Dialed number identification service<\\\/p>\"\n },\n \"by_action\": {\n \"type\": \"string\",\n \"description\": \"<p>Method used to create Call.<\\\/p>\"\n },\n \"by_user\": {\n \"type\": \"string\",\n \"description\": \"<p>User responsible for altering or intiating the call.<\\\/p>\"\n },\n \"by_domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain responsible for altering or intiating the call.<\\\/p>\"\n },\n \"by_callid\": {\n \"type\": \"string\",\n \"description\": \"<p>SIP Call-ID for potentially altered call like a transfer<\\\/p>\"\n },\n \"term_callid\": {\n \"type\": \"string\",\n \"description\": \"<p>SIP Call-ID for the Call's destination.<\\\/p>\"\n },\n \"term_user\": {\n \"type\": \"string\",\n \"description\": \"<p>User for the Call's destination.<\\\/p>\"\n },\n \"term_domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain for the Call's destination.<\\\/p>\"\n },\n \"term_uri\": {\n \"type\": \"string\",\n \"description\": \"<p>Uniform resource identifier for Call's destination.<\\\/p>\"\n },\n \"time_begin\": {\n \"type\": \"string\",\n \"description\": \"<p>Timestamp for when the Call originated, output as mm\\\/dd\\\/yy hrs:min:sec<\\\/p>\"\n },\n \"time_answer\": {\n \"type\": \"string\",\n \"description\": \"<p>Timestamp for when the Call was answered, output as mm\\\/dd\\\/yy hrs:min:sec<\\\/p>\"\n },\n \"orig_call_info\": {\n \"type\": \"string\",\n \"description\": \"<p>Status for the Call's source. 'Progressing' if the Call is in progress, 'Active' if the Call has connected.<\\\/p>\"\n },\n \"term_call_info\": {\n \"type\": \"string\",\n \"description\": \"<p>Status for the Call's destination. 'Alerting' if the Call has not yet been accepted, 'Active' when the Call is accepted.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read active Calls", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readcall_domain}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readcall_start}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readcall_limit}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{readcall_sort}}", "enabled": false } ] } }, "response": [] }, { "name": "RecordStartCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=record_on", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Record an active Call", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{recordstartcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{recordstartcall_uid}}", "enabled": true }, { "key": "aor", "type": "text", "value": "{{recordstartcall_aor}}", "enabled": false } ] } }, "response": [] }, { "name": "RecordStopCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=record_off", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Stop recording a Call", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{recordstopcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{recordstopcall_uid}}", "enabled": true } ] } }, "response": [] }, { "name": "RejectCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=reject", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Reject a Call", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{rejectcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{rejectcall_uid}}", "enabled": true }, { "key": "aor", "type": "text", "value": "{{rejectcall_aor}}", "enabled": false } ] } }, "response": [] }, { "name": "ReportCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"max\": {\n \"type\": \"string\",\n \"description\": \"<p>max number of acctive calls.<\\\/p>\"\n },\n \"min\": {\n \"type\": \"string\",\n \"description\": \"<p>min number of acctive calls.<\\\/p>\"\n },\n \"avg\": {\n \"type\": \"string\",\n \"description\": \"<p>average number of acctive calls.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=report", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Report active calls", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{reportcall_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{reportcall_end_date}}", "enabled": true }, { "key": "group_by", "type": "text", "value": "{{reportcall_group_by}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{reportcall_domain}}", "enabled": false }, { "key": "hostname", "type": "text", "value": "{{reportcall_hostname}}", "enabled": false }, { "key": "reseller", "type": "text", "value": "{{reportcall_reseller}}", "enabled": false }, { "key": "cluster", "type": "text", "value": "{{reportcall_cluster}}", "enabled": false }, { "key": "site", "type": "text", "value": "{{reportcall_site}}", "enabled": false }, { "key": "group", "type": "text", "value": "{{reportcall_group}}", "enabled": false }, { "key": "connection", "type": "text", "value": "{{reportcall_connection}}", "enabled": false }, { "key": "report_by", "type": "text", "value": "{{reportcall_report_by}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{reportcall_type}}", "enabled": true } ] } }, "response": [] }, { "name": "TransferCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=xfer", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Transfer an active Call", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{transfercall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{transfercall_uid}}", "enabled": true }, { "key": "destination", "type": "text", "value": "{{transfercall_destination}}", "enabled": true }, { "key": "hostname", "type": "text", "value": "{{transfercall_hostname}}", "enabled": false }, { "key": "dest_sessionId", "type": "text", "value": "{{transfercall_dest_sessionId}}", "enabled": false } ] } }, "response": [] }, { "name": "UnholdCall", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=call&action=unhold", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Unhold a Call", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "callid", "type": "text", "value": "{{unholdcall_callid}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{unholdcall_uid}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Call_Center_Stats", "description": "", "item": [ { "name": "ReadAgentLogCall_Center_Stats", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"L\",\"B\",\"M\",\"O\",\"W\",\"AM\",\"UM\",\"LI\",\"AAM\"],\n \"properties\": {\n \"L\": {\n \"type\": \"string\",\n \"description\": \"<p>Lunch Minutes<\\\/p>\"\n },\n \"B\": {\n \"type\": \"string\",\n \"description\": \"<p>Break Minutes<\\\/p>\"\n },\n \"M\": {\n \"type\": \"string\",\n \"description\": \"<p>Meeting Minutes<\\\/p>\"\n },\n \"O\": {\n \"type\": \"string\",\n \"description\": \"<p>Other Minutes<\\\/p>\"\n },\n \"W\": {\n \"type\": \"string\",\n \"description\": \"<p>Web Minutes<\\\/p>\"\n },\n \"AM\": {\n \"type\": \"string\",\n \"description\": \"<p>Available Minutes<\\\/p>\"\n },\n \"UM\": {\n \"type\": \"string\",\n \"description\": \"<p>Unavailable Minutes<\\\/p>\"\n },\n \"LI\": {\n \"type\": \"string\",\n \"description\": \"<p>Logged in Minutes<\\\/p>\"\n },\n \"AAM\": {\n \"type\": \"string\",\n \"description\": \"<p>Adjusted Available Minutes (available_minutes - SUM(op_time_talking) - SUM(time_disp))<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_center_stats'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=statistics&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Agent Log for Call Center", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readagentlogcall_center_stats_domain}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{readagentlogcall_center_stats_type}}", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{readagentlogcall_center_stats_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readagentlogcall_center_stats_end_date}}", "enabled": true }, { "key": "group", "type": "text", "value": "{{readagentlogcall_center_stats_group}}", "enabled": true }, { "key": "fields", "type": "text", "value": "{{readagentlogcall_center_stats_fields}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadDNISStatsCall_Center_Stats", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"VOL\",\"CH\",\"CO\",\"ACO\",\"VM\",\"FWD\",\"ATT\",\"AHT\",\"SL\",\"DT\",\"AC\",\"AAC\",\"AR\",\"AAR\",\"AAS\"],\n \"properties\": {\n \"VOL\": {\n \"type\": \"string\",\n \"description\": \"<p>Volume<\\\/p>\"\n },\n \"CH\": {\n \"type\": \"string\",\n \"description\": \"<p>Calls Handled<\\\/p>\"\n },\n \"CO\": {\n \"type\": \"string\",\n \"description\": \"<p>Calls Offered<\\\/p>\"\n },\n \"ACO\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Calls Offered<\\\/p>\"\n },\n \"VM\": {\n \"type\": \"string\",\n \"description\": \"<p>Amount forwarded to Voicemail<\\\/p>\"\n },\n \"FWD\": {\n \"type\": \"string\",\n \"description\": \"<p>Fowarded Call Count<\\\/p>\"\n },\n \"ATT\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Talking Time<\\\/p>\"\n },\n \"AHT\": {\n \"type\": \"string\",\n \"description\": \"<p>Handle Time<\\\/p>\"\n },\n \"SL\": {\n \"type\": \"string\",\n \"description\": \"<p>% Service Level<\\\/p>\"\n },\n \"DT\": {\n \"type\": \"string\",\n \"description\": \"<p>% Dial Transfers<\\\/p>\"\n },\n \"AC\": {\n \"type\": \"string\",\n \"description\": \"<p>Abandoned Call Count<\\\/p>\"\n },\n \"AAC\": {\n \"type\": \"string\",\n \"description\": \"<p>Adjusted Abandoned Call Count<\\\/p>\"\n },\n \"AR\": {\n \"type\": \"string\",\n \"description\": \"<p>Abandon Rate<\\\/p>\"\n },\n \"AAR\": {\n \"type\": \"string\",\n \"description\": \"<p>Adjusted Abandon Rate<\\\/p>\"\n },\n \"AAS\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Answer Speed<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_center_stats'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=statistics&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read DNIS Stats for Call Center", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readdnisstatscall_center_stats_domain}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{readdnisstatscall_center_stats_type}}", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{readdnisstatscall_center_stats_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readdnisstatscall_center_stats_end_date}}", "enabled": true }, { "key": "fields", "type": "text", "value": "{{readdnisstatscall_center_stats_fields}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{readdnisstatscall_center_stats_queue}}", "enabled": true }, { "key": "remove_zeros", "type": "text", "value": "{{readdnisstatscall_center_stats_remove_zeros}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadProcessEmailCall_Center_Stats", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=email&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Send Email Call Center Report", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readprocessemailcall_center_stats_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{readprocessemailcall_center_stats_user}}", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{readprocessemailcall_center_stats_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readprocessemailcall_center_stats_end_date}}", "enabled": true }, { "key": "range_interval", "type": "text", "value": "{{readprocessemailcall_center_stats_range_interval}}", "enabled": false }, { "key": "report", "type": "text", "value": "{{readprocessemailcall_center_stats_report}}", "enabled": true }, { "key": "template", "type": "text", "value": "{{readprocessemailcall_center_stats_template}}", "enabled": true }, { "key": "subject", "type": "text", "value": "{{readprocessemailcall_center_stats_subject}}", "enabled": false }, { "key": "cclist", "type": "text", "value": "{{readprocessemailcall_center_stats_cclist}}", "enabled": false }, { "key": "queue_fields", "type": "text", "value": "{{readprocessemailcall_center_stats_queue_fields}}", "enabled": false }, { "key": "agent_fields", "type": "text", "value": "{{readprocessemailcall_center_stats_agent_fields}}", "enabled": false }, { "key": "dnis_fields", "type": "text", "value": "{{readprocessemailcall_center_stats_dnis_fields}}", "enabled": false }, { "key": "include_csv", "type": "text", "value": "{{readprocessemailcall_center_stats_include_csv}}", "enabled": false }, { "key": "queue_list", "type": "text", "value": "{{readprocessemailcall_center_stats_queue_list}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadQueueStatsCall_Center_Stats", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"VOL\",\"CH\",\"ATT\",\"CO\",\"VM\",\"ACO\",\"AHT\",\"AC\",\"AAS\",\"AWT\",\"SL\",\"DT\",\"AAC\",\"AR\",\"AAR\",\"FWD\",\"AST\"],\n \"properties\": {\n \"VOL\": {\n \"type\": \"string\",\n \"description\": \"<p>Volume<\\\/p>\"\n },\n \"CH\": {\n \"type\": \"string\",\n \"description\": \"<p>Calls Handled<\\\/p>\"\n },\n \"ATT\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Talk Time<\\\/p>\"\n },\n \"CO\": {\n \"type\": \"string\",\n \"description\": \"<p>Calls Offered<\\\/p>\"\n },\n \"VM\": {\n \"type\": \"string\",\n \"description\": \"<p>Amount forwarded to Voicemail<\\\/p>\"\n },\n \"ACO\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Calls Offered<\\\/p>\"\n },\n \"AHT\": {\n \"type\": \"string\",\n \"description\": \"<p>Handle Time<\\\/p>\"\n },\n \"AC\": {\n \"type\": \"string\",\n \"description\": \"<p>Abandoned Call Count<\\\/p>\"\n },\n \"AAS\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Answer Speed<\\\/p>\"\n },\n \"AWT\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Wait Time (same as AAS)<\\\/p>\"\n },\n \"SL\": {\n \"type\": \"string\",\n \"description\": \"<p>% Service Level<\\\/p>\"\n },\n \"DT\": {\n \"type\": \"string\",\n \"description\": \"<p>% Dial Transfers<\\\/p>\"\n },\n \"AAC\": {\n \"type\": \"string\",\n \"description\": \"<p>Adjusted Abandoned Call Count<\\\/p>\"\n },\n \"AR\": {\n \"type\": \"string\",\n \"description\": \"<p>Abandon Rate<\\\/p>\"\n },\n \"AAR\": {\n \"type\": \"string\",\n \"description\": \"<p>Adjusted Abandon Rate<\\\/p>\"\n },\n \"FWD\": {\n \"type\": \"string\",\n \"description\": \"<p>Fowarded Call Count<\\\/p>\"\n },\n \"AST\": {\n \"type\": \"string\",\n \"description\": \"<p>Assisted Calls Handled<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_center_stats'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=statistics&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Queue Stats for Call Center", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readqueuestatscall_center_stats_domain}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{readqueuestatscall_center_stats_type}}", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{readqueuestatscall_center_stats_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readqueuestatscall_center_stats_end_date}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{readqueuestatscall_center_stats_queue}}", "enabled": false }, { "key": "queue_list", "type": "text", "value": "{{readqueuestatscall_center_stats_queue_list}}", "enabled": false }, { "key": "fields", "type": "text", "value": "{{readqueuestatscall_center_stats_fields}}", "enabled": false }, { "key": "remove_zeros", "type": "text", "value": "{{readqueuestatscall_center_stats_remove_zeros}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadUserStatsCall_Center_Stats", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"CH\",\"ATT\",\"AH\",\"AHT\",\"TT\",\"MC\",\"AST\"],\n \"properties\": {\n \"CH\": {\n \"type\": \"string\",\n \"description\": \"<p>Calls Handled<\\\/p>\"\n },\n \"ATT\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Talk Time<\\\/p>\"\n },\n \"AH\": {\n \"type\": \"string\",\n \"description\": \"<p>Handle Time<\\\/p>\"\n },\n \"AHT\": {\n \"type\": \"string\",\n \"description\": \"<p>Average Handle Time<\\\/p>\"\n },\n \"TT\": {\n \"type\": \"string\",\n \"description\": \"<p>Talk Time<\\\/p>\"\n },\n \"MC\": {\n \"type\": \"string\",\n \"description\": \"<p>The number of attempted dispatched calls to the agent that wen unanswered or received a busy\\\/reject code.<\\\/p>\"\n },\n \"AST\": {\n \"type\": \"string\",\n \"description\": \"<p>Assisted Calls Handled<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_center_stats'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=statistics&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read User Stats for Call Center", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readuserstatscall_center_stats_domain}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{readuserstatscall_center_stats_type}}", "enabled": true }, { "key": "start_date", "type": "text", "value": "{{readuserstatscall_center_stats_start_date}}", "enabled": true }, { "key": "end_date", "type": "text", "value": "{{readuserstatscall_center_stats_end_date}}", "enabled": true }, { "key": "fields", "type": "text", "value": "{{readuserstatscall_center_stats_fields}}", "enabled": true }, { "key": "group", "type": "text", "value": "{{readuserstatscall_center_stats_group}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{readuserstatscall_center_stats_queue}}", "enabled": true }, { "key": "remove_zeros", "type": "text", "value": "{{readuserstatscall_center_stats_remove_zeros}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Call_Queue", "description": "", "item": [ { "name": "CreateCall_Queue", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueue&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a Callqueue in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createcall_queue_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{createcall_queue_queue}}", "enabled": true }, { "key": "description", "type": "text", "value": "{{createcall_queue_description}}", "enabled": false }, { "key": "max_time", "type": "text", "value": "{{createcall_queue_max_time}}", "enabled": false }, { "key": "wait_limit", "type": "text", "value": "{{createcall_queue_wait_limit}}", "enabled": false }, { "key": "length_limit", "type": "text", "value": "{{createcall_queue_length_limit}}", "enabled": false }, { "key": "agent_required", "type": "text", "value": "{{createcall_queue_agent_required}}", "enabled": false }, { "key": "run_stats", "type": "text", "value": "{{createcall_queue_run_stats}}", "enabled": false }, { "key": "auto_logout", "type": "text", "value": "{{createcall_queue_auto_logout}}", "enabled": false }, { "key": "callback_max_hours", "type": "text", "value": "{{createcall_queue_callback_max_hours}}", "enabled": false }, { "key": "options", "type": "text", "value": "{{createcall_queue_options}}", "enabled": false }, { "key": "queue_audio", "type": "text", "value": "{{createcall_queue_queue_audio}}", "enabled": false }, { "key": "huntgroup_option", "type": "text", "value": "{{createcall_queue_huntgroup_option}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteCall_Queue", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueue&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a Callqueue", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletecall_queue_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{deletecall_queue_queue}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadCall_Queue", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"queue_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of Callqueue object.<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain to which Callqueue belongs.<\\\/p>\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description of Callqueue object.<\\\/p>\"\n },\n \"default_user\": {\n \"type\": \"string\",\n \"description\": \"<p>Default user of Callqueue object.<\\\/p>\"\n },\n \"queue_option\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"max_time\": {\n \"type\": \"string\",\n \"description\": \"<p>Callqueue max time in minutes.<\\\/p>\"\n },\n \"wait_limit\": {\n \"type\": \"string\",\n \"description\": \"<p>Callqueue max wait limit in seconds.<\\\/p>\"\n },\n \"length_limit\": {\n \"type\": \"string\",\n \"description\": \"<p>Callqueue max length limit.<\\\/p>\"\n },\n \"agent_required\": {\n \"type\": \"string\",\n \"description\": \"<p>Specifies whether or not an agent is required for a Callqueue object.<\\\/p>\"\n },\n \"callback_max_hours\": {\n \"type\": \"string\",\n \"description\": \"<p>Specifies whether there is a callback limit. Set to 'Disabled if there is no limit or a number specifying the callback limit in hours.<\\\/p>\"\n },\n \"queuedcall_count\": {\n \"type\": \"string\",\n \"description\": \"<p>Number of queued calls for a Callqueue object.<\\\/p>\"\n },\n \"agent_count\": {\n \"type\": \"string\",\n \"description\": \"<p>Number of agents for a Callqueue object.<\\\/p>\"\n },\n \"huntgroup_option\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"connect_to\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"run_stats\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"sring_1st\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"sring_inc\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"auto_logout\": {\n \"type\": \"string\",\n \"description\": \"<p>Specifies whether or not auto logout is enabled.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_queue'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueue&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read a Callqueue in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readcall_queue_domain}}", "enabled": true }, { "key": "queue_name", "type": "text", "value": "{{readcall_queue_queue_name}}", "enabled": false }, { "key": "type", "type": "text", "value": "{{readcall_queue_type}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{readcall_queue_sort}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readcall_queue_start}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readcall_queue_limit}}", "enabled": false }, { "key": "list", "type": "text", "value": "{{readcall_queue_list}}", "enabled": false }, { "key": "fields", "type": "text", "value": "{{readcall_queue_fields}}", "enabled": false }, { "key": "queue_list", "type": "text", "value": "{{readcall_queue_queue_list}}", "enabled": false }, { "key": "agent", "type": "text", "value": "{{readcall_queue_agent}}", "enabled": false }, { "key": "run_stats", "type": "text", "value": "{{readcall_queue_run_stats}}", "enabled": false }, { "key": "stats", "type": "text", "value": "{{readcall_queue_stats}}", "enabled": false }, { "key": "start_date", "type": "text", "value": "{{readcall_queue_start_date}}", "enabled": false }, { "key": "end_date", "type": "text", "value": "{{readcall_queue_end_date}}", "enabled": false }, { "key": "range_interval", "type": "text", "value": "{{readcall_queue_range_interval}}", "enabled": false } ] } }, "response": [] }, { "name": "ReportCall_Queue", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"orig_callid\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_term_to_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_term_sub\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_term_domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"agent_firstname\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"agent_lastname\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"queue_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gau_queue_avg_wait\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dnis\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_time_talking\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_duration\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"queue_duration\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_disp\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_time_start\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"queue_time_start\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"queue_time_rel\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_time_rel\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_time_answer\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"op_rel_text\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"queue_rel_text\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_from_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_from_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_from_uri\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_queue'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueuereport&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Callqueue Reports in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{reportcall_queue_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{reportcall_queue_domain}}", "enabled": true }, { "key": "period", "type": "text", "value": "{{reportcall_queue_period}}", "enabled": false }, { "key": "type", "type": "text", "value": "{{reportcall_queue_type}}", "enabled": false }, { "key": "logic", "type": "text", "value": "{{reportcall_queue_logic}}", "enabled": false }, { "key": "sla", "type": "text", "value": "{{reportcall_queue_sla}}", "enabled": false }, { "key": "op_term_sub", "type": "text", "value": "{{reportcall_queue_op_term_sub}}", "enabled": false }, { "key": "queue", "type": "text", "value": "{{reportcall_queue_queue}}", "enabled": false }, { "key": "queue_list", "type": "text", "value": "{{reportcall_queue_queue_list}}", "enabled": false }, { "key": "range_interval", "type": "text", "value": "{{reportcall_queue_range_interval}}", "enabled": false }, { "key": "value_offset", "type": "text", "value": "{{reportcall_queue_value_offset}}", "enabled": false }, { "key": "start_date", "type": "text", "value": "{{reportcall_queue_start_date}}", "enabled": false }, { "key": "end_date", "type": "text", "value": "{{reportcall_queue_end_date}}", "enabled": false }, { "key": "read", "type": "text", "value": "{{reportcall_queue_read}}", "enabled": false }, { "key": "stat", "type": "text", "value": "{{reportcall_queue_stat}}", "enabled": false }, { "key": "logic2", "type": "text", "value": "{{reportcall_queue_logic2}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateCall_Queue", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueue&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a Callqueue in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatecall_queue_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{updatecall_queue_queue}}", "enabled": true }, { "key": "queue_option", "type": "text", "value": "{{updatecall_queue_queue_option}}", "enabled": false }, { "key": "huntgroup_option", "type": "text", "value": "{{updatecall_queue_huntgroup_option}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Call_Queue_Stats", "description": "", "item": [ { "name": "ReadCall_Queue_Stats", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"timestamp\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"hostname\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"queue\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gau_session\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gau_queue_length\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gau_queue_max_wait\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gau_queue_avg_wait\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gau_agent_total\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gau_agent_available\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gau_agent_Unavailable\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_queue_stats'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueuestat&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Callqueue Stats in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{readcall_queue_stats_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readcall_queue_stats_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{readcall_queue_stats_queue}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Call_Request", "description": "", "item": [ { "name": "CreateCall_Request", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_request'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callrequest&action=addWakeUp", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Add Wake-Up Call Requests for a subscriber", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{createcall_request_uid}}", "enabled": true }, { "key": "timeToCall", "type": "text", "value": "{{createcall_request_timeToCall}}", "enabled": true }, { "key": "dDay", "type": "text", "value": "{{createcall_request_dDay}}", "enabled": true }, { "key": "dHour", "type": "text", "value": "{{createcall_request_dHour}}", "enabled": true }, { "key": "dMin", "type": "text", "value": "{{createcall_request_dMin}}", "enabled": true }, { "key": "dSec", "type": "text", "value": "{{createcall_request_dSec}}", "enabled": true }, { "key": "requestFrom", "type": "text", "value": "{{createcall_request_requestFrom}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteCall_Request", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_request'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callrequest&action=delWakeUp", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete Wake-Up Call Requests for a subscriber", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{deletecall_request_uid}}", "enabled": true }, { "key": "requestId", "type": "text", "value": "{{deletecall_request_requestId}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadCall_Request", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"request_id\": {\n \"type\": \"string\",\n \"description\": \"<p>[Unique id] of callrequest<\\\/p>\"\n },\n \"request\": {\n \"type\": \"string\",\n \"description\": \"<p>Type of callrequest<\\\/p>\"\n },\n \"request_status\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"request_address\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"request_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"pac\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"orig_address\": {\n \"type\": \"string\",\n \"description\": \"<p>User callrequest is for<\\\/p>\"\n },\n \"orig_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dest_address\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dest_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_of_request\": {\n \"type\": \"string\",\n \"description\": \"<p>Timestamp when the callrequest was created<\\\/p>\"\n },\n \"time_to_call\": {\n \"type\": \"string\",\n \"description\": \"<p>Timestamp when the callrequest will be executed<\\\/p>\"\n },\n \"message\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"retry\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"retry_period\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"confirm_required\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"geo\": {\n \"type\": \"string\",\n \"description\": \"<p>Whether or not the request has been replicated across geo<\\\/p>\"\n },\n \"adjTz\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"call_id\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_start\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_answer\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_release\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_confirm\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"ts\": {\n \"type\": \"string\",\n \"description\": \"<p>Timestamp when the callrequest was created<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['call_request'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callrequest&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Call Requests", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "request_id", "type": "text", "value": "{{readcall_request_request_id}}", "enabled": true }, { "key": "orig_address", "type": "text", "value": "{{readcall_request_orig_address}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{readcall_request_user}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readcall_request_domain}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Caller_ID_Emergency", "description": "", "item": [ { "name": "ReadCaller_ID_Emergency", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"callid\": {\n \"type\": \"string\",\n \"description\": \"<p>The caller ID available for emergency<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>The domain for the caller ID<\\\/p>\"\n },\n \"tag\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['caller_id_emergency'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callidemgr&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Emergency numbers for domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readcaller_id_emergency_domain}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Callqueueemailreport", "description": "", "item": [ { "name": "CreateCallqueueemailreport", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueueemailreport&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a email report request", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{createcallqueueemailreport_uid}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createcallqueueemailreport_domain}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{createcallqueueemailreport_type}}", "enabled": true }, { "key": "frequency", "type": "text", "value": "{{createcallqueueemailreport_frequency}}", "enabled": true }, { "key": "range_interval", "type": "text", "value": "{{createcallqueueemailreport_range_interval}}", "enabled": true }, { "key": "dom", "type": "text", "value": "{{createcallqueueemailreport_dom}}", "enabled": true }, { "key": "dow", "type": "text", "value": "{{createcallqueueemailreport_dow}}", "enabled": true }, { "key": "tod", "type": "text", "value": "{{createcallqueueemailreport_tod}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteCallqueueemailreport", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueueemailreport&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a email report request", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{deletecallqueueemailreport_uid}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletecallqueueemailreport_domain}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{deletecallqueueemailreport_type}}", "enabled": true }, { "key": "frequency", "type": "text", "value": "{{deletecallqueueemailreport_frequency}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadCallqueueemailreport", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['callqueueemailreport'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueueemailreport&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read a email report request", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{readcallqueueemailreport_uid}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readcallqueueemailreport_domain}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{readcallqueueemailreport_type}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateCallqueueemailreport", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=callqueueemailreport&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a email report request", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{updatecallqueueemailreport_uid}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatecallqueueemailreport_domain}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{updatecallqueueemailreport_type}}", "enabled": true }, { "key": "frequency", "type": "text", "value": "{{updatecallqueueemailreport_frequency}}", "enabled": true }, { "key": "range_interval", "type": "text", "value": "{{updatecallqueueemailreport_range_interval}}", "enabled": true }, { "key": "dom", "type": "text", "value": "{{updatecallqueueemailreport_dom}}", "enabled": true }, { "key": "dow", "type": "text", "value": "{{updatecallqueueemailreport_dow}}", "enabled": true }, { "key": "tod", "type": "text", "value": "{{updatecallqueueemailreport_tod}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Chart", "description": "", "item": [ { "name": "CountChart", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=chart&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Charts", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{countchart_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{countchart_domain}}", "enabled": true }, { "key": "dashboard_id", "type": "text", "value": "{{countchart_dashboard_id}}", "enabled": false }, { "key": "type", "type": "text", "value": "{{countchart_type}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateChart", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=chart&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create Chart in a Dashboard", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createchart_domain}}", "enabled": true }, { "key": "name", "type": "text", "value": "{{createchart_name}}", "enabled": true }, { "key": "dashboard_id", "type": "text", "value": "{{createchart_dashboard_id}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{createchart_type}}", "enabled": true }, { "key": "description", "type": "text", "value": "{{createchart_description}}", "enabled": false }, { "key": "properties", "type": "text", "value": "{{createchart_properties}}", "enabled": false }, { "key": "data_sources", "type": "text", "value": "{{createchart_data_sources}}", "enabled": false }, { "key": "status", "type": "text", "value": "{{createchart_status}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteChart", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=chart&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete Chart", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "id", "type": "text", "value": "{{deletechart_id}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletechart_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "ListChart", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"id\": {\n \"type\": \"number\",\n \"description\": \"<p>Unique ID of the chart<\\\/p>\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"<p>User provided name\\\/title of the chart<\\\/p>\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['chart'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=chart&action=list", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "List Charts", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{listchart_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{listchart_domain}}", "enabled": true }, { "key": "dashboard_id", "type": "text", "value": "{{listchart_dashboard_id}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadChart", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"id\": {\n \"type\": \"number\",\n \"description\": \"<p>Unique ID of the chart<\\\/p>\"\n },\n \"dashboard_id\": {\n \"type\": \"number\",\n \"description\": \"<p>Unique ID of the parent dashboard<\\\/p>\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"<p>User provided name\\\/title of the chart<\\\/p>\"\n },\n \"type\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"properties\": {\n \"type\": \"string\",\n \"description\": \"<p>JSON object which describes visual and functional properties of the chart<\\\/p>\"\n },\n \"data_sources\": {\n \"type\": \"string\",\n \"description\": \"<p>JSON object which describes the sources of the data to be visualized<\\\/p>\"\n },\n \"status\": {\n \"type\": \"number\",\n \"description\": \"\"\n },\n \"created\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"modified\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"data_token\": {\n \"type\": \"string\",\n \"description\": \"<p>A specially generated oauthtoken used to request data for the chart<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['chart'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=chart&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Charts", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{readchart_format}}", "enabled": false }, { "key": "dashboard_id", "type": "text", "value": "{{readchart_dashboard_id}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readchart_domain}}", "enabled": true }, { "key": "id", "type": "text", "value": "{{readchart_id}}", "enabled": false }, { "key": "name", "type": "text", "value": "{{readchart_name}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateChart", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=chart&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update Chart in a Dashboard", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "id", "type": "text", "value": "{{updatechart_id}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatechart_domain}}", "enabled": true }, { "key": "dashboard_id", "type": "text", "value": "{{updatechart_dashboard_id}}", "enabled": true }, { "key": "name", "type": "text", "value": "{{updatechart_name}}", "enabled": false }, { "key": "description", "type": "text", "value": "{{updatechart_description}}", "enabled": false }, { "key": "properties", "type": "text", "value": "{{updatechart_properties}}", "enabled": false }, { "key": "data_sources", "type": "text", "value": "{{updatechart_data_sources}}", "enabled": false }, { "key": "status", "type": "text", "value": "{{updatechart_status}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Conference", "description": "", "item": [ { "name": "CountConference", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of conferences under set parameters.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=conference&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Conferences", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{countconference_aor}}", "enabled": false }, { "key": "owner_domain", "type": "text", "value": "{{countconference_owner_domain}}", "enabled": true }, { "key": "owner_uid", "type": "text", "value": "{{countconference_owner_uid}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateConference", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=conference&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create the specified conference", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{createconference_aor}}", "enabled": true }, { "key": "owner_uid", "type": "text", "value": "{{createconference_owner_uid}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createconference_domain}}", "enabled": false }, { "key": "owner", "type": "text", "value": "{{createconference_owner}}", "enabled": false }, { "key": "extension", "type": "text", "value": "{{createconference_extension}}", "enabled": false }, { "key": "SipSipAuthUser", "type": "text", "value": "{{createconference_SipSipAuthUser}}", "enabled": false }, { "key": "SipSipAuthKey", "type": "text", "value": "{{createconference_SipSipAuthKey}}", "enabled": false }, { "key": "RegRequired", "type": "text", "value": "{{createconference_RegRequired}}", "enabled": false }, { "key": "save_participants", "type": "text", "value": "{{createconference_save_participants}}", "enabled": false }, { "key": "request_name", "type": "text", "value": "{{createconference_request_name}}", "enabled": false }, { "key": "annc_part", "type": "text", "value": "{{createconference_annc_part}}", "enabled": false }, { "key": "leader_req", "type": "text", "value": "{{createconference_leader_req}}", "enabled": false }, { "key": "termination_match", "type": "text", "value": "{{createconference_termination_match}}", "enabled": false }, { "key": "call_processing_rule", "type": "text", "value": "{{createconference_call_processing_rule}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteConference", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=conference&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete the specified conference", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{deleteconference_aor}}", "enabled": true }, { "key": "type", "type": "text", "value": "{{deleteconference_type}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadConference", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"aor\": {\n \"type\": \"string\",\n \"description\": \"<p>The address (name) of the conference bridge<\\\/p>\"\n },\n \"owner_domain\": {\n \"type\": \"string\",\n \"description\": \"<p>The owner's domain<\\\/p>\"\n },\n \"owner\": {\n \"type\": \"string\",\n \"description\": \"<p>Owner of the conference<\\\/p>\"\n },\n \"owner_uid\": {\n \"type\": \"string\",\n \"description\": \"<p>User ID of the Owner of the conference<\\\/p>\"\n },\n \"leader_pin\": {\n \"type\": \"string\",\n \"description\": \"<p>PIN of the leader<\\\/p>\"\n },\n \"speaker_pin\": {\n \"type\": \"string\",\n \"description\": \"<p>PIN of the speaker<\\\/p>\"\n },\n \"participants_pin\": {\n \"type\": \"string\",\n \"description\": \"<p>PIN of the participants<\\\/p>\"\n },\n \"num_participants\": {\n \"type\": \"string\",\n \"description\": \"<p>Number of participants<\\\/p>\"\n },\n \"max_participants\": {\n \"type\": \"string\",\n \"description\": \"<p>Max number of participants<\\\/p>\"\n },\n \"time_begin\": {\n \"type\": \"string\",\n \"description\": \"<p>Time conference began<\\\/p>\"\n },\n \"time_end\": {\n \"type\": \"string\",\n \"description\": \"<p>Time conference ended<\\\/p>\"\n },\n \"activate\": {\n \"type\": \"string\",\n \"description\": \"<p>If the bridge is enabled as of now<\\\/p>\"\n },\n \"annc_join\": {\n \"type\": \"string\",\n \"description\": \"<p>Audio file for arrival message<\\\/p>\"\n },\n \"annc_depart\": {\n \"type\": \"string\",\n \"description\": \"<p>Audio file for departure message<\\\/p>\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"<p>The plain english description of the conference bridge<\\\/p>\"\n },\n \"save_participants\": {\n \"type\": \"string\",\n \"description\": \"<p>If set to yes, the bridge will retain the participants for the bridge.<\\\/p>\"\n },\n \"request_name\": {\n \"type\": \"string\",\n \"description\": \"<p>If yes, the bridge will request the caller record their name before entering.<\\\/p>\"\n },\n \"lock_part\": {\n \"type\": \"string\",\n \"description\": \"<p>If set to yes, no additional parties will be able ot join the bridge.<\\\/p>\"\n },\n \"annc_part\": {\n \"type\": \"string\",\n \"description\": \"<p>If yes, the participants will be announced on entering the bridge.<\\\/p>\"\n },\n \"leader_required\": {\n \"type\": \"string\",\n \"description\": \"<p>If yes, the leader pin will be required to start the bridge<\\\/p>\"\n },\n \"quorum\": {\n \"type\": \"number\",\n \"description\": \"<p>The minimum number of participants to start the bridge.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['conference'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=conference&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Conferences in certain domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{readconference_aor}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readconference_domain}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{readconference_limit}}", "enabled": false }, { "key": "fields", "type": "text", "value": "{{readconference_fields}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{readconference_user}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readconference_start}}", "enabled": false }, { "key": "filter_bridges", "type": "text", "value": "{{readconference_filter_bridges}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateConference", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=conference&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update the specified conference", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{updateconference_aor}}", "enabled": true }, { "key": "owner_uid", "type": "text", "value": "{{updateconference_owner_uid}}", "enabled": false }, { "key": "owner", "type": "text", "value": "{{updateconference_owner}}", "enabled": false }, { "key": "owner_domain", "type": "text", "value": "{{updateconference_owner_domain}}", "enabled": false }, { "key": "save_participants", "type": "text", "value": "{{updateconference_save_participants}}", "enabled": false }, { "key": "request_name", "type": "text", "value": "{{updateconference_request_name}}", "enabled": false }, { "key": "annc_part", "type": "text", "value": "{{updateconference_annc_part}}", "enabled": false }, { "key": "leader_req", "type": "text", "value": "{{updateconference_leader_req}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Conference_Participant", "description": "", "item": [ { "name": "CreateConference_Participant", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=participant&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create participants from the specified conference", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "conference_match", "type": "text", "value": "{{createconference_participant_conference_match}}", "enabled": true }, { "key": "participant", "type": "text", "value": "{{createconference_participant_participant}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadConference_Participant", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['conference_participant'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=participant&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read participants from the specified conference", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "conference_match", "type": "text", "value": "{{readconference_participant_conference_match}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Conference_Record", "description": "", "item": [ { "name": "CdrConference_Record", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain conference is in<\\\/p>\"\n },\n \"conference\": {\n \"type\": \"string\",\n \"description\": \"<p>Conference<\\\/p>\"\n },\n \"conf_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Conference name<\\\/p>\"\n },\n \"conf_id\": {\n \"type\": \"string\",\n \"description\": \"<p>Conference ID<\\\/p>\"\n },\n \"time_begin\": {\n \"type\": \"string\",\n \"description\": \"<p>Time the conference began<\\\/p>\"\n },\n \"time_end\": {\n \"type\": \"string\",\n \"description\": \"<p>Time the conference ended<\\\/p>\"\n },\n \"duration\": {\n \"type\": \"string\",\n \"description\": \"<p>Duration of the conference<\\\/p>\"\n },\n \"participation_count\": {\n \"type\": \"string\",\n \"description\": \"<p>participation_count<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['conference_record'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=session_report&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read CDR for conference", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{cdrconference_record_aor}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{cdrconference_record_domain}}", "enabled": false }, { "key": "conference", "type": "text", "value": "{{cdrconference_record_conference}}", "enabled": true }, { "key": "include_particapants", "type": "text", "value": "{{cdrconference_record_include_particapants}}", "enabled": false }, { "key": "from", "type": "text", "value": "{{cdrconference_record_from}}", "enabled": false }, { "key": "to", "type": "text", "value": "{{cdrconference_record_to}}", "enabled": false }, { "key": "conf_id", "type": "text", "value": "{{cdrconference_record_conf_id}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Connection", "description": "", "item": [ { "name": "CountConnection", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Connections in the specified domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=connection&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Connections", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{countconnection_aor}}", "enabled": true }, { "key": "termination_match", "type": "text", "value": "{{countconnection_termination_match}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{countconnection_domain}}", "enabled": false }, { "key": "territory", "type": "text", "value": "{{countconnection_territory}}", "enabled": false }, { "key": "role", "type": "text", "value": "{{countconnection_role}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateConnection", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=connection&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a Connection", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{createconnection_aor}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createconnection_domain}}", "enabled": true }, { "key": "termination_match", "type": "text", "value": "{{createconnection_termination_match}}", "enabled": false }, { "key": "to_host_trans", "type": "text", "value": "{{createconnection_to_host_trans}}", "enabled": false }, { "key": "address", "type": "text", "value": "{{createconnection_address}}", "enabled": false }, { "key": "req_host_trans", "type": "text", "value": "{{createconnection_req_host_trans}}", "enabled": false }, { "key": "route", "type": "text", "value": "{{createconnection_route}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteConnection", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=connection&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a Connection", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{deleteconnection_aor}}", "enabled": true }, { "key": "termination_match", "type": "text", "value": "{{deleteconnection_termination_match}}", "enabled": false }, { "key": "isRoute", "type": "text", "value": "{{deleteconnection_isRoute}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadConnection", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"aor\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"role\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"termination_match\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"req_user_trans\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"req_host_trans\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"to_user_trans\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"to_host_trans\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"from_user_trans\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"from_host_trans\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"address\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"origination_allowed\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"termination_allowed\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"nat_wan\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"authenticate_invite\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"authentication_alg\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"auth_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"authentication_realm\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"authentication_key\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"registration_required\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"registration_time\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"registration_expires\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rate\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rate_account\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rate_max\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rate_ratio\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rate_margin\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"max_orig\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"max_term\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"max_total\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"min_orig_prd\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"min_term_prd\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"min_dura\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"nameout_dial_translation\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"out_dial_delay\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"out_dial_mode\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dial_plan\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dial_policy\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gmt_offset\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"time_zone\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"call_processing_rule\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"count_in\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"count_out\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"total_orig\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"total_term\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"period_orig\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"period_term\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"ts\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"mac\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['connection'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=connection&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Connections", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{readconnection_aor}}", "enabled": true }, { "key": "termination_match", "type": "text", "value": "{{readconnection_termination_match}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readconnection_domain}}", "enabled": false }, { "key": "territory", "type": "text", "value": "{{readconnection_territory}}", "enabled": false }, { "key": "routechain", "type": "text", "value": "{{readconnection_routechain}}", "enabled": false }, { "key": "role", "type": "text", "value": "{{readconnection_role}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateConnection", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=connection&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a Connection", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{updateconnection_aor}}", "enabled": true }, { "key": "termination_match", "type": "text", "value": "{{updateconnection_termination_match}}", "enabled": false }, { "key": "route", "type": "text", "value": "{{updateconnection_route}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{updateconnection_domain}}", "enabled": false }, { "key": "role", "type": "text", "value": "{{updateconnection_role}}", "enabled": false }, { "key": "req_user_trans", "type": "text", "value": "{{updateconnection_req_user_trans}}", "enabled": false }, { "key": "req_host_trans", "type": "text", "value": "{{updateconnection_req_host_trans}}", "enabled": false }, { "key": "to_user_trans", "type": "text", "value": "{{updateconnection_to_user_trans}}", "enabled": false }, { "key": "to_host_trans", "type": "text", "value": "{{updateconnection_to_host_trans}}", "enabled": false }, { "key": "from_user_trans", "type": "text", "value": "{{updateconnection_from_user_trans}}", "enabled": false }, { "key": "from_host_trans", "type": "text", "value": "{{updateconnection_from_host_trans}}", "enabled": false }, { "key": "address", "type": "text", "value": "{{updateconnection_address}}", "enabled": false }, { "key": "origination_allowed", "type": "text", "value": "{{updateconnection_origination_allowed}}", "enabled": false }, { "key": "termination_allowed", "type": "text", "value": "{{updateconnection_termination_allowed}}", "enabled": false }, { "key": "nat_wan", "type": "text", "value": "{{updateconnection_nat_wan}}", "enabled": false }, { "key": "authenticate_invite", "type": "text", "value": "{{updateconnection_authenticate_invite}}", "enabled": false }, { "key": "authentication_alg", "type": "text", "value": "{{updateconnection_authentication_alg}}", "enabled": false }, { "key": "auth_user", "type": "text", "value": "{{updateconnection_auth_user}}", "enabled": false }, { "key": "authentication_realm", "type": "text", "value": "{{updateconnection_authentication_realm}}", "enabled": false }, { "key": "authentication_key", "type": "text", "value": "{{updateconnection_authentication_key}}", "enabled": false }, { "key": "registration_required", "type": "text", "value": "{{updateconnection_registration_required}}", "enabled": false }, { "key": "registration_time", "type": "text", "value": "{{updateconnection_registration_time}}", "enabled": false }, { "key": "registration_expires", "type": "text", "value": "{{updateconnection_registration_expires}}", "enabled": false }, { "key": "rate", "type": "text", "value": "{{updateconnection_rate}}", "enabled": false }, { "key": "rate_account", "type": "text", "value": "{{updateconnection_rate_account}}", "enabled": false }, { "key": "rate_max", "type": "text", "value": "{{updateconnection_rate_max}}", "enabled": false }, { "key": "rate_ratio", "type": "text", "value": "{{updateconnection_rate_ratio}}", "enabled": false }, { "key": "rate_margin", "type": "text", "value": "{{updateconnection_rate_margin}}", "enabled": false }, { "key": "max_orig", "type": "text", "value": "{{updateconnection_max_orig}}", "enabled": false }, { "key": "max_term", "type": "text", "value": "{{updateconnection_max_term}}", "enabled": false }, { "key": "max_total", "type": "text", "value": "{{updateconnection_max_total}}", "enabled": false }, { "key": "min_orig_prd", "type": "text", "value": "{{updateconnection_min_orig_prd}}", "enabled": false }, { "key": "min_term_prd", "type": "text", "value": "{{updateconnection_min_term_prd}}", "enabled": false }, { "key": "min_dura", "type": "text", "value": "{{updateconnection_min_dura}}", "enabled": false }, { "key": "nameout_dial_translation", "type": "text", "value": "{{updateconnection_nameout_dial_translation}}", "enabled": false }, { "key": "out_dial_delay", "type": "text", "value": "{{updateconnection_out_dial_delay}}", "enabled": false }, { "key": "out_dial_mode", "type": "text", "value": "{{updateconnection_out_dial_mode}}", "enabled": false }, { "key": "dial_plan", "type": "text", "value": "{{updateconnection_dial_plan}}", "enabled": false }, { "key": "dial_policy", "type": "text", "value": "{{updateconnection_dial_policy}}", "enabled": false }, { "key": "gmt_offset", "type": "text", "value": "{{updateconnection_gmt_offset}}", "enabled": false }, { "key": "time_zone", "type": "text", "value": "{{updateconnection_time_zone}}", "enabled": false }, { "key": "call_processing_rule", "type": "text", "value": "{{updateconnection_call_processing_rule}}", "enabled": false }, { "key": "description", "type": "text", "value": "{{updateconnection_description}}", "enabled": false }, { "key": "count_in", "type": "text", "value": "{{updateconnection_count_in}}", "enabled": false }, { "key": "count_out", "type": "text", "value": "{{updateconnection_count_out}}", "enabled": false }, { "key": "total_orig", "type": "text", "value": "{{updateconnection_total_orig}}", "enabled": false }, { "key": "total_term", "type": "text", "value": "{{updateconnection_total_term}}", "enabled": false }, { "key": "period_orig", "type": "text", "value": "{{updateconnection_period_orig}}", "enabled": false }, { "key": "period_term", "type": "text", "value": "{{updateconnection_period_term}}", "enabled": false }, { "key": "ts", "type": "text", "value": "{{updateconnection_ts}}", "enabled": false }, { "key": "mac", "type": "text", "value": "{{updateconnection_mac}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Contact", "description": "", "item": [ { "name": "CountContact", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Contacts in the specified Domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=contact&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Contacts", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countcontact_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{countcontact_user}}", "enabled": true }, { "key": "first_name", "type": "text", "value": "{{countcontact_first_name}}", "enabled": false }, { "key": "last_name", "type": "text", "value": "{{countcontact_last_name}}", "enabled": false }, { "key": "contact_id", "type": "text", "value": "{{countcontact_contact_id}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateContact", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=contact&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a Contact", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createcontact_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{createcontact_user}}", "enabled": true }, { "key": "first_name", "type": "text", "value": "{{createcontact_first_name}}", "enabled": true }, { "key": "last_name", "type": "text", "value": "{{createcontact_last_name}}", "enabled": true }, { "key": "home_phone", "type": "text", "value": "{{createcontact_home_phone}}", "enabled": false }, { "key": "cell_phone", "type": "text", "value": "{{createcontact_cell_phone}}", "enabled": false }, { "key": "work_phone", "type": "text", "value": "{{createcontact_work_phone}}", "enabled": false }, { "key": "email", "type": "text", "value": "{{createcontact_email}}", "enabled": false }, { "key": "fax", "type": "text", "value": "{{createcontact_fax}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteContact", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=contact&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a Contact", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletecontact_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{deletecontact_user}}", "enabled": true }, { "key": "first_name", "type": "text", "value": "{{deletecontact_first_name}}", "enabled": true }, { "key": "last_name", "type": "text", "value": "{{deletecontact_last_name}}", "enabled": true }, { "key": "contact_id", "type": "text", "value": "{{deletecontact_contact_id}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadContact", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"middle_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"company\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"work_phone\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"cell_phone\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"home_phone\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"tags\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"ts\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['contact'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=contact&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Contacts", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readcontact_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{readcontact_user}}", "enabled": true }, { "key": "first_name", "type": "text", "value": "{{readcontact_first_name}}", "enabled": false }, { "key": "last_name", "type": "text", "value": "{{readcontact_last_name}}", "enabled": false }, { "key": "tags", "type": "text", "value": "{{readcontact_tags}}", "enabled": false }, { "key": "includeDomain", "type": "text", "value": "{{readcontact_includeDomain}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readcontact_limit}}", "enabled": false }, { "key": "department", "type": "text", "value": "{{readcontact_department}}", "enabled": false }, { "key": "order", "type": "text", "value": "{{readcontact_order}}", "enabled": false }, { "key": "contact_id", "type": "text", "value": "{{readcontact_contact_id}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateContact", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=contact&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update Contacts", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatecontact_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updatecontact_user}}", "enabled": true }, { "key": "first_name", "type": "text", "value": "{{updatecontact_first_name}}", "enabled": true }, { "key": "last_name", "type": "text", "value": "{{updatecontact_last_name}}", "enabled": true }, { "key": "company", "type": "text", "value": "{{updatecontact_company}}", "enabled": false }, { "key": "work_phone", "type": "text", "value": "{{updatecontact_work_phone}}", "enabled": false }, { "key": "cell_phone", "type": "text", "value": "{{updatecontact_cell_phone}}", "enabled": false }, { "key": "fax", "type": "text", "value": "{{updatecontact_fax}}", "enabled": false }, { "key": "email", "type": "text", "value": "{{updatecontact_email}}", "enabled": false }, { "key": "home_phone", "type": "text", "value": "{{updatecontact_home_phone}}", "enabled": false }, { "key": "time_answer", "type": "text", "value": "{{updatecontact_time_answer}}", "enabled": false }, { "key": "tags", "type": "text", "value": "{{updatecontact_tags}}", "enabled": false }, { "key": "ts", "type": "text", "value": "{{updatecontact_ts}}", "enabled": false }, { "key": "contact_id", "type": "text", "value": "{{updatecontact_contact_id}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Dashboard", "description": "", "item": [ { "name": "CountDashboard", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dashboard&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Dashboard in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{countdashboard_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{countdashboard_domain}}", "enabled": false }, { "key": "owner_id", "type": "text", "value": "{{countdashboard_owner_id}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateDashboard", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dashboard&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create Dashboard in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "name", "type": "text", "value": "{{createdashboard_name}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createdashboard_domain}}", "enabled": true }, { "key": "description", "type": "text", "value": "{{createdashboard_description}}", "enabled": false }, { "key": "properties", "type": "text", "value": "{{createdashboard_properties}}", "enabled": false }, { "key": "layouts", "type": "text", "value": "{{createdashboard_layouts}}", "enabled": false }, { "key": "owner_type", "type": "text", "value": "{{createdashboard_owner_type}}", "enabled": false }, { "key": "owner_id", "type": "text", "value": "{{createdashboard_owner_id}}", "enabled": false }, { "key": "status", "type": "text", "value": "{{createdashboard_status}}", "enabled": false }, { "key": "share_type", "type": "text", "value": "{{createdashboard_share_type}}", "enabled": false }, { "key": "share_details", "type": "text", "value": "{{createdashboard_share_details}}", "enabled": false }, { "key": "public_id", "type": "text", "value": "{{createdashboard_public_id}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteDashboard", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dashboard&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete Dashboard in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "id", "type": "text", "value": "{{deletedashboard_id}}", "enabled": true } ] } }, "response": [] }, { "name": "FavoriteDashboard", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['dashboard'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dashboard&action=favorite", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Toggle Dashboard as a Favorite", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "dashboard_id", "type": "text", "value": "{{favoritedashboard_dashboard_id}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{favoritedashboard_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "HideDashboard", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['dashboard'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dashboard&action=hide", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Toggle Dashboard Visibility", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "dashboard_id", "type": "text", "value": "{{hidedashboard_dashboard_id}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{hidedashboard_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "ListDashboard", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"id\": {\n \"type\": \"number\",\n \"description\": \"<p>Unique ID of the dashboard<\\\/p>\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"<p>User provided name\\\/title of the dashboard<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"owner_type\": {\n \"type\": \"number\",\n \"description\": \"<p>Owner type of the board (1: User, 2: Domain)<\\\/p>\"\n },\n \"owner_id\": {\n \"type\": \"string\",\n \"description\": \"<p>Owner id of the board (1: uid, 2: aor_host)<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['dashboard'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dashboard&action=list", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "List Dashboards in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{listdashboard_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{listdashboard_domain}}", "enabled": true }, { "key": "owner_id", "type": "text", "value": "{{listdashboard_owner_id}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadDashboard", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"id\": {\n \"type\": \"number\",\n \"description\": \"<p>Unique ID of the dashboard<\\\/p>\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"<p>User provided name\\\/title of the dashboard<\\\/p>\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"properties\": {\n \"type\": \"string\",\n \"description\": \"<p>JSON object describing the visual and dynamic properties of the dashboard<\\\/p>\"\n },\n \"layouts\": {\n \"type\": \"string\",\n \"description\": \"<p>JSON object describing the grid layout of the dashboard's cards<\\\/p>\"\n },\n \"owner_type\": {\n \"type\": \"number\",\n \"description\": \"<p>Owner type of the board (1: User, 2: Domain)<\\\/p>\"\n },\n \"owner_id\": {\n \"type\": \"string\",\n \"description\": \"<p>Owner id of the board (1: uid, 2: aor_host)<\\\/p>\"\n },\n \"status\": {\n \"type\": \"number\",\n \"description\": \"\"\n },\n \"share_type\": {\n \"type\": \"string\",\n \"description\": \"<p>The sharing behavior of the dashboard ('select': user defined access rules, 'domain': allow all domain users)<\\\/p>\"\n },\n \"share_details\": {\n \"type\": \"string\",\n \"description\": \"<p>JSON object describing the user defined access rules<\\\/p>\"\n },\n \"public_id\": {\n \"type\": \"string\",\n \"description\": \"<p>The unique public id used for public share links<\\\/p>\"\n },\n \"created\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"modified\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['dashboard'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dashboard&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Dashboard in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{readdashboard_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readdashboard_domain}}", "enabled": true }, { "key": "id", "type": "text", "value": "{{readdashboard_id}}", "enabled": false }, { "key": "name", "type": "text", "value": "{{readdashboard_name}}", "enabled": false }, { "key": "owner_id", "type": "text", "value": "{{readdashboard_owner_id}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateDashboard", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dashboard&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update Dashboard in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "id", "type": "text", "value": "{{updatedashboard_id}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatedashboard_domain}}", "enabled": true }, { "key": "name", "type": "text", "value": "{{updatedashboard_name}}", "enabled": false }, { "key": "description", "type": "text", "value": "{{updatedashboard_description}}", "enabled": false }, { "key": "properties", "type": "text", "value": "{{updatedashboard_properties}}", "enabled": false }, { "key": "layouts", "type": "text", "value": "{{updatedashboard_layouts}}", "enabled": false }, { "key": "owner_type", "type": "text", "value": "{{updatedashboard_owner_type}}", "enabled": false }, { "key": "owner_id", "type": "text", "value": "{{updatedashboard_owner_id}}", "enabled": false }, { "key": "status", "type": "text", "value": "{{updatedashboard_status}}", "enabled": false }, { "key": "share_type", "type": "text", "value": "{{updatedashboard_share_type}}", "enabled": false }, { "key": "share_details", "type": "text", "value": "{{updatedashboard_share_details}}", "enabled": false }, { "key": "public_id", "type": "text", "value": "{{updatedashboard_public_id}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Default", "description": "", "item": [ { "name": "ReadDefault", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"field_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of the field<\\\/p>\"\n },\n \"default_value\": {\n \"type\": \"string\",\n \"description\": \"<p>Value for the default<\\\/p>\"\n },\n \"table_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Table name<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain of Default<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['default'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=defaultvalue&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read a Default value", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readdefault_domain}}", "enabled": false }, { "key": "table_name", "type": "text", "value": "{{readdefault_table_name}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Department", "description": "", "item": [ { "name": "CreateDepartment", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=subscriber&action=create&directory_match=departments", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a new Department", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "user", "type": "text", "value": "{{createdepartment_user}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createdepartment_domain}}", "enabled": true }, { "key": "directory_match", "type": "text", "value": "{{createdepartment_directory_match}}", "enabled": false }, { "key": "first_name", "type": "text", "value": "{{createdepartment_first_name}}", "enabled": false }, { "key": "last_name", "type": "text", "value": "{{createdepartment_last_name}}", "enabled": false }, { "key": "dir_list", "type": "text", "value": "{{createdepartment_dir_list}}", "enabled": false }, { "key": "dir_anc", "type": "text", "value": "{{createdepartment_dir_anc}}", "enabled": false }, { "key": "srv_code", "type": "text", "value": "{{createdepartment_srv_code}}", "enabled": false }, { "key": "passwordLength", "type": "text", "value": "{{createdepartment_passwordLength}}", "enabled": false }, { "key": "pwd_hash", "type": "text", "value": "{{createdepartment_pwd_hash}}", "enabled": false }, { "key": "subscriber_pin", "type": "text", "value": "{{createdepartment_subscriber_pin}}", "enabled": false } ] } }, "response": [] }, { "name": "ListDepartment", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['department'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=department&action=list", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "List Departments in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{listdepartment_domain}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Device", "description": "", "item": [ { "name": "CountDevice", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Devices for the specified Domain\\\/User.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=device&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Devices for a Domain\/User", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countdevice_domain}}", "enabled": true }, { "key": "territory", "type": "text", "value": "{{countdevice_territory}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{countdevice_user}}", "enabled": false }, { "key": "aor", "type": "text", "value": "{{countdevice_aor}}", "enabled": false }, { "key": "device", "type": "text", "value": "{{countdevice_device}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{countdevice_limit}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{countdevice_start}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{countdevice_sort}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateDevice", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=device&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a Device\/Subscriber", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createdevice_domain}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{createdevice_device}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{createdevice_user}}", "enabled": true }, { "key": "mac", "type": "text", "value": "{{createdevice_mac}}", "enabled": true }, { "key": "model", "type": "text", "value": "{{createdevice_model}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteDevice", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=device&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a Device\/Subscriber", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "device", "type": "text", "value": "{{deletedevice_device}}", "enabled": true }, { "key": "termination_match", "type": "text", "value": "{{deletedevice_termination_match}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadDevice", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"aor\": {\n \"type\": \"string\",\n \"description\": \"<p>AOR<\\\/p>\"\n },\n \"mac\": {\n \"type\": \"string\",\n \"description\": \"<p>MAC Address<\\\/p>\"\n },\n \"model\": {\n \"type\": \"string\",\n \"description\": \"<p>Brand and model<\\\/p>\"\n },\n \"aor_user\": {\n \"type\": \"string\",\n \"description\": \"<p>AOR User<\\\/p>\"\n },\n \"mode\": {\n \"type\": \"string\",\n \"description\": \"<p>Mode<\\\/p>\"\n },\n \"server\": {\n \"type\": \"string\",\n \"description\": \"<p>Preferred Server<\\\/p>\"\n },\n \"user_agent\": {\n \"type\": \"string\",\n \"description\": \"<p>User Agent<\\\/p>\"\n },\n \"contact\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"received_from\": {\n \"type\": \"string\",\n \"description\": \"<p>Where Received From<\\\/p>\"\n },\n \"registration_time\": {\n \"type\": \"string\",\n \"description\": \"<p>Time of Registration<\\\/p>\"\n },\n \"expires\": {\n \"type\": \"string\",\n \"description\": \"<p>Time to Expiration<\\\/p>\"\n },\n \"registration_expires_time\": {\n \"type\": \"string\",\n \"description\": \"<p>Registration Expiration Time<\\\/p>\"\n },\n \"subscriber_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of Subscriber<\\\/p>\"\n },\n \"subscriber_domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain of Subscriber<\\\/p>\"\n },\n \"authentication_key\": {\n \"type\": \"string\",\n \"description\": \"<p>Authentication Key\\\/Password<\\\/p>\"\n },\n \"transport\": {\n \"type\": \"string\",\n \"description\": \"<p>The transport type for the device if configured through the NDP<\\\/p>\"\n },\n \"overrides\": {\n \"type\": \"string\",\n \"description\": \"<p>Custom Configuration Overrides<\\\/p>\"\n },\n \"call_processing_rule\": {\n \"type\": \"string\",\n \"description\": \"<p>Call Processing Rule<\\\/p>\"\n },\n \"callid_emgr\": {\n \"type\": \"string\",\n \"description\": \"<p>Caller ID for Emergency Calls<\\\/p>\"\n },\n \"line\": {\n \"type\": \"string\",\n \"description\": \"<p>Line assignment<\\\/p>\"\n },\n \"auth_user\": {\n \"type\": \"string\",\n \"description\": \"<p>Device Authorization User<\\\/p>\"\n },\n \"auth_pass\": {\n \"type\": \"string\",\n \"description\": \"<p>Device Authorization Password<\\\/p>\"\n },\n \"sub_fullname\": {\n \"type\": \"string\",\n \"description\": \"<p>Fullname of Subscriber<\\\/p>\"\n },\n \"sub_scope\": {\n \"type\": \"string\",\n \"description\": \"<p>Scope of Subscriber<\\\/p>\"\n },\n \"sub_login\": {\n \"type\": \"string\",\n \"description\": \"<p>Login of Subscriber<\\\/p>\"\n },\n \"ndperror\": {\n \"type\": \"string\",\n \"description\": \"<p>NDP Error<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['device'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=device&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Devices for a Domain\/Subscriber", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readdevice_domain}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{readdevice_device}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{readdevice_user}}", "enabled": false }, { "key": "owner", "type": "text", "value": "{{readdevice_owner}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readdevice_start}}", "enabled": false }, { "key": "mode", "type": "text", "value": "{{readdevice_mode}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readdevice_limit}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{readdevice_sort}}", "enabled": false }, { "key": "list", "type": "text", "value": "{{readdevice_list}}", "enabled": false }, { "key": "fields", "type": "text", "value": "{{readdevice_fields}}", "enabled": false }, { "key": "filters", "type": "text", "value": "{{readdevice_filters}}", "enabled": false }, { "key": "noNDP", "type": "text", "value": "{{readdevice_noNDP}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateDevice", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=device&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a Device", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "device", "type": "text", "value": "{{updatedevice_device}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatedevice_domain}}", "enabled": false }, { "key": "check-sync", "type": "text", "value": "{{updatedevice_check-sync}}", "enabled": false }, { "key": "evtCheckSync", "type": "text", "value": "{{updatedevice_evtCheckSync}}", "enabled": false }, { "key": "mac", "type": "text", "value": "{{updatedevice_mac}}", "enabled": false }, { "key": "transport", "type": "text", "value": "{{updatedevice_transport}}", "enabled": true }, { "key": "model", "type": "text", "value": "{{updatedevice_model}}", "enabled": false }, { "key": "mode", "type": "text", "value": "{{updatedevice_mode}}", "enabled": false }, { "key": "user_agent", "type": "text", "value": "{{updatedevice_user_agent}}", "enabled": false }, { "key": "accept_agent", "type": "text", "value": "{{updatedevice_accept_agent}}", "enabled": false }, { "key": "received_from", "type": "text", "value": "{{updatedevice_received_from}}", "enabled": false }, { "key": "registration_time", "type": "text", "value": "{{updatedevice_registration_time}}", "enabled": false }, { "key": "subscriber_name", "type": "text", "value": "{{updatedevice_subscriber_name}}", "enabled": false }, { "key": "subscriber_domain", "type": "text", "value": "{{updatedevice_subscriber_domain}}", "enabled": false }, { "key": "authentication_key", "type": "text", "value": "{{updatedevice_authentication_key}}", "enabled": false }, { "key": "call_processing_rule", "type": "text", "value": "{{updatedevice_call_processing_rule}}", "enabled": false }, { "key": "registration_expires_time", "type": "text", "value": "{{updatedevice_registration_expires_time}}", "enabled": false }, { "key": "sub_fullname", "type": "text", "value": "{{updatedevice_sub_fullname}}", "enabled": false }, { "key": "sub_scope", "type": "text", "value": "{{updatedevice_sub_scope}}", "enabled": false }, { "key": "sub_login", "type": "text", "value": "{{updatedevice_sub_login}}", "enabled": false }, { "key": "ndperror", "type": "text", "value": "{{updatedevice_ndperror}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Device_Model", "description": "", "item": [ { "name": "ReadDevice_Model", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['device_model'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=devicemodel&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read a list of supported devices available for provisioning", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "brand", "type": "text", "value": "{{readdevice_model_brand}}", "enabled": false }, { "key": "model", "type": "text", "value": "{{readdevice_model_model}}", "enabled": false }, { "key": "portal_view", "type": "text", "value": "{{readdevice_model_portal_view}}", "enabled": false }, { "key": "include_ndp_defs", "type": "text", "value": "{{readdevice_model_include_ndp_defs}}", "enabled": false }, { "key": "ndp_syntax", "type": "text", "value": "{{readdevice_model_ndp_syntax}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Device_Profile", "description": "", "item": [ { "name": "CountDevice_Profile", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Deviceprofile in the specified domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=deviceprofile&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Device Profiles", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{countdevice_profile_territory}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateDevice_Profile", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=deviceprofile&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a Device Profile", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{createdevice_profile_territory}}", "enabled": true }, { "key": "description", "type": "text", "value": "{{createdevice_profile_description}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteDevice_Profile", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agent&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a Device Profile", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletedevice_profile_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{deletedevice_profile_queue}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{deletedevice_profile_device}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadDevice_Profile", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['device_profile'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=deviceprofile&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Device Profiles", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{readdevice_profile_territory}}", "enabled": false }, { "key": "device_type", "type": "text", "value": "{{readdevice_profile_device_type}}", "enabled": false }, { "key": "brand", "type": "text", "value": "{{readdevice_profile_brand}}", "enabled": false }, { "key": "model", "type": "text", "value": "{{readdevice_profile_model}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadImageDevice_Profile", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['device_profile'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=image&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read\/View a Device Profile Image", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "filename", "type": "text", "value": "{{readimagedevice_profile_filename}}", "enabled": true }, { "key": "server", "type": "text", "value": "{{readimagedevice_profile_server}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readimagedevice_profile_domain}}", "enabled": false }, { "key": "territory", "type": "text", "value": "{{readimagedevice_profile_territory}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Dial_Plan", "description": "", "item": [ { "name": "CreateDial_Plan", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialplan&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a Dialplan", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createdial_plan_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{createdial_plan_dialplan}}", "enabled": true }, { "key": "plan_description", "type": "text", "value": "{{createdial_plan_plan_description}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteDial_Plan", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialrule&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a Dial Rule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletedial_plan_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{deletedial_plan_dialplan}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadDial_Plan", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>The domain owning the table, also * and admin-only because they have access to use<\\\/p>\"\n },\n \"dialplan\": {\n \"type\": \"string\",\n \"description\": \"<p>The plans name<\\\/p>\"\n },\n \"plan_description\": {\n \"type\": \"string\",\n \"description\": \"<p>A plain english discription of the plan.<\\\/p>\"\n },\n \"dialplan_id\": {\n \"type\": \"string\",\n \"description\": \"<p>Ignore - Not needed and no meaning<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['dial_plan'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialplan&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Dial Plans", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{readdial_plan_dialplan}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readdial_plan_domain}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Dial_Policy", "description": "", "item": [ { "name": "ReadDial_Policy", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"dialpolicy_id\": {\n \"type\": \"string\",\n \"description\": \"<p>Ignore not used<\\\/p>\"\n },\n \"dialpolicy\": {\n \"type\": \"string\",\n \"description\": \"<p>The name of the Dialpolicy (permission)<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain owning the Dialpolicy &quot;*&quot; available for shared policies.<\\\/p>\"\n },\n \"policy_description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['dial_policy'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialpolicy&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Dial policy\/permissions", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readdial_policy_domain}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Dial_Rule", "description": "", "item": [ { "name": "CountDial_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialrule&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Dial Rules in a Dial Plan", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countdial_rule_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{countdial_rule_dialplan}}", "enabled": true } ] } }, "response": [] }, { "name": "CreateDial_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialrule&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a Dial Rule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createdial_rule_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{createdial_rule_dialplan}}", "enabled": true }, { "key": "matchrule", "type": "text", "value": "{{createdial_rule_matchrule}}", "enabled": true }, { "key": "to_user", "type": "text", "value": "{{createdial_rule_to_user}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteDial_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialrule&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a Dial Rule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletedial_rule_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{deletedial_rule_dialplan}}", "enabled": true }, { "key": "matchrule", "type": "text", "value": "{{deletedial_rule_matchrule}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadDial_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"matchrule\": {\n \"type\": \"string\",\n \"description\": \"<p>Destination<\\\/p>\"\n },\n \"match_from\": {\n \"type\": \"string\",\n \"description\": \"<p>Source<\\\/p>\"\n },\n \"dow\": {\n \"type\": \"string\",\n \"description\": \"<p>Days of week<\\\/p>\"\n },\n \"tod_from\": {\n \"type\": \"string\",\n \"description\": \"<p>Time of Dial<\\\/p>\"\n },\n \"tod_to\": {\n \"type\": \"string\",\n \"description\": \"<p>Time of Dial<\\\/p>\"\n },\n \"valid_from\": {\n \"type\": \"string\",\n \"description\": \"<p>Starting date Dialrule is valid<\\\/p>\"\n },\n \"valid_to\": {\n \"type\": \"string\",\n \"description\": \"<p>End date Dialrule is valid<\\\/p>\"\n },\n \"responder\": {\n \"type\": \"string\",\n \"description\": \"<p>Application<\\\/p>\"\n },\n \"parameter\": {\n \"type\": \"string\",\n \"description\": \"<p>Application parameter<\\\/p>\"\n },\n \"to_scheme\": {\n \"type\": \"string\",\n \"description\": \"<p>Destination scheme translation<\\\/p>\"\n },\n \"to_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"to_host\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"from_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"from_scheme\": {\n \"type\": \"string\",\n \"description\": \"<p>Protocol used by sender (ex. 'sip:')???<\\\/p>\"\n },\n \"from_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"from_host\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dialplan\": {\n \"type\": \"string\",\n \"description\": \"<p>Dialplan to which Dialrule belongs.<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain to which Dialplan containing Dialrule belongs.<\\\/p>\"\n },\n \"plan_description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description for Dialrule<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['dial_rule'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialrule&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Dial Rules in a Dial Plan", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readdial_rule_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{readdial_rule_dialplan}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateDial_Rule", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=dialrule&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a Dial Rule", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatedial_rule_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{updatedial_rule_dialplan}}", "enabled": true }, { "key": "matchrule", "type": "text", "value": "{{updatedial_rule_matchrule}}", "enabled": true }, { "key": "dow", "type": "text", "value": "{{updatedial_rule_dow}}", "enabled": false }, { "key": "tod_from", "type": "text", "value": "{{updatedial_rule_tod_from}}", "enabled": false }, { "key": "tod_to", "type": "text", "value": "{{updatedial_rule_tod_to}}", "enabled": false }, { "key": "responder", "type": "text", "value": "{{updatedial_rule_responder}}", "enabled": false }, { "key": "parameter", "type": "text", "value": "{{updatedial_rule_parameter}}", "enabled": false }, { "key": "to_scheme", "type": "text", "value": "{{updatedial_rule_to_scheme}}", "enabled": false }, { "key": "to_user", "type": "text", "value": "{{updatedial_rule_to_user}}", "enabled": false }, { "key": "to_host", "type": "text", "value": "{{updatedial_rule_to_host}}", "enabled": false }, { "key": "from_name", "type": "text", "value": "{{updatedial_rule_from_name}}", "enabled": false }, { "key": "from_scheme", "type": "text", "value": "{{updatedial_rule_from_scheme}}", "enabled": false }, { "key": "from_user", "type": "text", "value": "{{updatedial_rule_from_user}}", "enabled": false }, { "key": "from_host", "type": "text", "value": "{{updatedial_rule_from_host}}", "enabled": false }, { "key": "plan_description", "type": "text", "value": "{{updatedial_rule_plan_description}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Domain", "description": "", "item": [ { "name": "CountDomain", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Domains in the specified domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=domain&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count the number of Domains", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countdomain_domain}}", "enabled": false }, { "key": "territory", "type": "text", "value": "{{countdomain_territory}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateDomain", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=domain&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a new Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createdomain_domain}}", "enabled": true }, { "key": "territory", "type": "text", "value": "{{createdomain_territory}}", "enabled": true }, { "key": "description", "type": "text", "value": "{{createdomain_description}}", "enabled": false }, { "key": "call_limit", "type": "text", "value": "{{createdomain_call_limit}}", "enabled": false }, { "key": "call_limit_ext", "type": "text", "value": "{{createdomain_call_limit_ext}}", "enabled": false }, { "key": "max_user", "type": "text", "value": "{{createdomain_max_user}}", "enabled": false }, { "key": "max_call_queue", "type": "text", "value": "{{createdomain_max_call_queue}}", "enabled": false }, { "key": "max_aa", "type": "text", "value": "{{createdomain_max_aa}}", "enabled": false }, { "key": "max_conference", "type": "text", "value": "{{createdomain_max_conference}}", "enabled": false }, { "key": "max_department", "type": "text", "value": "{{createdomain_max_department}}", "enabled": false }, { "key": "max_site", "type": "text", "value": "{{createdomain_max_site}}", "enabled": false }, { "key": "max_device", "type": "text", "value": "{{createdomain_max_device}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteDomain", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=domain&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete an existing Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletedomain_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadDomain", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of Domain.<\\\/p>\"\n },\n \"Territory\": {\n \"type\": \"string\",\n \"description\": \"<p>Territory\\\/Reseller for the Domain.<\\\/p>\"\n },\n \"dial_match\": {\n \"type\": \"string\",\n \"description\": \"<p>(deprecated)<\\\/p>\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description for the Domain.<\\\/p>\"\n },\n \"moh\": {\n \"type\": \"string\",\n \"description\": \"<p>Music on hold<\\\/p>\"\n },\n \"mor\": {\n \"type\": \"string\",\n \"description\": \"<p>Music on ring<\\\/p>\"\n },\n \"mot\": {\n \"type\": \"string\",\n \"description\": \"<p>Music on transfer (deprecated)<\\\/p>\"\n },\n \"rmoh\": {\n \"type\": \"string\",\n \"description\": \"<p>Randomize Music on hold<\\\/p>\"\n },\n \"rating\": {\n \"type\": \"string\",\n \"description\": \"<p>Call Rating Prepaid (deprecated)<\\\/p>\"\n },\n \"resi\": {\n \"type\": \"string\",\n \"description\": \"<p>Residential Domain, Limited business features<\\\/p>\"\n },\n \"mksdir\": {\n \"type\": \"string\",\n \"description\": \"<p>Setup file structure for Users (should always be yes).<\\\/p>\"\n },\n \"dial_plan\": {\n \"type\": \"string\",\n \"description\": \"<p>Default DialPlan for the Domain.<\\\/p>\"\n },\n \"dial_policy\": {\n \"type\": \"string\",\n \"description\": \"<p>Default Dial Permission for the Domain.<\\\/p>\"\n },\n \"call_limit\": {\n \"type\": \"number\",\n \"description\": \"<p>The active Call Limit for this Domain.<\\\/p>\"\n },\n \"call_limit_ext\": {\n \"type\": \"string\",\n \"description\": \"<p>The Call Limit for external calls.<\\\/p>\"\n },\n \"sub_limit\": {\n \"type\": \"string\",\n \"description\": \"<p>Subscriber limit (includes system users)<\\\/p>\"\n },\n \"time_zone\": {\n \"type\": \"string\",\n \"description\": \"<p>Timezone for domain<\\\/p>\"\n },\n \"max_user\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum user count that the Domain can have.<\\\/p>\"\n },\n \"max_call_queue\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum call queue count that the Domain can have.<\\\/p>\"\n },\n \"max_aa\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum Auto Attendant count that the Domain can have.<\\\/p>\"\n },\n \"max_conference\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum conference bridge count that the Domain can have.<\\\/p>\"\n },\n \"max_department\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum department count that the Domain can have.<\\\/p>\"\n },\n \"max_site\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum site count that the Domain can have.<\\\/p>\"\n },\n \"max_device\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum device count per user.<\\\/p>\"\n },\n \"policies\": {\n \"type\": \"string\",\n \"description\": \"<p>Policy on the Domain active\\\/locked.<\\\/p>\"\n },\n \"email_sender\": {\n \"type\": \"string\",\n \"description\": \"<p>Email address use as 'from' address for system-dispatched emails.<\\\/p>\"\n },\n \"callid_nmbr\": {\n \"type\": \"number\",\n \"description\": \"<p>Default CallerID setting for the Domain.<\\\/p>\"\n },\n \"callid_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Default Cname setting for the Domain.<\\\/p>\"\n },\n \"callid_emgr\": {\n \"type\": \"number\",\n \"description\": \"<p>Default 911 CallerID setting for the Domain.<\\\/p>\"\n },\n \"area_code\": {\n \"type\": \"number\",\n \"description\": \"<p>Default area code setting for the Domain.<\\\/p>\"\n },\n \"sms_inbound_last\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of inbound sms for last the month .<\\\/p>\"\n },\n \"sms_outbound_last\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of outbound sms for last the month.<\\\/p>\"\n },\n \"sms_outbound_current\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of outbound sms for this month.<\\\/p>\"\n },\n \"sms_inbound_current\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of inbound sms for this month.<\\\/p>\"\n },\n \"active_calls_onnet_last\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of onnet active calls for the last month.<\\\/p>\"\n },\n \"active_calls_offnet_last\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of offnet active calls for the last month.<\\\/p>\"\n },\n \"active_calls_offnet_current\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of offnet active calls for this month.<\\\/p>\"\n },\n \"active_calls_onnet_current\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of onnet active calls for this month.<\\\/p>\"\n },\n \"smtp_host\": {\n \"type\": \"string\",\n \"description\": \"<p>Email setting: host server<\\\/p>\"\n },\n \"smtp_port\": {\n \"type\": \"string\",\n \"description\": \"<p>Email setting: host port<\\\/p>\"\n },\n \"smtp_uid\": {\n \"type\": \"string\",\n \"description\": \"<p>Email setting: user<\\\/p>\"\n },\n \"smtp_pwd\": {\n \"type\": \"string\",\n \"description\": \"<p>Email setting: password<\\\/p>\"\n },\n \"from_user\": {\n \"type\": \"string\",\n \"description\": \"<p>(deprecated)<\\\/p>\"\n },\n \"from_host\": {\n \"type\": \"string\",\n \"description\": \"<p>(deprecated)<\\\/p>\"\n },\n \"active_call\": {\n \"type\": \"string\",\n \"description\": \"<p>Current number of active calls<\\\/p>\"\n },\n \"countForLimit\": {\n \"type\": \"string\",\n \"description\": \"<p>Count against the Call Limit<\\\/p>\"\n },\n \"countExternal\": {\n \"type\": \"string\",\n \"description\": \"<p>Count against the External Call Limit<\\\/p>\"\n },\n \"sub_count\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of subscribers for the Domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['domain'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=domain&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read info on a specific Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readdomain_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadBillingDomain", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of Domain.<\\\/p>\"\n },\n \"territory\": {\n \"type\": \"string\",\n \"description\": \"<p>Territory\\\/Reseller for the Domain.<\\\/p>\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description for the Domain.<\\\/p>\"\n },\n \"call_limit\": {\n \"type\": \"number\",\n \"description\": \"<p>The active Call Limit for this Domain.<\\\/p>\"\n },\n \"call_limit_ext\": {\n \"type\": \"number\",\n \"description\": \"<p>The active Call Limit for this Domain only counting calls enternal to the domain.<\\\/p>\"\n },\n \"max_user\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum user count that the Domain can have.<\\\/p>\"\n },\n \"max_call_queue\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum call queue count that the Domain can have.<\\\/p>\"\n },\n \"max_aa\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum Auto Attendant count that the Domain can have.<\\\/p>\"\n },\n \"max_conference\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum conference bridge count that the Domain can have.<\\\/p>\"\n },\n \"max_department\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum department count that the Domain can have.<\\\/p>\"\n },\n \"max_site\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum site count that the Domain can have.<\\\/p>\"\n },\n \"max_device\": {\n \"type\": \"number\",\n \"description\": \"<p>The Maximum device count per user.<\\\/p>\"\n },\n \"current_user\": {\n \"type\": \"number\",\n \"description\": \"<p>The current user count that the Domain can have.<\\\/p>\"\n },\n \"current_call_queue\": {\n \"type\": \"number\",\n \"description\": \"<p>The current call queue count that the Domain can have.<\\\/p>\"\n },\n \"current_park\": {\n \"type\": \"number\",\n \"description\": \"<p>The current number of call parks enabled for the domain.<\\\/p>\"\n },\n \"current_aa\": {\n \"type\": \"number\",\n \"description\": \"<p>The current Auto Attendant count that the Domain can have.<\\\/p>\"\n },\n \"current_conference\": {\n \"type\": \"number\",\n \"description\": \"<p>The current conference bridge count that the Domain can have.<\\\/p>\"\n },\n \"current_department\": {\n \"type\": \"number\",\n \"description\": \"<p>The current department count that the Domain can have.<\\\/p>\"\n },\n \"current_registered_device\": {\n \"type\": \"number\",\n \"description\": \"<p>The current count of registered devices.<\\\/p>\"\n },\n \"current_device\": {\n \"type\": \"number\",\n \"description\": \"<p>The current total device count.<\\\/p>\"\n },\n \"current_phonenumbers\": {\n \"type\": \"number\",\n \"description\": \"<p>The current count of phone numbers assigned to domain<\\\/p>\"\n },\n \"current_tollfree\": {\n \"type\": \"number\",\n \"description\": \"<p>The current count of toll free phonenumbers<\\\/p>\"\n },\n \"current_scope_SCOPE\": {\n \"type\": \"number\",\n \"description\": \"<p>The current count the SCOPE for this domain. will show 1 entry per scope type.<\\\/p>\"\n },\n \"current_transcribe_VENDOR\": {\n \"type\": \"number\",\n \"description\": \"<p>The current count of users assigned to vmail transcription by VENDOR for this domain. will show 1 entry per VENDOR enabled.<\\\/p>\"\n },\n \"current_service_code_SRVCODE\": {\n \"type\": \"number\",\n \"description\": \"<p>The current count of users tagged with server code SRVCODE for this domain. will show 1 entry per SRVCODE used.<\\\/p>\"\n },\n \"sms_inbound_last\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of inbound sms for last the month .<\\\/p>\"\n },\n \"sms_outbound_last\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of outbound sms for last the month.<\\\/p>\"\n },\n \"sms_outbound_current\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of outbound sms for this month.<\\\/p>\"\n },\n \"sms_inbound_current\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of inbound sms for this month.<\\\/p>\"\n },\n \"active_calls_onnet_last\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of onnet active calls for the last month.<\\\/p>\"\n },\n \"active_calls_offnet_last\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of offnet active calls for the last month.<\\\/p>\"\n },\n \"active_calls_offnet_current\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of offnet active calls for this month.<\\\/p>\"\n },\n \"active_calls_onnet_current\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of onnet active calls for this month.<\\\/p>\"\n },\n \"calculation_time_ms\": {\n \"type\": \"number\",\n \"description\": \"<p>The time it too the API to generate this data.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['domain'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=domain&action=read&billing=yes", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read a billable summary for a domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readbillingdomain_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateDomain", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=domain&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update an existing Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatedomain_domain}}", "enabled": true }, { "key": "territory", "type": "text", "value": "{{updatedomain_territory}}", "enabled": false }, { "key": "moh", "type": "text", "value": "{{updatedomain_moh}}", "enabled": false }, { "key": "mor", "type": "text", "value": "{{updatedomain_mor}}", "enabled": false }, { "key": "mot", "type": "text", "value": "{{updatedomain_mot}}", "enabled": false }, { "key": "rmoh", "type": "text", "value": "{{updatedomain_rmoh}}", "enabled": false }, { "key": "rating", "type": "text", "value": "{{updatedomain_rating}}", "enabled": false }, { "key": "resi", "type": "text", "value": "{{updatedomain_resi}}", "enabled": false }, { "key": "sub_limit", "type": "text", "value": "{{updatedomain_sub_limit}}", "enabled": false }, { "key": "dial_plan", "type": "text", "value": "{{updatedomain_dial_plan}}", "enabled": false }, { "key": "dial_policy", "type": "text", "value": "{{updatedomain_dial_policy}}", "enabled": false }, { "key": "email_sender", "type": "text", "value": "{{updatedomain_email_sender}}", "enabled": false }, { "key": "smtp_host", "type": "text", "value": "{{updatedomain_smtp_host}}", "enabled": false }, { "key": "smtp_port", "type": "text", "value": "{{updatedomain_smtp_port}}", "enabled": false }, { "key": "smtp_uid", "type": "text", "value": "{{updatedomain_smtp_uid}}", "enabled": false }, { "key": "smtp_pwd", "type": "text", "value": "{{updatedomain_smtp_pwd}}", "enabled": false }, { "key": "from_user", "type": "text", "value": "{{updatedomain_from_user}}", "enabled": false }, { "key": "description", "type": "text", "value": "{{updatedomain_description}}", "enabled": false }, { "key": "call_limit", "type": "text", "value": "{{updatedomain_call_limit}}", "enabled": false }, { "key": "call_limit_ext", "type": "text", "value": "{{updatedomain_call_limit_ext}}", "enabled": false }, { "key": "max_user", "type": "text", "value": "{{updatedomain_max_user}}", "enabled": false }, { "key": "max_call_queue", "type": "text", "value": "{{updatedomain_max_call_queue}}", "enabled": false }, { "key": "max_aa", "type": "text", "value": "{{updatedomain_max_aa}}", "enabled": false }, { "key": "max_conference", "type": "text", "value": "{{updatedomain_max_conference}}", "enabled": false }, { "key": "max_department", "type": "text", "value": "{{updatedomain_max_department}}", "enabled": false }, { "key": "max_device", "type": "text", "value": "{{updatedomain_max_device}}", "enabled": false }, { "key": "max_site", "type": "text", "value": "{{updatedomain_max_site}}", "enabled": false }, { "key": "policies", "type": "text", "value": "{{updatedomain_policies}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Image", "description": "", "item": [ { "name": "ReadImage", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['image'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=image&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read\/View a Image", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "filename", "type": "text", "value": "{{readimage_filename}}", "enabled": true }, { "key": "server", "type": "text", "value": "{{readimage_server}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readimage_domain}}", "enabled": false }, { "key": "territory", "type": "text", "value": "{{readimage_territory}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "MAC", "description": "", "item": [ { "name": "CountMAC", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Macs in the specified Domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=mac&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count MAC Addresses", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countmac_domain}}", "enabled": true }, { "key": "territory", "type": "text", "value": "{{countmac_territory}}", "enabled": false }, { "key": "mac", "type": "text", "value": "{{countmac_mac}}", "enabled": false }, { "key": "mac_LIKE", "type": "text", "value": "{{countmac_mac_LIKE}}", "enabled": false }, { "key": "model", "type": "text", "value": "{{countmac_model}}", "enabled": false }, { "key": "notes", "type": "text", "value": "{{countmac_notes}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateMAC", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=mac&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a MAC entry", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "mac", "type": "text", "value": "{{createmac_mac}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createmac_domain}}", "enabled": true }, { "key": "model", "type": "text", "value": "{{createmac_model}}", "enabled": true }, { "key": "transport", "type": "text", "value": "{{createmac_transport}}", "enabled": false }, { "key": "server", "type": "text", "value": "{{createmac_server}}", "enabled": false }, { "key": "last_pull", "type": "text", "value": "{{createmac_last_pull}}", "enabled": false }, { "key": "date_created", "type": "text", "value": "{{createmac_date_created}}", "enabled": false }, { "key": "device1", "type": "text", "value": "{{createmac_device1}}", "enabled": false }, { "key": "device2", "type": "text", "value": "{{createmac_device2}}", "enabled": false }, { "key": "device3", "type": "text", "value": "{{createmac_device3}}", "enabled": false }, { "key": "device4", "type": "text", "value": "{{createmac_device4}}", "enabled": false }, { "key": "device5", "type": "text", "value": "{{createmac_device5}}", "enabled": false }, { "key": "device6", "type": "text", "value": "{{createmac_device6}}", "enabled": false }, { "key": "device7", "type": "text", "value": "{{createmac_device7}}", "enabled": false }, { "key": "device8", "type": "text", "value": "{{createmac_device8}}", "enabled": false }, { "key": "territory", "type": "text", "value": "{{createmac_territory}}", "enabled": false }, { "key": "notes", "type": "text", "value": "{{createmac_notes}}", "enabled": false }, { "key": "line1_ext", "type": "text", "value": "{{createmac_line1_ext}}", "enabled": false }, { "key": "line2_ext", "type": "text", "value": "{{createmac_line2_ext}}", "enabled": false }, { "key": "redundancy", "type": "text", "value": "{{createmac_redundancy}}", "enabled": false }, { "key": "line1_enable", "type": "text", "value": "{{createmac_line1_enable}}", "enabled": false }, { "key": "line2_enable", "type": "text", "value": "{{createmac_line2_enable}}", "enabled": false }, { "key": "line3_enable", "type": "text", "value": "{{createmac_line3_enable}}", "enabled": false }, { "key": "line4_enable", "type": "text", "value": "{{createmac_line4_enable}}", "enabled": false }, { "key": "line5_enable", "type": "text", "value": "{{createmac_line5_enable}}", "enabled": false }, { "key": "line6_enable", "type": "text", "value": "{{createmac_line6_enable}}", "enabled": false }, { "key": "line7_enable", "type": "text", "value": "{{createmac_line7_enable}}", "enabled": false }, { "key": "line8_enable", "type": "text", "value": "{{createmac_line8_enable}}", "enabled": false }, { "key": "line1_share", "type": "text", "value": "{{createmac_line1_share}}", "enabled": false }, { "key": "line2_share", "type": "text", "value": "{{createmac_line2_share}}", "enabled": false }, { "key": "line3_share", "type": "text", "value": "{{createmac_line3_share}}", "enabled": false }, { "key": "line4_share", "type": "text", "value": "{{createmac_line4_share}}", "enabled": false }, { "key": "line5_share", "type": "text", "value": "{{createmac_line5_share}}", "enabled": false }, { "key": "line6_share", "type": "text", "value": "{{createmac_line6_share}}", "enabled": false }, { "key": "line7_share", "type": "text", "value": "{{createmac_line7_share}}", "enabled": false }, { "key": "line8_share", "type": "text", "value": "{{createmac_line8_share}}", "enabled": false }, { "key": "overrides", "type": "text", "value": "{{createmac_overrides}}", "enabled": false }, { "key": "dir_inc", "type": "text", "value": "{{createmac_dir_inc}}", "enabled": false }, { "key": "presence", "type": "text", "value": "{{createmac_presence}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteMAC", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=mac&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete Device using its MAC address", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "mac", "type": "text", "value": "{{deletemac_mac}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletemac_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadMAC", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"mac\": {\n \"type\": \"string\",\n \"description\": \"<p>MAC Address<\\\/p>\"\n },\n \"server\": {\n \"type\": \"string\",\n \"description\": \"<p>Server<\\\/p>\"\n },\n \"territory\": {\n \"type\": \"string\",\n \"description\": \"<p>Territory<\\\/p>\"\n },\n \"dir_inc\": {\n \"type\": \"string\",\n \"description\": \"<p>dir_inc<\\\/p>\"\n },\n \"presence\": {\n \"type\": \"string\",\n \"description\": \"<p>Presence<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain<\\\/p>\"\n },\n \"model\": {\n \"type\": \"string\",\n \"description\": \"<p>Model<\\\/p>\"\n },\n \"device1\": {\n \"type\": \"string\",\n \"description\": \"<p>Device1<\\\/p>\"\n },\n \"device2\": {\n \"type\": \"string\",\n \"description\": \"<p>Device2<\\\/p>\"\n },\n \"device3\": {\n \"type\": \"string\",\n \"description\": \"<p>Device3<\\\/p>\"\n },\n \"device4\": {\n \"type\": \"string\",\n \"description\": \"<p>Device4<\\\/p>\"\n },\n \"device5\": {\n \"type\": \"string\",\n \"description\": \"<p>Device5<\\\/p>\"\n },\n \"device6\": {\n \"type\": \"string\",\n \"description\": \"<p>Device6<\\\/p>\"\n },\n \"device7\": {\n \"type\": \"string\",\n \"description\": \"<p>Device7<\\\/p>\"\n },\n \"device8\": {\n \"type\": \"string\",\n \"description\": \"<p>Device8<\\\/p>\"\n },\n \"notes\": {\n \"type\": \"string\",\n \"description\": \"<p>notes<\\\/p>\"\n },\n \"line1_share\": {\n \"type\": \"string\",\n \"description\": \"<p>line1_share<\\\/p>\"\n },\n \"line2_share\": {\n \"type\": \"string\",\n \"description\": \"<p>line2_share<\\\/p>\"\n },\n \"line3_share\": {\n \"type\": \"string\",\n \"description\": \"<p>line3_share<\\\/p>\"\n },\n \"line4_share\": {\n \"type\": \"string\",\n \"description\": \"<p>line4_share<\\\/p>\"\n },\n \"line5_share\": {\n \"type\": \"string\",\n \"description\": \"<p>line5_share<\\\/p>\"\n },\n \"line6_share\": {\n \"type\": \"string\",\n \"description\": \"<p>line6_share<\\\/p>\"\n },\n \"overrides\": {\n \"type\": \"string\",\n \"description\": \"<p>overrides<\\\/p>\"\n },\n \"phone_ext\": {\n \"type\": \"string\",\n \"description\": \"<p>Phone Extension<\\\/p>\"\n },\n \"transport\": {\n \"type\": \"string\",\n \"description\": \"<p>The transport type for the device if configured through the NDP<\\\/p>\"\n },\n \"fxs\": {\n \"type\": \"string\",\n \"description\": \"<p>fxs<\\\/p>\"\n },\n \"sla\": {\n \"type\": \"string\",\n \"description\": \"<p>sla<\\\/p>\"\n },\n \"sidecar\": {\n \"type\": \"string\",\n \"description\": \"<p>sidecar<\\\/p>\"\n },\n \"resync\": {\n \"type\": \"string\",\n \"description\": \"<p>resync<\\\/p>\"\n },\n \"directory_support\": {\n \"type\": \"string\",\n \"description\": \"<p>Directory Support<\\\/p>\"\n },\n \"user_agent\": {\n \"type\": \"string\",\n \"description\": \"<p>User Agent<\\\/p>\"\n },\n \"contact\": {\n \"type\": \"string\",\n \"description\": \"<p>Contact<\\\/p>\"\n },\n \"registration_expires_time\": {\n \"type\": \"string\",\n \"description\": \"<p>Registration Expiration Time<\\\/p>\"\n },\n \"registration_time\": {\n \"type\": \"string\",\n \"description\": \"<p>Registration Time<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['mac'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=mac&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Device using its MAC address", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "mac", "type": "text", "value": "{{readmac_mac}}", "enabled": true }, { "key": "extension", "type": "text", "value": "{{readmac_extension}}", "enabled": true }, { "key": "checkExistance", "type": "text", "value": "{{readmac_checkExistance}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateMAC", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=mac&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a Device using its MAC address", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "mac", "type": "text", "value": "{{updatemac_mac}}", "enabled": true }, { "key": "model", "type": "text", "value": "{{updatemac_model}}", "enabled": false }, { "key": "line", "type": "text", "value": "{{updatemac_line}}", "enabled": false }, { "key": "device", "type": "text", "value": "{{updatemac_device}}", "enabled": false }, { "key": "transport", "type": "text", "value": "{{updatemac_transport}}", "enabled": false }, { "key": "server", "type": "text", "value": "{{updatemac_server}}", "enabled": false }, { "key": "last_pull", "type": "text", "value": "{{updatemac_last_pull}}", "enabled": false }, { "key": "date_created", "type": "text", "value": "{{updatemac_date_created}}", "enabled": false }, { "key": "device1", "type": "text", "value": "{{updatemac_device1}}", "enabled": false }, { "key": "device2", "type": "text", "value": "{{updatemac_device2}}", "enabled": false }, { "key": "device3", "type": "text", "value": "{{updatemac_device3}}", "enabled": false }, { "key": "device4", "type": "text", "value": "{{updatemac_device4}}", "enabled": false }, { "key": "device5", "type": "text", "value": "{{updatemac_device5}}", "enabled": false }, { "key": "device6", "type": "text", "value": "{{updatemac_device6}}", "enabled": false }, { "key": "device7", "type": "text", "value": "{{updatemac_device7}}", "enabled": false }, { "key": "device8", "type": "text", "value": "{{updatemac_device8}}", "enabled": false }, { "key": "territory", "type": "text", "value": "{{updatemac_territory}}", "enabled": false }, { "key": "notes", "type": "text", "value": "{{updatemac_notes}}", "enabled": false }, { "key": "line1_ext", "type": "text", "value": "{{updatemac_line1_ext}}", "enabled": false }, { "key": "line2_ext", "type": "text", "value": "{{updatemac_line2_ext}}", "enabled": false }, { "key": "redundancy", "type": "text", "value": "{{updatemac_redundancy}}", "enabled": false }, { "key": "line1_enable", "type": "text", "value": "{{updatemac_line1_enable}}", "enabled": false }, { "key": "line2_enable", "type": "text", "value": "{{updatemac_line2_enable}}", "enabled": false }, { "key": "line3_enable", "type": "text", "value": "{{updatemac_line3_enable}}", "enabled": false }, { "key": "line4_enable", "type": "text", "value": "{{updatemac_line4_enable}}", "enabled": false }, { "key": "line5_enable", "type": "text", "value": "{{updatemac_line5_enable}}", "enabled": false }, { "key": "line6_enable", "type": "text", "value": "{{updatemac_line6_enable}}", "enabled": false }, { "key": "line7_enable", "type": "text", "value": "{{updatemac_line7_enable}}", "enabled": false }, { "key": "line8_enable", "type": "text", "value": "{{updatemac_line8_enable}}", "enabled": false }, { "key": "line1_share", "type": "text", "value": "{{updatemac_line1_share}}", "enabled": false }, { "key": "line2_share", "type": "text", "value": "{{updatemac_line2_share}}", "enabled": false }, { "key": "line3_share", "type": "text", "value": "{{updatemac_line3_share}}", "enabled": false }, { "key": "line4_share", "type": "text", "value": "{{updatemac_line4_share}}", "enabled": false }, { "key": "line5_share", "type": "text", "value": "{{updatemac_line5_share}}", "enabled": false }, { "key": "line6_share", "type": "text", "value": "{{updatemac_line6_share}}", "enabled": false }, { "key": "line7_share", "type": "text", "value": "{{updatemac_line7_share}}", "enabled": false }, { "key": "line8_share", "type": "text", "value": "{{updatemac_line8_share}}", "enabled": false }, { "key": "overrides", "type": "text", "value": "{{updatemac_overrides}}", "enabled": false }, { "key": "dir_inc", "type": "text", "value": "{{updatemac_dir_inc}}", "enabled": false }, { "key": "presence", "type": "text", "value": "{{updatemac_presence}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Message", "description": "", "item": [ { "name": "CreateMessage", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=message&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Send a new Message", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createmessage_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{createmessage_user}}", "enabled": false }, { "key": "type", "type": "text", "value": "{{createmessage_type}}", "enabled": false }, { "key": "from_num", "type": "text", "value": "{{createmessage_from_num}}", "enabled": true }, { "key": "destination", "type": "text", "value": "{{createmessage_destination}}", "enabled": true }, { "key": "message", "type": "text", "value": "{{createmessage_message}}", "enabled": true } ] } }, "response": [] }, { "name": "NotifyUnreadMessagesMessage", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=email&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Notify All of Unread Messages", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "subject", "type": "text", "value": "{{notifyunreadmessagesmessage_subject}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadMessage", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"message\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['message'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=message&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Messages", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readmessage_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{readmessage_user}}", "enabled": false }, { "key": "session_id", "type": "text", "value": "{{readmessage_session_id}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readmessage_start}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readmessage_limit}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{readmessage_sort}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadProcessEmailMessage", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=email&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Send Email Missed Messages", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readprocessemailmessage_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{readprocessemailmessage_user}}", "enabled": true }, { "key": "session_id", "type": "text", "value": "{{readprocessemailmessage_session_id}}", "enabled": true }, { "key": "template", "type": "text", "value": "{{readprocessemailmessage_template}}", "enabled": true }, { "key": "subject", "type": "text", "value": "{{readprocessemailmessage_subject}}", "enabled": true }, { "key": "cclist", "type": "text", "value": "{{readprocessemailmessage_cclist}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Message_Session", "description": "", "item": [ { "name": "AcceptMessage_Session", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['message_session'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=messagesession&action=accept", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Accept Message Session for Agent", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{acceptmessage_session_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{acceptmessage_session_user}}", "enabled": true }, { "key": "session_id", "type": "text", "value": "{{acceptmessage_session_session_id}}", "enabled": true }, { "key": "term_queue", "type": "text", "value": "{{acceptmessage_session_term_queue}}", "enabled": true }, { "key": "rx_hostname", "type": "text", "value": "{{acceptmessage_session_rx_hostname}}", "enabled": true }, { "key": "muted", "type": "text", "value": "{{acceptmessage_session_muted}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteMessage_Session", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=messagesession&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete Message Session (Conversations)", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletemessage_session_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{deletemessage_session_user}}", "enabled": false }, { "key": "session_id", "type": "text", "value": "{{deletemessage_session_session_id}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadMessage_Session", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"message\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['message_session'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=messagesession&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Message Session (Conversations)", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readmessage_session_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{readmessage_session_user}}", "enabled": false }, { "key": "session_id", "type": "text", "value": "{{readmessage_session_session_id}}", "enabled": false }, { "key": "term_queue", "type": "text", "value": "{{readmessage_session_term_queue}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readmessage_session_start}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readmessage_session_limit}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{readmessage_session_sort}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateMessage_Session", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=messagesession&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update Message Session", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatemessage_session_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updatemessage_session_user}}", "enabled": true }, { "key": "session_id", "type": "text", "value": "{{updatemessage_session_session_id}}", "enabled": true }, { "key": "rx_hostname", "type": "text", "value": "{{updatemessage_session_rx_hostname}}", "enabled": true }, { "key": "muted", "type": "text", "value": "{{updatemessage_session_muted}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateMessage_Session", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['message_session'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=messagesession&action=dispatch", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Compale Message Session for Agent", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatemessage_session_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updatemessage_session_user}}", "enabled": true }, { "key": "session_id", "type": "text", "value": "{{updatemessage_session_session_id}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "NDP_Server", "description": "", "item": [ { "name": "listNDP_Server", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"<p>Name\\\/alias of the server<\\\/p>\"\n },\n \"hostname\": {\n \"type\": \"string\",\n \"description\": \"<p>The hostname of the server<\\\/p>\"\n },\n \"port\": {\n \"type\": \"number\",\n \"description\": \"<p>The port to access the server through<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['ndp_server'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=ndpserver&action=list", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read NDP Servers", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "server", "type": "text", "value": "{{listndp_server_server}}", "enabled": true } ] } }, "response": [] }, { "name": "readNDP_Server", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"<p>Name\\\/alias of the server<\\\/p>\"\n },\n \"hostname\": {\n \"type\": \"string\",\n \"description\": \"<p>The hostname of the server<\\\/p>\"\n },\n \"port\": {\n \"type\": \"number\",\n \"description\": \"<p>The port to access the server through<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['ndp_server'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=ndpserver&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read NDP Servers", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "server", "type": "text", "value": "{{readndp_server_server}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Oauth2", "description": "", "item": [ { "name": "CreateTokenPasswordOauth2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"access_token\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"expires_in\": {\n \"type\": \"string\",\n \"description\": \"<p>Seconds remaining until token expiration.<\\\/p>\"\n },\n \"scope\": {\n \"type\": \"string\",\n \"description\": \"<p>Subscriber\\u2019s scope of access. NULL if legacy credentials were validated but legacy window is not active.<\\\/p>\"\n },\n \"token_type\": {\n \"type\": \"string\",\n \"description\": \"<p>Type of token granted.<\\\/p>\"\n },\n \"refresh_token\": {\n \"type\": \"string\",\n \"description\": \"<p>Oauth refresh token, used to get a new access token.<\\\/p>\"\n },\n \"legacy\": {\n \"type\": \"boolean\",\n \"description\": \"<p>Is the responding API in legacy window?<\\\/p>\"\n },\n \"legacy_expires_days\": {\n \"type\": \"number\",\n \"description\": \"<p>Days remaining in legacy window, if active.<\\\/p>\"\n },\n \"recover\": {\n \"type\": \"boolean\",\n \"description\": \"<p>Was a recovery email dispatched? Returned only if API is not in Legacy window and legacy credentials were validated.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['oauth2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/oauth2\/token\/", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Generate access token with subscriber credentials", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "grant_type", "type": "text", "value": "{{createtokenpasswordoauth2_grant_type}}", "enabled": true }, { "key": "client_id", "type": "text", "value": "{{createtokenpasswordoauth2_client_id}}", "enabled": true }, { "key": "client_secret", "type": "text", "value": "{{createtokenpasswordoauth2_client_secret}}", "enabled": true }, { "key": "username", "type": "text", "value": "{{createtokenpasswordoauth2_username}}", "enabled": true }, { "key": "password", "type": "text", "value": "{{createtokenpasswordoauth2_password}}", "enabled": true } ] } }, "response": [] }, { "name": "CreateTokenRefreshOauth2", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"access_token\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"expires_in\": {\n \"type\": \"string\",\n \"description\": \"<p>Seconds remaining until token expiration.<\\\/p>\"\n },\n \"scope\": {\n \"type\": \"string\",\n \"description\": \"<p>Subscriber\\u2019s scope of access. NULL if legacy credentials were validated but legacy window is not active.<\\\/p>\"\n },\n \"token_type\": {\n \"type\": \"string\",\n \"description\": \"<p>Type of token granted.<\\\/p>\"\n },\n \"refresh_token\": {\n \"type\": \"string\",\n \"description\": \"<p>Oauth refresh token, used to get a new access token.<\\\/p>\"\n },\n \"legacy\": {\n \"type\": \"boolean\",\n \"description\": \"<p>Is the responding API in legacy window?<\\\/p>\"\n },\n \"legacy_expires_days\": {\n \"type\": \"number\",\n \"description\": \"<p>Days remaining in legacy window, if active.<\\\/p>\"\n },\n \"recover\": {\n \"type\": \"boolean\",\n \"description\": \"<p>Was a recovery email dispatched? Returned only if API is not in Legacy window and legacy credentials were validated.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['oauth2'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/oauth2\/token\/", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Exchange refresh token for new access token", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "grant_type", "type": "text", "value": "{{createtokenrefreshoauth2_grant_type}}", "enabled": true }, { "key": "client_id", "type": "text", "value": "{{createtokenrefreshoauth2_client_id}}", "enabled": true }, { "key": "client_secret", "type": "text", "value": "{{createtokenrefreshoauth2_client_secret}}", "enabled": true }, { "key": "refresh_token", "type": "text", "value": "{{createtokenrefreshoauth2_refresh_token}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Permission", "description": "", "item": [ { "name": "CreatePermission", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=permission&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create permission rule for a Dial Policy", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createpermission_domain}}", "enabled": true }, { "key": "dialpolicy", "type": "text", "value": "{{createpermission_dialpolicy}}", "enabled": true }, { "key": "dial_match", "type": "text", "value": "{{createpermission_dial_match}}", "enabled": true }, { "key": "mode", "type": "text", "value": "{{createpermission_mode}}", "enabled": true }, { "key": "reason", "type": "text", "value": "{{createpermission_reason}}", "enabled": true } ] } }, "response": [] }, { "name": "DeletePermission", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=permission&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete permission rule for a Dial Policy", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletepermission_domain}}", "enabled": true }, { "key": "dialpolicy", "type": "text", "value": "{{deletepermission_dialpolicy}}", "enabled": true }, { "key": "dial_match", "type": "text", "value": "{{deletepermission_dial_match}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadPermission", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"dialpolicy\": {\n \"type\": \"string\",\n \"description\": \"<p>The name of the Dialpolicy (permission)<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain owning the Dialpolicy &quot;*&quot; available for shared policies.<\\\/p>\"\n },\n \"dial_match\": {\n \"type\": \"string\",\n \"description\": \"<p>The specific permission match in the dialpolicy<\\\/p>\"\n },\n \"mode\": {\n \"type\": \"string\",\n \"description\": \"<p>Either permit or deny<\\\/p>\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"<p>Explanation of why this rule is in there. Available for internal documetation<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['permission'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=permission&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read permission rule from a Dial Policy", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readpermission_domain}}", "enabled": true }, { "key": "dialpolicy", "type": "text", "value": "{{readpermission_dialpolicy}}", "enabled": true }, { "key": "dial_match", "type": "text", "value": "{{readpermission_dial_match}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdatePermission", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=permission&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update permission rule for a Dial Policy", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatepermission_domain}}", "enabled": true }, { "key": "dialpolicy", "type": "text", "value": "{{updatepermission_dialpolicy}}", "enabled": true }, { "key": "dial_match", "type": "text", "value": "{{updatepermission_dial_match}}", "enabled": true }, { "key": "mode", "type": "text", "value": "{{updatepermission_mode}}", "enabled": false }, { "key": "reason", "type": "text", "value": "{{updatepermission_reason}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Phone_Configuration", "description": "", "item": [ { "name": "CountPhone_Configuration", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Phoneconfiguration in the specified domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phoneconfiguration&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Phoneconfiguration", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{countphone_configuration_territory}}", "enabled": false } ] } }, "response": [] }, { "name": "CreatePhone_Configuration", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phoneconfiguration&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a phone configuration", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createphone_configuration_domain}}", "enabled": true }, { "key": "description", "type": "text", "value": "{{createphone_configuration_description}}", "enabled": false } ] } }, "response": [] }, { "name": "DeletePhone_Configuration", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=agent&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete Agents", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletephone_configuration_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{deletephone_configuration_queue}}", "enabled": true }, { "key": "device", "type": "text", "value": "{{deletephone_configuration_device}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadPhone_Configuration", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['phone_configuration'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phoneconfiguration&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Phone Configuration", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{readphone_configuration_territory}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{readphone_configuration_domain}}", "enabled": false }, { "key": "mac", "type": "text", "value": "{{readphone_configuration_mac}}", "enabled": false }, { "key": "templatesOnly", "type": "text", "value": "{{readphone_configuration_templatesOnly}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadPhone_Configuration", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['phone_configuration'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phoneconfiguration&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Phone Configuration", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{readphone_configuration_territory}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Phone_Number", "description": "", "item": [ { "name": "CountPhone_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Number matching search params<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phonenumber&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Phone Numbers in a Dial Plan", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{countphone_number_dialplan}}", "enabled": true }, { "key": "dest_domain", "type": "text", "value": "{{countphone_number_dest_domain}}", "enabled": false }, { "key": "matchrule", "type": "text", "value": "{{countphone_number_matchrule}}", "enabled": false } ] } }, "response": [] }, { "name": "CreatePhone_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phonenumber&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a Phone Number for Inventory", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "dest_domain", "type": "text", "value": "{{createphone_number_dest_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{createphone_number_dialplan}}", "enabled": true }, { "key": "matchrule", "type": "text", "value": "{{createphone_number_matchrule}}", "enabled": true }, { "key": "responder", "type": "text", "value": "{{createphone_number_responder}}", "enabled": true }, { "key": "to_user", "type": "text", "value": "{{createphone_number_to_user}}", "enabled": true }, { "key": "to_host", "type": "text", "value": "{{createphone_number_to_host}}", "enabled": true }, { "key": "enable", "type": "text", "value": "{{createphone_number_enable}}", "enabled": false } ] } }, "response": [] }, { "name": "DeletePhone_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phonenumber&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a Phone Number", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletephone_number_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{deletephone_number_dialplan}}", "enabled": true }, { "key": "matchrule", "type": "text", "value": "{{deletephone_number_matchrule}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadPhone_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"matchrule\": {\n \"type\": \"string\",\n \"description\": \"<p>Destination, generally in sip:1NPANXXXXXX@*<\\\/p>\"\n },\n \"enable\": {\n \"type\": \"string\",\n \"description\": \"<p>is the rule enabled<\\\/p>\"\n },\n \"match_from\": {\n \"type\": \"string\",\n \"description\": \"<p>Source<\\\/p>\"\n },\n \"dow\": {\n \"type\": \"string\",\n \"description\": \"<p>Days of week<\\\/p>\"\n },\n \"tod_from\": {\n \"type\": \"string\",\n \"description\": \"<p>Time of Dial<\\\/p>\"\n },\n \"tod_to\": {\n \"type\": \"string\",\n \"description\": \"<p>Time of Dial<\\\/p>\"\n },\n \"valid_from\": {\n \"type\": \"string\",\n \"description\": \"<p>Starting date Dialrule is valid<\\\/p>\"\n },\n \"valid_to\": {\n \"type\": \"string\",\n \"description\": \"<p>End date Dialrule is valid<\\\/p>\"\n },\n \"responder\": {\n \"type\": \"string\",\n \"description\": \"<p>Application<\\\/p>\"\n },\n \"parameter\": {\n \"type\": \"string\",\n \"description\": \"<p>Application parameter<\\\/p>\"\n },\n \"to_scheme\": {\n \"type\": \"string\",\n \"description\": \"<p>Destination scheme translation<\\\/p>\"\n },\n \"to_user\": {\n \"type\": \"string\",\n \"description\": \"<p>The Destination user<\\\/p>\"\n },\n \"to_host\": {\n \"type\": \"string\",\n \"description\": \"<p>The Destination host, often a domain name<\\\/p>\"\n },\n \"from_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"from_scheme\": {\n \"type\": \"string\",\n \"description\": \"<p>Protocol used by sender (ex. 'sip:')???<\\\/p>\"\n },\n \"from_user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"from_host\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dialplan\": {\n \"type\": \"string\",\n \"description\": \"<p>Dialplan to which Dialrule belongs.<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain to which Dialplan containing Dialrule belongs.<\\\/p>\"\n },\n \"plan_description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description for Dialrule<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['phone_number'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phonenumber&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Phone Numbers in a Dial Plan", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{readphone_number_dialplan}}", "enabled": true }, { "key": "dest_domain", "type": "text", "value": "{{readphone_number_dest_domain}}", "enabled": false }, { "key": "matchrule", "type": "text", "value": "{{readphone_number_matchrule}}", "enabled": false }, { "key": "matchrule_LIKE", "type": "text", "value": "{{readphone_number_matchrule_LIKE}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdatePhone_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=phonenumber&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a Phone Number", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "dest_domain", "type": "text", "value": "{{updatephone_number_dest_domain}}", "enabled": true }, { "key": "dialplan", "type": "text", "value": "{{updatephone_number_dialplan}}", "enabled": true }, { "key": "matchrule", "type": "text", "value": "{{updatephone_number_matchrule}}", "enabled": true }, { "key": "enable", "type": "text", "value": "{{updatephone_number_enable}}", "enabled": false }, { "key": "dow", "type": "text", "value": "{{updatephone_number_dow}}", "enabled": false }, { "key": "tod_from", "type": "text", "value": "{{updatephone_number_tod_from}}", "enabled": false }, { "key": "tod_to", "type": "text", "value": "{{updatephone_number_tod_to}}", "enabled": false }, { "key": "responder", "type": "text", "value": "{{updatephone_number_responder}}", "enabled": false }, { "key": "parameter", "type": "text", "value": "{{updatephone_number_parameter}}", "enabled": false }, { "key": "to_scheme", "type": "text", "value": "{{updatephone_number_to_scheme}}", "enabled": false }, { "key": "to_user", "type": "text", "value": "{{updatephone_number_to_user}}", "enabled": false }, { "key": "to_host", "type": "text", "value": "{{updatephone_number_to_host}}", "enabled": false }, { "key": "from_name", "type": "text", "value": "{{updatephone_number_from_name}}", "enabled": false }, { "key": "from_scheme", "type": "text", "value": "{{updatephone_number_from_scheme}}", "enabled": false }, { "key": "from_user", "type": "text", "value": "{{updatephone_number_from_user}}", "enabled": false }, { "key": "from_host", "type": "text", "value": "{{updatephone_number_from_host}}", "enabled": false }, { "key": "plan_description", "type": "text", "value": "{{updatephone_number_plan_description}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Presence", "description": "", "item": [ { "name": "ListPresence", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['presence'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=presence&action=list", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "List Presences in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "{{listpresence_format}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{listpresence_domain}}", "enabled": true }, { "key": "last_update", "type": "text", "value": "{{listpresence_last_update}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{listpresence_limit}}", "enabled": false }, { "key": "department", "type": "text", "value": "{{listpresence_department}}", "enabled": false }, { "key": "order", "type": "text", "value": "{{listpresence_order}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Queued", "description": "", "item": [ { "name": "ReadQueued", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"queue_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of Callqueue object.<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain to which Callqueue belongs.<\\\/p>\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description of Callqueue object.<\\\/p>\"\n },\n \"default_user\": {\n \"type\": \"string\",\n \"description\": \"<p>Default user of Callqueue object.<\\\/p>\"\n },\n \"queue_option\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['queued'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=queued&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read queued calls in a Callqueue", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readqueued_domain}}", "enabled": true }, { "key": "queue", "type": "text", "value": "{{readqueued_queue}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Quota", "description": "", "item": [ { "name": "CountQuota", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"<p>Number of autoa entries<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=domain&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count the number of quota entries", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{countquota_territory}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countquota_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "CreateQuota", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=quota&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create quota for a domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createquota_domain}}", "enabled": true }, { "key": "countLimit", "type": "text", "value": "{{createquota_countLimit}}", "enabled": true }, { "key": "sizeLimit", "type": "text", "value": "{{createquota_sizeLimit}}", "enabled": true }, { "key": "timeLimit", "type": "text", "value": "{{createquota_timeLimit}}", "enabled": true }, { "key": "ageLimit", "type": "text", "value": "{{createquota_ageLimit}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteQuota", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=quota&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete an existing domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletequota_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadQuota", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"countLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Maximum count of recording entries. Zero implies no limit.<\\\/p>\"\n },\n \"sizeLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Maximum storage size in KByte. Zero implies no limit.<\\\/p>\"\n },\n \"timeLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Maximum recorded duration in Seconds. Zero implies no limit.<\\\/p>\"\n },\n \"ageLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Maximum age in #days. Zero implies no limit.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['quota'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=quota&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read quotas of domains", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{readquota_territory}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readquota_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadUsagesQuota", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"count\": {\n \"type\": \"number\",\n \"description\": \"<p>Number of recording entries<\\\/p>\"\n },\n \"countLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Maximum count of recording entries. Zero implies no limit.<\\\/p>\"\n },\n \"countOver\": {\n \"type\": \"number\",\n \"description\": \"<p>Number of recording entries over the countLimit<\\\/p>\"\n },\n \"sizeTotal\": {\n \"type\": \"number\",\n \"description\": \"<p>Total storage size consumed in KBye<\\\/p>\"\n },\n \"sizeLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Maximum storage size in KByte. Zero implies no limit.<\\\/p>\"\n },\n \"sizeOver\": {\n \"type\": \"number\",\n \"description\": \"<p>Amount of storage over size limit in KByte<\\\/p>\"\n },\n \"timeTotal\": {\n \"type\": \"number\",\n \"description\": \"<p>Total recorded duration in Seconds<\\\/p>\"\n },\n \"timeLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Maximum recorded duration in Seconds. Zero implies no limit.<\\\/p>\"\n },\n \"timeOver\": {\n \"type\": \"number\",\n \"description\": \"<p>Amount of recorded duration over time limit in Seconds<\\\/p>\"\n },\n \"timeEarliest\": {\n \"type\": \"number\",\n \"description\": \"<p>Date and time of the earliest recording<\\\/p>\"\n },\n \"timeLatest\": {\n \"type\": \"number\",\n \"description\": \"<p>Date and time of the latest recording<\\\/p>\"\n },\n \"ageLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Maximum age in #days. Zero implies no limit.<\\\/p>\"\n },\n \"ageOver\": {\n \"type\": \"number\",\n \"description\": \"<p>Number of days that the earliest recording is beyong the age limit<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['quota'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=quotaUsage&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Quota Usage of domains", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{readusagesquota_territory}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readusagesquota_domain}}", "enabled": true }, { "key": "date", "type": "text", "value": "{{readusagesquota_date}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateQuota", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=quota&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update quota for a domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatequota_domain}}", "enabled": true }, { "key": "countLimit", "type": "text", "value": "{{updatequota_countLimit}}", "enabled": true }, { "key": "sizeLimit", "type": "text", "value": "{{updatequota_sizeLimit}}", "enabled": true }, { "key": "timeLimit", "type": "text", "value": "{{updatequota_timeLimit}}", "enabled": true }, { "key": "ageLimit", "type": "text", "value": "{{updatequota_ageLimit}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Recording", "description": "", "item": [ { "name": "CreateRecording", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=recording&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create Recordings", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{createrecording_aor}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteRecording", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=recording&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete Recordings", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{deleterecording_aor}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadRecording", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"status\": {\n \"type\": \"string\",\n \"description\": \"<p>Status of the recording<\\\/p>\"\n },\n \"call_id\": {\n \"type\": \"string\",\n \"description\": \"<p>Call-ID associated with the recording<\\\/p>\"\n },\n \"time_open\": {\n \"type\": \"string\",\n \"description\": \"<p>Date &amp; Time that the recording started<\\\/p>\"\n },\n \"time_close\": {\n \"type\": \"string\",\n \"description\": \"<p>Date &amp; Time that the recording stopped<\\\/p>\"\n },\n \"duration\": {\n \"type\": \"number\",\n \"description\": \"<p>Duration of the recording in seconds<\\\/p>\"\n },\n \"size\": {\n \"type\": \"number\",\n \"description\": \"<p>Size of converted file in KByte<\\\/p>\"\n },\n \"time\": {\n \"type\": \"string\",\n \"description\": \"<p>Time reference for the URL<\\\/p>\"\n },\n \"geo_id\": {\n \"type\": \"string\",\n \"description\": \"<p>Corresponding Orig Call ID, if call_id is for a Geo Tunneled entry<\\\/p>\"\n },\n \"url\": {\n \"type\": \"string\",\n \"description\": \"<p>URL to Retrieve the Recording<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['recording'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=recording&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Recordings", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "orig_callid", "type": "text", "value": "{{readrecording_orig_callid}}", "enabled": true }, { "key": "term_callid", "type": "text", "value": "{{readrecording_term_callid}}", "enabled": true }, { "key": "callid", "type": "text", "value": "{{readrecording_callid}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateRecording", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"time\": {\n \"type\": \"string\",\n \"description\": \"<p>Time reference for the URL<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=recording&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update Recordings", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "aor", "type": "text", "value": "{{updaterecording_aor}}", "enabled": true }, { "key": "status", "type": "text", "value": "{{updaterecording_status}}", "enabled": true }, { "key": "call_id", "type": "text", "value": "{{updaterecording_call_id}}", "enabled": true }, { "key": "time_open", "type": "text", "value": "{{updaterecording_time_open}}", "enabled": true }, { "key": "time_close", "type": "text", "value": "{{updaterecording_time_close}}", "enabled": true }, { "key": "duration", "type": "text", "value": "{{updaterecording_duration}}", "enabled": true }, { "key": "size", "type": "text", "value": "{{updaterecording_size}}", "enabled": true }, { "key": "geo_id", "type": "text", "value": "{{updaterecording_geo_id}}", "enabled": true }, { "key": "url", "type": "text", "value": "{{updaterecording_url}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Reseller", "description": "", "item": [ { "name": "CountReseller", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of Resellers in the specified domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=reseller&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count resellers", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{countreseller_territory}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateReseller", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=reseller&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a reseller", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{createreseller_territory}}", "enabled": true }, { "key": "description", "type": "text", "value": "{{createreseller_description}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteReseller", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=reseller&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a reseller", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{deletereseller_territory}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadReseller", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"territory_id\": {\n \"type\": \"number\",\n \"description\": \"<p>Unique Territory ID<\\\/p>\"\n },\n \"territory\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of Territory<\\\/p>\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description of Territory<\\\/p>\"\n },\n \"entry_status\": {\n \"type\": \"string\",\n \"description\": \"<p>Status of entry (active,locked)<\\\/p>\"\n },\n \"smtp_host\": {\n \"type\": \"string\",\n \"description\": \"<p>Email setting: host server<\\\/p>\"\n },\n \"smtp_port\": {\n \"type\": \"string\",\n \"description\": \"<p>Email setting: host port<\\\/p>\"\n },\n \"smtp_uid\": {\n \"type\": \"string\",\n \"description\": \"<p>Email setting: user<\\\/p>\"\n },\n \"smtp_pwd\": {\n \"type\": \"string\",\n \"description\": \"<p>Email setting: password<\\\/p>\"\n },\n \"users\": {\n \"type\": \"number\",\n \"description\": \"<p>Count of Users<\\\/p>\"\n },\n \"domains\": {\n \"type\": \"number\",\n \"description\": \"<p>Count of Domains<\\\/p>\"\n },\n \"countForLimit\": {\n \"type\": \"number\",\n \"description\": \"<p>Count of Active Calls<\\\/p>\"\n },\n \"countExternal\": {\n \"type\": \"number\",\n \"description\": \"<p>Count of Offnet Active Calls<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['reseller'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=reseller&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read resellers", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{readreseller_territory}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readreseller_start}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readreseller_limit}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{readreseller_sort}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateReseller", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=reseller&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a reseller", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "territory", "type": "text", "value": "{{updatereseller_territory}}", "enabled": true }, { "key": "description", "type": "text", "value": "{{updatereseller_description}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "SMS_Number", "description": "", "item": [ { "name": "CountSMS_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"number\"],\n \"properties\": {\n \"number\": {\n \"type\": \"string\",\n \"description\": \"<p>The count of SMS enabled phonenumber<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=smsnumber&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count numbers with SMS support", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countsms_number_domain}}", "enabled": false }, { "key": "dest", "type": "text", "value": "{{countsms_number_dest}}", "enabled": false }, { "key": "number", "type": "text", "value": "{{countsms_number_number}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateSMS_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=smsnumber&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create SMS Number", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createsms_number_domain}}", "enabled": true }, { "key": "number", "type": "text", "value": "{{createsms_number_number}}", "enabled": true }, { "key": "application", "type": "text", "value": "{{createsms_number_application}}", "enabled": true }, { "key": "dest", "type": "text", "value": "{{createsms_number_dest}}", "enabled": true } ] } }, "response": [] }, { "name": "ReadSMS_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [\"number\"],\n \"properties\": {\n \"number\": {\n \"type\": \"string\",\n \"description\": \"<p>The SMS enabled phonenumber<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['sms_number'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=smsnumber&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read numbers with SMS support", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readsms_number_domain}}", "enabled": false }, { "key": "dest", "type": "text", "value": "{{readsms_number_dest}}", "enabled": false }, { "key": "number", "type": "text", "value": "{{readsms_number_number}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateSMS_Number", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=smsnumber&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update SMS Number", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatesms_number_domain}}", "enabled": true }, { "key": "number", "type": "text", "value": "{{updatesms_number_number}}", "enabled": true }, { "key": "application", "type": "text", "value": "{{updatesms_number_application}}", "enabled": true }, { "key": "dest", "type": "text", "value": "{{updatesms_number_dest}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Server_Info", "description": "", "item": [ { "name": "ReadServer_Info", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['server_info'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=elementdomain&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Server info aka, element domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "hostname", "type": "text", "value": "{{readserver_info_hostname}}", "enabled": false }, { "key": "element_id", "type": "text", "value": "{{readserver_info_element_id}}", "enabled": false }, { "key": "fields", "type": "text", "value": "{{readserver_info_fields}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Sfu", "description": "", "item": [ { "name": "CreateSfu", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"<p>Number of autoa entries<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=sfu&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create an access token for access to SFU server", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{createsfu_uid}}", "enabled": true }, { "key": "room_id", "type": "text", "value": "{{createsfu_room_id}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Site", "description": "", "item": [ { "name": "ListSite", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['site'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=site&action=list", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "List Sites in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{listsite_domain}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Subscriber", "description": "", "item": [ { "name": "CountSubscriber", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"number\",\n \"description\": \"<p>Total number of Subscribers in the specified domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=subscriber&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count Users in a Domain", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countsubscriber_domain}}", "enabled": true }, { "key": "territory", "type": "text", "value": "{{countsubscriber_territory}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateSubscriber", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=subscriber&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a new User", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{createsubscriber_uid}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{createsubscriber_user}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createsubscriber_domain}}", "enabled": true }, { "key": "subscriber_login", "type": "text", "value": "{{createsubscriber_subscriber_login}}", "enabled": false }, { "key": "first_name", "type": "text", "value": "{{createsubscriber_first_name}}", "enabled": false }, { "key": "last_name", "type": "text", "value": "{{createsubscriber_last_name}}", "enabled": false }, { "key": "passwordLength", "type": "text", "value": "{{createsubscriber_passwordLength}}", "enabled": false }, { "key": "pwd_hash", "type": "text", "value": "{{createsubscriber_pwd_hash}}", "enabled": false }, { "key": "subscriber_pin", "type": "text", "value": "{{createsubscriber_subscriber_pin}}", "enabled": false }, { "key": "dir_anc", "type": "text", "value": "{{createsubscriber_dir_anc}}", "enabled": false }, { "key": "dir_list", "type": "text", "value": "{{createsubscriber_dir_list}}", "enabled": false }, { "key": "message", "type": "text", "value": "{{createsubscriber_message}}", "enabled": false }, { "key": "pwd", "type": "text", "value": "{{createsubscriber_pwd}}", "enabled": false }, { "key": "group", "type": "text", "value": "{{createsubscriber_group}}", "enabled": false }, { "key": "dir", "type": "text", "value": "{{createsubscriber_dir}}", "enabled": false }, { "key": "email", "type": "text", "value": "{{createsubscriber_email}}", "enabled": false }, { "key": "vmail_provisioned", "type": "text", "value": "{{createsubscriber_vmail_provisioned}}", "enabled": false }, { "key": "vmail_frd_to", "type": "text", "value": "{{createsubscriber_vmail_frd_to}}", "enabled": false }, { "key": "vmail_enabled", "type": "text", "value": "{{createsubscriber_vmail_enabled}}", "enabled": false }, { "key": "vmail_greeting", "type": "text", "value": "{{createsubscriber_vmail_greeting}}", "enabled": false }, { "key": "vmail_notify", "type": "text", "value": "{{createsubscriber_vmail_notify}}", "enabled": false }, { "key": "vmail_annc_time", "type": "text", "value": "{{createsubscriber_vmail_annc_time}}", "enabled": false }, { "key": "vmail_annc_cid", "type": "text", "value": "{{createsubscriber_vmail_annc_cid}}", "enabled": false }, { "key": "vmail_sort_lifo", "type": "text", "value": "{{createsubscriber_vmail_sort_lifo}}", "enabled": false }, { "key": "vmail_transcribe", "type": "text", "value": "{{createsubscriber_vmail_transcribe}}", "enabled": false }, { "key": "data_limit", "type": "text", "value": "{{createsubscriber_data_limit}}", "enabled": false }, { "key": "call_limit", "type": "text", "value": "{{createsubscriber_call_limit}}", "enabled": false }, { "key": "dial_plan", "type": "text", "value": "{{createsubscriber_dial_plan}}", "enabled": false }, { "key": "dial_policy", "type": "text", "value": "{{createsubscriber_dial_policy}}", "enabled": false }, { "key": "area_code", "type": "text", "value": "{{createsubscriber_area_code}}", "enabled": false }, { "key": "callid_name", "type": "text", "value": "{{createsubscriber_callid_name}}", "enabled": false }, { "key": "callid_nmbr", "type": "text", "value": "{{createsubscriber_callid_nmbr}}", "enabled": false }, { "key": "callid_emgr", "type": "text", "value": "{{createsubscriber_callid_emgr}}", "enabled": false }, { "key": "no_answer_timeout", "type": "text", "value": "{{createsubscriber_no_answer_timeout}}", "enabled": false }, { "key": "time_zone", "type": "text", "value": "{{createsubscriber_time_zone}}", "enabled": false }, { "key": "scope", "type": "text", "value": "{{createsubscriber_scope}}", "enabled": false }, { "key": "rej_anony", "type": "text", "value": "{{createsubscriber_rej_anony}}", "enabled": false }, { "key": "screen", "type": "text", "value": "{{createsubscriber_screen}}", "enabled": false }, { "key": "srv_code", "type": "text", "value": "{{createsubscriber_srv_code}}", "enabled": false }, { "key": "ntfy_missed_call", "type": "text", "value": "{{createsubscriber_ntfy_missed_call}}", "enabled": false }, { "key": "ntfy_data_limit", "type": "text", "value": "{{createsubscriber_ntfy_data_limit}}", "enabled": false }, { "key": "language", "type": "text", "value": "{{createsubscriber_language}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteSubscriber", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=subscriber&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete an existing User", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{deletesubscriber_uid}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletesubscriber_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{deletesubscriber_user}}", "enabled": false }, { "key": "termination_match", "type": "text", "value": "{{deletesubscriber_termination_match}}", "enabled": false }, { "key": "device", "type": "text", "value": "{{deletesubscriber_device}}", "enabled": false } ] } }, "response": [] }, { "name": "ListSubscriber", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"group\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dir\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['subscriber'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=subscriber&action=list", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "List public info on Users", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{listsubscriber_domain}}", "enabled": true }, { "key": "fields", "type": "text", "value": "{{listsubscriber_fields}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadSubscriber", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"user\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"first_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"last_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"subscriber_login\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"subscriber_pin\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"pwd_hash\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"group\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"site\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dir\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"email\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"presence\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"message\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"accept\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"reject\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_provisioned\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_enabled\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_greeting\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_notify\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_annc_time\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_annc_cid\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_sort_lifo\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_transcribe\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"vmail_fwd_to\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"data_limit\": {\n \"type\": \"number\",\n \"description\": \"\"\n },\n \"call_limit\": {\n \"type\": \"number\",\n \"description\": \"\"\n },\n \"dial_plan\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dial_policy\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"area_code\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"callid_name\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"callid_nmbr\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"callid_emgr\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"no_answer_timeout\": {\n \"type\": \"number\",\n \"description\": \"\"\n },\n \"time_zone\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dir_anc\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"dir_list\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"date_created\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"scope\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"rej_anony\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"directory_order\": {\n \"type\": \"number\",\n \"description\": \"\"\n },\n \"screen\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"srv_code\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"ntfy_missed_call\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"ntfy_data_limit\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"language\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"gauSession\": {\n \"type\": \"number\",\n \"description\": \"\"\n },\n \"last_update\": {\n \"type\": \"string\",\n \"description\": \"\"\n },\n \"account_status\": {\n \"type\": \"string\",\n \"description\": \"\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['subscriber'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=subscriber&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read info on existing Users", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{readsubscriber_uid}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{readsubscriber_user}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readsubscriber_domain}}", "enabled": true }, { "key": "login", "type": "text", "value": "{{readsubscriber_login}}", "enabled": false }, { "key": "limit", "type": "text", "value": "{{readsubscriber_limit}}", "enabled": false }, { "key": "first_name", "type": "text", "value": "{{readsubscriber_first_name}}", "enabled": false }, { "key": "last_name", "type": "text", "value": "{{readsubscriber_last_name}}", "enabled": false }, { "key": "group", "type": "text", "value": "{{readsubscriber_group}}", "enabled": false }, { "key": "fields", "type": "text", "value": "{{readsubscriber_fields}}", "enabled": false }, { "key": "srv_code", "type": "text", "value": "{{readsubscriber_srv_code}}", "enabled": false }, { "key": "email", "type": "text", "value": "{{readsubscriber_email}}", "enabled": false }, { "key": "dir", "type": "text", "value": "{{readsubscriber_dir}}", "enabled": false }, { "key": "filter_users", "type": "text", "value": "{{readsubscriber_filter_users}}", "enabled": false }, { "key": "directory_match", "type": "text", "value": "{{readsubscriber_directory_match}}", "enabled": false }, { "key": "owner", "type": "text", "value": "{{readsubscriber_owner}}", "enabled": false }, { "key": "scope", "type": "text", "value": "{{readsubscriber_scope}}", "enabled": false }, { "key": "start", "type": "text", "value": "{{readsubscriber_start}}", "enabled": false }, { "key": "sort", "type": "text", "value": "{{readsubscriber_sort}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateSubscriber", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=subscriber&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update an existing User", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "uid", "type": "text", "value": "{{updatesubscriber_uid}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updatesubscriber_user}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{updatesubscriber_domain}}", "enabled": false }, { "key": "first_name", "type": "text", "value": "{{updatesubscriber_first_name}}", "enabled": false }, { "key": "last_name", "type": "text", "value": "{{updatesubscriber_last_name}}", "enabled": false }, { "key": "dir_anc", "type": "text", "value": "{{updatesubscriber_dir_anc}}", "enabled": false }, { "key": "dir_list", "type": "text", "value": "{{updatesubscriber_dir_list}}", "enabled": false }, { "key": "message", "type": "text", "value": "{{updatesubscriber_message}}", "enabled": false }, { "key": "subscriber_login", "type": "text", "value": "{{updatesubscriber_subscriber_login}}", "enabled": false }, { "key": "pwd", "type": "text", "value": "{{updatesubscriber_pwd}}", "enabled": false }, { "key": "current_password", "type": "text", "value": "{{updatesubscriber_current_password}}", "enabled": false }, { "key": "pwd_hash", "type": "text", "value": "{{updatesubscriber_pwd_hash}}", "enabled": false }, { "key": "group", "type": "text", "value": "{{updatesubscriber_group}}", "enabled": false }, { "key": "dir", "type": "text", "value": "{{updatesubscriber_dir}}", "enabled": false }, { "key": "email", "type": "text", "value": "{{updatesubscriber_email}}", "enabled": false }, { "key": "vmail_provisioned", "type": "text", "value": "{{updatesubscriber_vmail_provisioned}}", "enabled": false }, { "key": "vmail_frd_to", "type": "text", "value": "{{updatesubscriber_vmail_frd_to}}", "enabled": false }, { "key": "vmail_enabled", "type": "text", "value": "{{updatesubscriber_vmail_enabled}}", "enabled": false }, { "key": "vmail_greeting", "type": "text", "value": "{{updatesubscriber_vmail_greeting}}", "enabled": false }, { "key": "vmail_notify", "type": "text", "value": "{{updatesubscriber_vmail_notify}}", "enabled": false }, { "key": "vmail_annc_time", "type": "text", "value": "{{updatesubscriber_vmail_annc_time}}", "enabled": false }, { "key": "vmail_annc_cid", "type": "text", "value": "{{updatesubscriber_vmail_annc_cid}}", "enabled": false }, { "key": "vmail_sort_lifo", "type": "text", "value": "{{updatesubscriber_vmail_sort_lifo}}", "enabled": false }, { "key": "vmail_transcribe", "type": "text", "value": "{{updatesubscriber_vmail_transcribe}}", "enabled": false }, { "key": "data_limit", "type": "text", "value": "{{updatesubscriber_data_limit}}", "enabled": false }, { "key": "call_limit", "type": "text", "value": "{{updatesubscriber_call_limit}}", "enabled": false }, { "key": "dial_plan", "type": "text", "value": "{{updatesubscriber_dial_plan}}", "enabled": false }, { "key": "dial_policy", "type": "text", "value": "{{updatesubscriber_dial_policy}}", "enabled": false }, { "key": "area_code", "type": "text", "value": "{{updatesubscriber_area_code}}", "enabled": false }, { "key": "callid_name", "type": "text", "value": "{{updatesubscriber_callid_name}}", "enabled": false }, { "key": "callid_nmbr", "type": "text", "value": "{{updatesubscriber_callid_nmbr}}", "enabled": false }, { "key": "callid_emgr", "type": "text", "value": "{{updatesubscriber_callid_emgr}}", "enabled": false }, { "key": "no_answer_timeout", "type": "text", "value": "{{updatesubscriber_no_answer_timeout}}", "enabled": false }, { "key": "time_zone", "type": "text", "value": "{{updatesubscriber_time_zone}}", "enabled": false }, { "key": "scope", "type": "text", "value": "{{updatesubscriber_scope}}", "enabled": false }, { "key": "rej_anony", "type": "text", "value": "{{updatesubscriber_rej_anony}}", "enabled": false }, { "key": "screen", "type": "text", "value": "{{updatesubscriber_screen}}", "enabled": false }, { "key": "srv_code", "type": "text", "value": "{{updatesubscriber_srv_code}}", "enabled": false }, { "key": "ntfy_missed_call", "type": "text", "value": "{{updatesubscriber_ntfy_missed_call}}", "enabled": false }, { "key": "ntfy_data_limit", "type": "text", "value": "{{updatesubscriber_ntfy_data_limit}}", "enabled": false }, { "key": "language", "type": "text", "value": "{{updatesubscriber_language}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Subscription", "description": "", "item": [ { "name": "CreateSubscription", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"subscription_id\": {\n \"type\": \"string\",\n \"description\": \"<p>A unique ID coresponding to the new subscription. Save and use for any updates or deletes of the subscription.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=event&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a new event subscriptions", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "model", "type": "text", "value": "{{createsubscription_model}}", "enabled": true }, { "key": "post_url", "type": "text", "value": "{{createsubscription_post_url}}", "enabled": true }, { "key": "expires", "type": "text", "value": "{{createsubscription_expires}}", "enabled": false }, { "key": "domain", "type": "text", "value": "{{createsubscription_domain}}", "enabled": true } ] } }, "response": [] }, { "name": "DeleteSubscription", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=event&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a event subscriptions", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "subscription_id", "type": "text", "value": "{{deletesubscription_subscription_id}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deletesubscription_domain}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadSubscription", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['subscription'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=event&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "read a event subscriptions", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "subscription_id", "type": "text", "value": "{{readsubscription_subscription_id}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readsubscription_domain}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Time_Frame", "description": "", "item": [ { "name": "CreateTime_Frame", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=timeframe&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a specific Time Frame", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createtime_frame_domain}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{createtime_frame_uid}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{createtime_frame_user}}", "enabled": true }, { "key": "owner", "type": "text", "value": "{{createtime_frame_owner}}", "enabled": true }, { "key": "owner_domain", "type": "text", "value": "{{createtime_frame_owner_domain}}", "enabled": true }, { "key": "enable", "type": "text", "value": "{{createtime_frame_enable}}", "enabled": false }, { "key": "order", "type": "text", "value": "{{createtime_frame_order}}", "enabled": false }, { "key": "selection_order", "type": "text", "value": "{{createtime_frame_selection_order}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadTime_Frame", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['time_frame'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=timeframe&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read info on a specific Time Frame", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readtime_frame_domain}}", "enabled": true }, { "key": "start", "type": "text", "value": "{{readtime_frame_start}}", "enabled": true }, { "key": "limit", "type": "text", "value": "{{readtime_frame_limit}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateTime_Frame", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=timeframe&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a specific Time Frame", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updatetime_frame_domain}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{updatetime_frame_uid}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updatetime_frame_user}}", "enabled": true }, { "key": "owner", "type": "text", "value": "{{updatetime_frame_owner}}", "enabled": true }, { "key": "owner_domain", "type": "text", "value": "{{updatetime_frame_owner_domain}}", "enabled": true }, { "key": "enable", "type": "text", "value": "{{updatetime_frame_enable}}", "enabled": false }, { "key": "order", "type": "text", "value": "{{updatetime_frame_order}}", "enabled": false }, { "key": "selection_order", "type": "text", "value": "{{updatetime_frame_selection_order}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "Time_Range", "description": "", "item": [ { "name": "CreateTime_Range", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=timerange&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a specific Time Range", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "date_from", "type": "text", "value": "{{createtime_range_date_from}}", "enabled": true }, { "key": "date_to", "type": "text", "value": "{{createtime_range_date_to}}", "enabled": true }, { "key": "tod_from", "type": "text", "value": "{{createtime_range_tod_from}}", "enabled": true }, { "key": "tod_to", "type": "text", "value": "{{createtime_range_tod_to}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{createtime_range_uid}}", "enabled": false }, { "key": "owner_domain", "type": "text", "value": "{{createtime_range_owner_domain}}", "enabled": true }, { "key": "owner", "type": "text", "value": "{{createtime_range_owner}}", "enabled": true }, { "key": "time_frame", "type": "text", "value": "{{createtime_range_time_frame}}", "enabled": true }, { "key": "days", "type": "text", "value": "{{createtime_range_days}}", "enabled": false }, { "key": "invert", "type": "text", "value": "{{createtime_range_invert}}", "enabled": false }, { "key": "order", "type": "text", "value": "{{createtime_range_order}}", "enabled": true } ] } }, "response": [] }, { "name": "UpdateTime_Range", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=timerange&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a specific Time Range", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "date_from", "type": "text", "value": "{{updatetime_range_date_from}}", "enabled": true }, { "key": "date_to", "type": "text", "value": "{{updatetime_range_date_to}}", "enabled": true }, { "key": "tod_from", "type": "text", "value": "{{updatetime_range_tod_from}}", "enabled": true }, { "key": "tod_to", "type": "text", "value": "{{updatetime_range_tod_to}}", "enabled": true }, { "key": "uid", "type": "text", "value": "{{updatetime_range_uid}}", "enabled": false }, { "key": "owner_domain", "type": "text", "value": "{{updatetime_range_owner_domain}}", "enabled": true }, { "key": "owner", "type": "text", "value": "{{updatetime_range_owner}}", "enabled": true }, { "key": "time_frame", "type": "text", "value": "{{updatetime_range_time_frame}}", "enabled": true }, { "key": "days", "type": "text", "value": "{{updatetime_range_days}}", "enabled": false }, { "key": "invert", "type": "text", "value": "{{updatetime_range_invert}}", "enabled": false }, { "key": "order", "type": "text", "value": "{{updatetime_range_order}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "Turn", "description": "", "item": [ { "name": "ReadTurn", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"JSON\": {\n \"type\": \"string\",\n \"description\": \"<p>A valid response will be welformed json you can just use in a javascript SDK.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['turn'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=turn&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read turn server creds", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readturn_domain}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{readturn_user}}", "enabled": true } ] } }, "response": [] } ] }, { "name": "UC_Inbox", "description": "", "item": [ { "name": "ReadUC_Inbox", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"conversation_type\": {\n \"type\": \"string\",\n \"description\": \"<p>Type of message (vmail, call, message, fax)<\\\/p>\"\n },\n \"conversation_id\": {\n \"type\": \"string\",\n \"description\": \"<p>ID of conversation taken from unique id for object type<\\\/p>\"\n },\n \"other\": {\n \"type\": \"string\",\n \"description\": \"<p>The remaining data will be similar to the object of its type. Refer to #api-CDR, #api-Session, #api-Audio for more<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['uc_inbox'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=conversation&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read Conversations (Vmail, Calls, Chat)", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readuc_inbox_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{readuc_inbox_user}}", "enabled": false } ] } }, "response": [] } ] }, { "name": "UI_Config", "description": "", "item": [ { "name": "CountUI_Config", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"total\": {\n \"type\": \"string\",\n \"description\": \"<p>Total number of UI Configurations in the specified domain.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple([jsonData], schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=uiconfig&action=count", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Count UI Configurations", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "config_name", "type": "text", "value": "{{countui_config_config_name}}", "enabled": true }, { "key": "domain", "type": "text", "value": "{{countui_config_domain}}", "enabled": false }, { "key": "user", "type": "text", "value": "{{countui_config_user}}", "enabled": false }, { "key": "role", "type": "text", "value": "{{countui_config_role}}", "enabled": false }, { "key": "login_type", "type": "text", "value": "{{countui_config_login_type}}", "enabled": false } ] } }, "response": [] }, { "name": "CreateUI_Config", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=uiconfig&action=create", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Create a UI Configuration", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{createui_config_domain}}", "enabled": true }, { "key": "config_name", "type": "text", "value": "{{createui_config_config_name}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{createui_config_user}}", "enabled": false }, { "key": "role", "type": "text", "value": "{{createui_config_role}}", "enabled": false }, { "key": "login_type", "type": "text", "value": "{{createui_config_login_type}}", "enabled": false }, { "key": "config_value", "type": "text", "value": "{{createui_config_config_value}}", "enabled": false }, { "key": "description", "type": "text", "value": "{{createui_config_description}}", "enabled": false } ] } }, "response": [] }, { "name": "DeleteUI_Config", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=uiconfig&action=delete", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Delete a UI Configuration", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{deleteui_config_domain}}", "enabled": true }, { "key": "config_name", "type": "text", "value": "{{deleteui_config_config_name}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{deleteui_config_user}}", "enabled": false }, { "key": "role", "type": "text", "value": "{{deleteui_config_role}}", "enabled": false }, { "key": "login_type", "type": "text", "value": "{{deleteui_config_login_type}}", "enabled": false } ] } }, "response": [] }, { "name": "ReadUI_Config", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 200;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsXml = responseHeaders[\"Content-Type\"].has(\"text\/xml\");\nvar contentIsJson = responseHeaders[\"Content-Type\"].has(\"application\/json\");\n\nif (contentIsXml) {\n tests[\"Content-Type is text\/xml\"] = true;\n} else if(contentIsJson) {\n tests[\"Content-Type is application\/json\"] = true;\n} else {\n tests[\"Unexpected Content-Type: \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": {\n \"config_name\": {\n \"type\": \"string\",\n \"description\": \"<p>Name of UI Configuration.<\\\/p>\"\n },\n \"config_value\": {\n \"type\": \"string\",\n \"description\": \"<p>Value of UI Configuration.<\\\/p>\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"<p>Description of UI Configuration.<\\\/p>\"\n },\n \"domain\": {\n \"type\": \"string\",\n \"description\": \"<p>Domain of UI Configuration.<\\\/p>\"\n }\n}\n }\n};\n\nif( responseBody ) {\n if( contentIsXml ) {\n var jsonData = xml2Json(responseBody)['xml']['ui_config'];\n if( !Array.isArray(jsonData) ) jsonData = [jsonData];\n } else if( contentIsJson ) {\n var jsonData = JSON.parse(responseBody);\n } else {\n tests[\"Cannot parse response body: Unknown content format\"] = false;\n }\n\n if( typeof jsonData === 'undefined' ) {\n tests[\"Failed to parse response body: Invalid body format\"] = false;\n } else {\n var checkRecursive = true;\n var banUnknownProperties = true;\n var validation = tv4.validateMultiple(jsonData, schema, checkRecursive, banUnknownProperties);\n\n if( !validation.valid ) {\n for (var i in validation.errors) {\n var errorMsg = validation.errors[i].message + ': ' + validation.errors[i].dataPath;\n errorMsg = errorMsg.replace(\/\\\/[0-9]*\\\/\/,'');\n errorMsg = errorMsg.replace(\/: \\\/[0-9]*\/,'');\n tests[errorMsg] = false;\n }\n } else {\n tests[\"Output schema is valid\"] = true;\n }\n }\n} else {\n tests[\"Response body has content\"] = false;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=uiconfig&action=read", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Read a UI Configuration", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{readui_config_domain}}", "enabled": true }, { "key": "config_name", "type": "text", "value": "{{readui_config_config_name}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{readui_config_user}}", "enabled": false }, { "key": "role", "type": "text", "value": "{{readui_config_role}}", "enabled": false }, { "key": "login_type", "type": "text", "value": "{{readui_config_login_type}}", "enabled": false } ] } }, "response": [] }, { "name": "UpdateUI_Config", "event": [ { "listen": "test", "script": { "type": "text\/javascript", "exec": "tests[\"Successful POST request\"] = responseCode.code === 202;\n\nvar contentTypeHeaderExists = responseHeaders.hasOwnProperty(\"Content-Type\");\n\ntests[\"Has Content-Type\"] = contentTypeHeaderExists;\n\nvar contentIsPlain = responseHeaders[\"Content-Type\"].has(\"text\/plain\");\n\nif (contentIsPlain) {\n tests[\"Content-Type is text\/plain\"] = true;\n} else {\n tests[\"Content-Type is \" + responseHeaders[\"Content-Type\"]] = false;\n}\n\nvar schema = {\n \"items\": {\n \"type\": \"object\",\n \"required\": [],\n \"properties\": []\n }\n};\n\nif( responseBody ) {\n tests[\"Response body contains content\"] = false;\n} else {\n tests[\"Response body empty\"] = true;\n}\n" } }, { "listen": "prerequest", "script": { "type": "text\/javascript", "exec": "" } } ], "request": { "url": "{{api_url}}\/?object=uiconfig&action=update", "method": "post", "header": [ { "key": "Authorization", "value": "{{token_type}} {{access_token}}", "description": "" } ], "description": "Update a UI Configuration", "body": { "mode": "formdata", "formdata": [ { "key": "format", "type": "text", "value": "json", "enabled": true }, { "key": "domain", "type": "text", "value": "{{updateui_config_domain}}", "enabled": true }, { "key": "config_name", "type": "text", "value": "{{updateui_config_config_name}}", "enabled": true }, { "key": "user", "type": "text", "value": "{{updateui_config_user}}", "enabled": false }, { "key": "role", "type": "text", "value": "{{updateui_config_role}}", "enabled": false }, { "key": "login_type", "type": "text", "value": "{{updateui_config_login_type}}", "enabled": false }, { "key": "config_value", "type": "text", "value": "{{updateui_config_config_value}}", "enabled": false }, { "key": "description", "type": "text", "value": "{{updateui_config_description}}", "enabled": false } ] } }, "response": [] } ] } ] } |