openapi: 3.2.0 info: title: Connectivity Alerting API description: Connectivity APIs help users manage their connectivity through APIs. version: 1.0.0 servers: - url: https://api.korewireless.com/connectivity description: Production security: - {} - Auth: [] - api_key: [] tags: - name: alerting description: APIs that provides alerts on subscribed events paths: /v1/accounts/{account-id}/events: get: tags: - alerting summary: Lists All Events description: Get all eligible events for an account operationId: getEventsByAccountId parameters: - name: account-id in: path description: The unique identifier of your account required: true style: simple explode: false schema: type: string responses: '200': description: 200 response headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: array items: type: object properties: event-id: type: string event-name: type: string event-description: type: string category: type: string event-attributes: type: array items: type: object properties: name: type: string description: type: string type: type: string actions: type: array items: type: string default-frequency: type: string frequency-attribute: type: string frequencies: type: array items: type: string $$ref: '#/components/schemas/Events_inner' $$ref: '#/components/schemas/Events' '400': description: Bad Request headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '401': description: Unauthorised User headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: required: - error - message type: object properties: error: type: integer format: int32 message: type: string $$ref: '#/components/schemas/Error' '403': description: Forbidden headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '404': description: The Specified Resource Was Not Found headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: INFO: type: string $$ref: '#/components/schemas/NotFound_Error' '500': description: Server Error headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' x-code-samples: - lang: cURL label: cURL source: 'curl --location --globoff ''{{baseUrl}}/v1/accounts/{account-id}/events'' \ --header ''Accept: application/json''' - lang: js label: NodeJs source: "var request = require('request');\nvar options = {\n 'method': 'GET',\n 'url': '{{baseUrl}}/v1/accounts/{account-id}/events',\n 'headers': {\n 'Accept': 'application/json'\n }\n};\nrequest(options, function (error, response) {\n if (error) throw new Error(error);\n console.log(response.body);\n});\n" - lang: java label: Java source: "OkHttpClient client = new OkHttpClient().newBuilder()\n .build();\nMediaType mediaType = MediaType.parse(\"text/plain\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n .url(\"{{baseUrl}}/v1/accounts/{account-id}/events\")\n .method(\"GET\", body)\n .addHeader(\"Accept\", \"application/json\")\n .build();\nResponse response = client.newCall(request).execute();" - lang: cs label: C# source: "var options = new RestClientOptions(\"{{baseUrl}}/v1/accounts/{account-id}/events\")\n{\n MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"\", Method.Get);\nrequest.AddHeader(\"Accept\", \"application/json\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);" - lang: PHP label: Php source: " '{{baseUrl}}/v1/accounts/{account-id}/events',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'GET',\n CURLOPT_HTTPHEADER => array(\n 'Authorization: Bearer ',\n 'x-api-key: ')\n CURLOPT_HTTPHEADER => array(\n 'Accept: application/json'\n ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n" - lang: py label: Python source: "import requests\n\nurl = \"{{baseUrl}}/v1/accounts/{account-id}/events\"\n\npayload = {}\nheaders = {\n 'Accept': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n" __originalOperationId: getEventsByAccountId security: - {} - Auth: [] - api_key: [] /v1/accounts/{account-id}/rules: get: tags: - alerting summary: Lists All Rules description: Get all eligible rules for an account operationId: getRulesByAccountId parameters: - name: account-id in: path description: The unique identifier of your account required: true style: simple explode: false schema: type: string responses: '200': description: 200 response headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: account-id: type: string rules: type: array items: type: object properties: rule-id: type: string rule-name: type: string event-name: type: string enabled: type: boolean date-added: type: string format: dateTime date-updated: type: string format: dateTime conditions: type: array items: type: object properties: attribute-name: type: string condition-operator: type: string attribute-value: type: string example: null $$ref: '#/components/schemas/Rules_conditions' actions: type: object properties: webhook: type: object properties: webhook-url: type: string access-token: type: string access-token-key: type: string example: null $$ref: '#/components/schemas/Rules_actions_webhook' email: type: object properties: to: type: string cc: type: string bcc: type: string example: null $$ref: '#/components/schemas/Rules_actions_email' block-usage: type: object properties: period: type: string example: null $$ref: '#/components/schemas/Rules_actions_blockusage' example: null $$ref: '#/components/schemas/Rules_actions' alert-strategy: type: object properties: batching: type: object properties: type: type: string description: When hourly is specified, the alerts will be batched and sent every hour. When daily is specified, the alerts will be batched & sent at times specified for the value "times". enum: - daily - hourly times: type: array description: This is used to specify an array of times, in a 24-hour format, to send alerts with a max number of 10 times. This value is only needed only if the type value is "daily". If the type specified is hourly, this ‘time’ value is ignored. items: type: string format: hh:mm:ss example: null $$ref: '#/components/schemas/Rules_alertstrategy_batching' description: Optional:Define a batching strategy for the alerts you receive example: null $$ref: '#/components/schemas/Rules_alertstrategy' example: null $$ref: '#/components/schemas/Rules_rules' $$ref: '#/components/schemas/Rules' '400': description: Bad Request headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '401': description: Unauthorised User headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: required: - error - message type: object properties: error: type: integer format: int32 message: type: string $$ref: '#/components/schemas/Error' '403': description: Forbidden headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '404': description: The Specified Resource Was Not Found headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: INFO: type: string $$ref: '#/components/schemas/NotFound_Error' '500': description: Server Error headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' x-code-samples: - lang: cURL label: cURL source: 'curl --location --globoff ''{{baseUrl}}/v1/accounts/{account-id}/rules'' \ --header ''Accept: application/json''' - lang: js label: NodeJs source: "var request = require('request');\nvar options = {\n 'method': 'GET',\n 'url': '{{baseUrl}}/v1/accounts/{account-id}/rules',\n 'headers': {\n 'Accept': 'application/json'\n }\n};\nrequest(options, function (error, response) {\n if (error) throw new Error(error);\n console.log(response.body);\n});\n" - lang: java label: Java source: "OkHttpClient client = new OkHttpClient().newBuilder()\n .build();\nMediaType mediaType = MediaType.parse(\"text/plain\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n .url(\"{{baseUrl}}/v1/accounts/{account-id}/rules\")\n .method(\"GET\", body)\n .addHeader(\"Accept\", \"application/json\")\n .build();\nResponse response = client.newCall(request).execute();" - lang: cs label: C# source: "var options = new RestClientOptions(\"{{baseUrl}}/v1/accounts/{account-id}/rules\")\n{\n MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"\", Method.Get);\nrequest.AddHeader(\"Accept\", \"application/json\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);" - lang: PHP label: Php source: " '{{baseUrl}}/v1/accounts/{account-id}/rules',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'GET',\n CURLOPT_HTTPHEADER => array(\n 'Authorization: Bearer ',\n 'x-api-key: ')\n CURLOPT_HTTPHEADER => array(\n 'Accept: application/json'\n ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n" - lang: py label: Python source: "import requests\n\nurl = \"{{baseUrl}}/v1/accounts/{account-id}/rules\"\n\npayload = {}\nheaders = {\n 'Accept': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n" __originalOperationId: getRulesByAccountId security: - {} - Auth: [] - api_key: [] post: tags: - alerting summary: Add A New Rule description: adds a new rule for non usage alerting operationId: createRule parameters: - name: account-id in: path description: The unique identifier of your account required: true style: simple explode: false schema: type: string requestBody: description: create a rule content: application/json: schema: required: - actions - conditions - enabled - event-name - rule-name type: object properties: rule-name: type: string event-name: type: string enabled: type: boolean conditions: type: array description: Individual conditions are chained with AND operator by default items: type: object properties: attribute-name: type: string condition-operator: type: string description: Possible Operator values are (==, !=, <, <=, >, >=, in, not in). attribute-value: type: string example: null $$ref: '#/components/schemas/InputRule_conditions' actions: type: object properties: webhook: required: - webhook-url type: object properties: webhook-url: type: string access-token: type: string access-token-key: type: string example: null $$ref: '#/components/schemas/InputRule_actions_webhook' email: required: - to type: object properties: to: type: string cc: type: string bcc: type: string example: null $$ref: '#/components/schemas/InputRule_actions_email' block-usage: required: - period type: object properties: period: type: string example: null $$ref: '#/components/schemas/InputRule_actions_blockusage' example: null $$ref: '#/components/schemas/InputRule_actions' alert-strategy: type: object properties: batching: type: object properties: type: type: string description: When hourly is specified, the alerts will be batched and sent every hour. When daily is specified, the alerts will be batched & sent at times specified for the value "times". enum: - daily - hourly times: type: array description: This is used to specify an array of times, in a 24-hour format, to send alerts with a max number of 10 times. This value is only needed only if the type value is "daily". If the type specified is hourly, this ‘time’ value is ignored. items: type: string format: hh:mm:ss example: null $$ref: '#/components/schemas/Rules_alertstrategy_batching' description: Optional:Define a batching strategy for the alerts you receive example: null $$ref: '#/components/schemas/Rules_alertstrategy' $$ref: '#/components/schemas/InputRule' required: true responses: '200': description: 200 response headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: rule-id: type: string message: type: array items: type: string $$ref: '#/components/schemas/CreateRule' '400': description: Bad Request headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '401': description: Unauthorised User headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: required: - error - message type: object properties: error: type: integer format: int32 message: type: string $$ref: '#/components/schemas/Error' '403': description: Forbidden headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '404': description: The Specified Resource Was Not Found headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: INFO: type: string $$ref: '#/components/schemas/NotFound_Error' '500': description: Server Error headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: rule-id: type: integer message: type: array items: type: string $$ref: '#/components/schemas/Rule_500_Error' x-code-samples: - lang: cURL label: cURL source: "curl --location --globoff '{{baseUrl}}/v1/accounts/{account-id}/rules' \\\n--header 'Content-Type: application/json'\n--header 'Authorization: Bearer ' \n--header 'x-api-key: '\n--header 'Accept: application/json' \\\n--data '{\n \"actions\": {\n \"webhook\": {\n \"webhook-url\": \"\",\n \"access-token\": \"\",\n \"access-token-key\": \"\"\n },\n \"email\": {\n \"to\": \"\",\n \"cc\": \"\",\n \"bcc\": \"\"\n },\n \"block-usage\": {\n \"period\": \"\"\n }\n },\n \"conditions\": [\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n },\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n }\n ],\n \"enabled\": \"\",\n \"event-name\": \"\",\n \"rule-name\": \"\",\n \"alert-strategy\": {\n \"batching\": {\n \"type\": \"\",\n \"times\": [\n \"\"\n ]\n }\n }\n}'" - lang: js label: NodeJs source: "var request = require('request');\nvar options = {\n 'method': 'POST',\n 'url': '{{baseUrl}}/v1/accounts/{account-id}/rules',\n 'headers': {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n \"actions\": {\n \"webhook\": {\n \"webhook-url\": \"\",\n \"access-token\": \"\",\n \"access-token-key\": \"\"\n },\n \"email\": {\n \"to\": \"\",\n \"cc\": \"\",\n \"bcc\": \"\"\n },\n \"block-usage\": {\n \"period\": \"\"\n }\n },\n \"conditions\": [\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n },\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n }\n ],\n \"enabled\": \"\",\n \"event-name\": \"\",\n \"rule-name\": \"\",\n \"alert-strategy\": {\n \"batching\": {\n \"type\": \"\",\n \"times\": [\n \"\"\n ]\n }\n }\n })\n\n};\nrequest(options, function (error, response) {\n if (error) throw new Error(error);\n console.log(response.body);\n});\n" - lang: java label: Java source: "OkHttpClient client = new OkHttpClient().newBuilder()\n .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\n \\\"actions\\\": {\\n \\\"webhook\\\": {\\n \\\"webhook-url\\\": \\\"\\\",\\n \\\"access-token\\\": \\\"\\\",\\n \\\"access-token-key\\\": \\\"\\\"\\n },\\n \\\"email\\\": {\\n \\\"to\\\": \\\"\\\",\\n \\\"cc\\\": \\\"\\\",\\n \\\"bcc\\\": \\\"\\\"\\n },\\n \\\"block-usage\\\": {\\n \\\"period\\\": \\\"\\\"\\n }\\n },\\n \\\"conditions\\\": [\\n {\\n \\\"attribute-name\\\": \\\"\\\",\\n \\\"condition-operator\\\": \\\"\\\",\\n \\\"attribute-value\\\": \\\"\\\"\\n },\\n {\\n \\\"attribute-name\\\": \\\"\\\",\\n \\\"condition-operator\\\": \\\"\\\",\\n \\\"attribute-value\\\": \\\"\\\"\\n }\\n ],\\n \\\"enabled\\\": \\\"\\\",\\n \\\"event-name\\\": \\\"\\\",\\n \\\"rule-name\\\": \\\"\\\",\\n \\\"alert-strategy\\\": {\\n \\\"batching\\\": {\\n \\\"type\\\": \\\"\\\",\\n \\\"times\\\": [\\n \\\"\\\"\\n ]\\n }\\n }\\n}\");\nRequest request = new Request.Builder()\n .url(\"{{baseUrl}}/v1/accounts/{account-id}/rules\")\n .method(\"POST\", body)\n .addHeader(\"Authorization\", \"Bearer \")\n .addHeader(\"x-api-key\", \"\")\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Accept\", \"application/json\")\n .build();\nResponse response = client.newCall(request).execute();" - lang: cs label: C# source: "var options = new RestClientOptions(\"{{baseUrl}}/v1/accounts/{account-id}/rules\")\n{\n MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"\", Method.Post);\nrequest.AddHeader(\"Content-Type\", \"application/json\");\nrequest.AddHeader(\"Accept\", \"application/json\");\nvar body = @\"{\" + \"\\n\" +\n@\" \"\"actions\"\": {\" + \"\\n\" +\n@\" \"\"webhook\"\": {\" + \"\\n\" +\n@\" \"\"webhook-url\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"access-token\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"access-token-key\"\": \"\"\"\"\" + \"\\n\" +\n@\" },\" + \"\\n\" +\n@\" \"\"email\"\": {\" + \"\\n\" +\n@\" \"\"to\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"cc\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"bcc\"\": \"\"\"\"\" + \"\\n\" +\n@\" },\" + \"\\n\" +\n@\" \"\"block-usage\"\": {\" + \"\\n\" +\n@\" \"\"period\"\": \"\"\"\"\" + \"\\n\" +\n@\" }\" + \"\\n\" +\n@\" },\" + \"\\n\" +\n@\" \"\"conditions\"\": [\" + \"\\n\" +\n@\" {\" + \"\\n\" +\n@\" \"\"attribute-name\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"condition-operator\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"attribute-value\"\": \"\"\"\"\" + \"\\n\" +\n@\" },\" + \"\\n\" +\n@\" {\" + \"\\n\" +\n@\" \"\"attribute-name\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"condition-operator\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"attribute-value\"\": \"\"\"\"\" + \"\\n\" +\n@\" }\" + \"\\n\" +\n@\" ],\" + \"\\n\" +\n@\" \"\"enabled\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"event-name\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"rule-name\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"alert-strategy\"\": {\" + \"\\n\" +\n@\" \"\"batching\"\": {\" + \"\\n\" +\n@\" \"\"type\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"times\"\": [\" + \"\\n\" +\n@\" \"\"\"\"\" + \"\\n\" +\n@\" ]\" + \"\\n\" +\n@\" }\" + \"\\n\" +\n@\" }\" + \"\\n\" +\n@\"}\";\nrequest.AddStringBody(body, DataFormat.Json);\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);" - lang: PHP label: Php source: " '{{baseUrl}}/v1/accounts/{account-id}/rules',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_HTTPHEADER => array(\n 'Content-Type: application/json',\n 'Authorization: Bearer ',\n 'x-api-key: '),\n CURLOPT_POSTFIELDS =>'{\n \"actions\": {\n \"webhook\": {\n \"webhook-url\": \"\",\n \"access-token\": \"\",\n \"access-token-key\": \"\"\n },\n \"email\": {\n \"to\": \"\",\n \"cc\": \"\",\n \"bcc\": \"\"\n },\n \"block-usage\": {\n \"period\": \"\"\n }\n },\n \"conditions\": [\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n },\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n }\n ],\n \"enabled\": \"\",\n \"event-name\": \"\",\n \"rule-name\": \"\",\n \"alert-strategy\": {\n \"batching\": {\n \"type\": \"\",\n \"times\": [\n \"\"\n ]\n }\n }\n}',\n CURLOPT_HTTPHEADER => array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n" - lang: py label: Python source: "import requests\nimport json\n\nurl = \"{{baseUrl}}/v1/accounts/{account-id}/rules\"\n\npayload = json.dumps({\n \"actions\": {\n \"webhook\": {\n \"webhook-url\": \"\",\n \"access-token\": \"\",\n \"access-token-key\": \"\"\n },\n \"email\": {\n \"to\": \"\",\n \"cc\": \"\",\n \"bcc\": \"\"\n },\n \"block-usage\": {\n \"period\": \"\"\n }\n },\n \"conditions\": [\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n },\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n }\n ],\n \"enabled\": \"\",\n \"event-name\": \"\",\n \"rule-name\": \"\",\n \"alert-strategy\": {\n \"batching\": {\n \"type\": \"\",\n \"times\": [\n \"\"\n ]\n }\n }\n})\nheaders = {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n" __originalOperationId: createRule security: - {} - Auth: [] - api_key: [] /v1/accounts/{account-id}/rules/{rule-id}: put: tags: - alerting summary: Update An Existing Rule description: modifies an existing rule upon providing the rule Id operationId: updateRuleByRuleId parameters: - name: account-id in: path description: The unique identifier of your account required: true style: simple explode: false schema: type: string - name: rule-id in: path required: true style: simple explode: false schema: type: string requestBody: description: update a rule content: application/json: schema: required: - actions - conditions - enabled - event-name - rule-name type: object properties: rule-name: type: string event-name: type: string enabled: type: boolean conditions: type: array description: Individual conditions are chained with AND operator by default items: type: object properties: attribute-name: type: string condition-operator: type: string description: Possible Operator values are (==, !=, <, <=, >, >=, in, not in). attribute-value: type: string example: null $$ref: '#/components/schemas/InputRule_conditions' actions: type: object properties: webhook: required: - webhook-url type: object properties: webhook-url: type: string access-token: type: string access-token-key: type: string example: null $$ref: '#/components/schemas/InputRule_actions_webhook' email: required: - to type: object properties: to: type: string cc: type: string bcc: type: string example: null $$ref: '#/components/schemas/InputRule_actions_email' block-usage: required: - period type: object properties: period: type: string example: null $$ref: '#/components/schemas/InputRule_actions_blockusage' example: null $$ref: '#/components/schemas/InputRule_actions' alert-strategy: type: object properties: batching: type: object properties: type: type: string description: When hourly is specified, the alerts will be batched and sent every hour. When daily is specified, the alerts will be batched & sent at times specified for the value "times". enum: - daily - hourly times: type: array description: This is used to specify an array of times, in a 24-hour format, to send alerts with a max number of 10 times. This value is only needed only if the type value is "daily". If the type specified is hourly, this ‘time’ value is ignored. items: type: string format: hh:mm:ss example: null $$ref: '#/components/schemas/Rules_alertstrategy_batching' description: Optional:Define a batching strategy for the alerts you receive example: null $$ref: '#/components/schemas/Rules_alertstrategy' $$ref: '#/components/schemas/InputRule' required: true responses: '200': description: 200 response headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: rule-id: type: string message: type: array items: type: string $$ref: '#/components/schemas/CreateRule' '400': description: Bad Request headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '401': description: Unauthorised User headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: required: - error - message type: object properties: error: type: integer format: int32 message: type: string $$ref: '#/components/schemas/Error' '403': description: Forbidden headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '404': description: The Specified Resource Was Not Found headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: INFO: type: string $$ref: '#/components/schemas/NotFound_Error' '500': description: Server Error headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: rule-id: type: integer message: type: array items: type: string $$ref: '#/components/schemas/Rule_500_Error' x-code-samples: - lang: cURL label: cURL source: "curl --location --globoff --request PUT '{{baseUrl}}/v1/accounts/{account-id}/rules/{rule-id}' \\\n--header 'Content-Type: application/json'\n--header 'Authorization: Bearer ' \n--header 'x-api-key: '\n--header 'Accept: application/json' \\\n--data '{\n \"actions\": {\n \"webhook\": {\n \"webhook-url\": \"\",\n \"access-token\": \"\",\n \"access-token-key\": \"\"\n },\n \"email\": {\n \"to\": \"\",\n \"cc\": \"\",\n \"bcc\": \"\"\n },\n \"block-usage\": {\n \"period\": \"\"\n }\n },\n \"conditions\": [\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n },\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n }\n ],\n \"enabled\": \"\",\n \"event-name\": \"\",\n \"rule-name\": \"\",\n \"alert-strategy\": {\n \"batching\": {\n \"type\": \"\",\n \"times\": [\n \"\"\n ]\n }\n }\n}'" - lang: js label: NodeJs source: "var request = require('request');\nvar options = {\n 'method': 'PUT',\n 'url': '{{baseUrl}}/v1/accounts/{account-id}/rules/{rule-id}',\n 'headers': {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n \"actions\": {\n \"webhook\": {\n \"webhook-url\": \"\",\n \"access-token\": \"\",\n \"access-token-key\": \"\"\n },\n \"email\": {\n \"to\": \"\",\n \"cc\": \"\",\n \"bcc\": \"\"\n },\n \"block-usage\": {\n \"period\": \"\"\n }\n },\n \"conditions\": [\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n },\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n }\n ],\n \"enabled\": \"\",\n \"event-name\": \"\",\n \"rule-name\": \"\",\n \"alert-strategy\": {\n \"batching\": {\n \"type\": \"\",\n \"times\": [\n \"\"\n ]\n }\n }\n })\n};\nrequest(options, function (error, response) {\n if (error) throw new Error(error);\n console.log(response.body);\n});\n" - lang: java label: Java source: "OkHttpClient client = new OkHttpClient().newBuilder()\n .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\n \\\"actions\\\": {\\n \\\"webhook\\\": {\\n \\\"webhook-url\\\": \\\"\\\",\\n \\\"access-token\\\": \\\"\\\",\\n \\\"access-token-key\\\": \\\"\\\"\\n },\\n \\\"email\\\": {\\n \\\"to\\\": \\\"\\\",\\n \\\"cc\\\": \\\"\\\",\\n \\\"bcc\\\": \\\"\\\"\\n },\\n \\\"block-usage\\\": {\\n \\\"period\\\": \\\"\\\"\\n }\\n },\\n \\\"conditions\\\": [\\n {\\n \\\"attribute-name\\\": \\\"\\\",\\n \\\"condition-operator\\\": \\\"\\\",\\n \\\"attribute-value\\\": \\\"\\\"\\n },\\n {\\n \\\"attribute-name\\\": \\\"\\\",\\n \\\"condition-operator\\\": \\\"\\\",\\n \\\"attribute-value\\\": \\\"\\\"\\n }\\n ],\\n \\\"enabled\\\": \\\"\\\",\\n \\\"event-name\\\": \\\"\\\",\\n \\\"rule-name\\\": \\\"\\\",\\n \\\"alert-strategy\\\": {\\n \\\"batching\\\": {\\n \\\"type\\\": \\\"\\\",\\n \\\"times\\\": [\\n \\\"\\\"\\n ]\\n }\\n }\\n}\");\nRequest request = new Request.Builder()\n .url(\"{{baseUrl}}/v1/accounts/{account-id}/rules/{rule-id}\")\n .method(\"PUT\", body)\n .addHeader(\"Authorization\", \"Bearer \")\n .addHeader(\"x-api-key\", \"\")\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"Accept\", \"application/json\")\n .build();\nResponse response = client.newCall(request).execute();" - lang: cs label: C# source: "var options = new RestClientOptions(\"{{baseUrl}}/v1/accounts/{account-id}/rules/{rule-id}\")\n{\n MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"\", Method.Put);\nrequest.AddHeader(\"Content-Type\", \"application/json\");\nrequest.AddHeader(\"Accept\", \"application/json\");\nvar body = @\"{\" + \"\\n\" +\n@\" \"\"actions\"\": {\" + \"\\n\" +\n@\" \"\"webhook\"\": {\" + \"\\n\" +\n@\" \"\"webhook-url\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"access-token\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"access-token-key\"\": \"\"\"\"\" + \"\\n\" +\n@\" },\" + \"\\n\" +\n@\" \"\"email\"\": {\" + \"\\n\" +\n@\" \"\"to\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"cc\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"bcc\"\": \"\"\"\"\" + \"\\n\" +\n@\" },\" + \"\\n\" +\n@\" \"\"block-usage\"\": {\" + \"\\n\" +\n@\" \"\"period\"\": \"\"\"\"\" + \"\\n\" +\n@\" }\" + \"\\n\" +\n@\" },\" + \"\\n\" +\n@\" \"\"conditions\"\": [\" + \"\\n\" +\n@\" {\" + \"\\n\" +\n@\" \"\"attribute-name\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"condition-operator\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"attribute-value\"\": \"\"\"\"\" + \"\\n\" +\n@\" },\" + \"\\n\" +\n@\" {\" + \"\\n\" +\n@\" \"\"attribute-name\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"condition-operator\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"attribute-value\"\": \"\"\"\"\" + \"\\n\" +\n@\" }\" + \"\\n\" +\n@\" ],\" + \"\\n\" +\n@\" \"\"enabled\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"event-name\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"rule-name\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"alert-strategy\"\": {\" + \"\\n\" +\n@\" \"\"batching\"\": {\" + \"\\n\" +\n@\" \"\"type\"\": \"\"\"\",\" + \"\\n\" +\n@\" \"\"times\"\": [\" + \"\\n\" +\n@\" \"\"\"\"\" + \"\\n\" +\n@\" ]\" + \"\\n\" +\n@\" }\" + \"\\n\" +\n@\" }\" + \"\\n\" +\n@\"}\";\nrequest.AddStringBody(body, DataFormat.Json);\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);" - lang: PHP label: Php source: " '{{baseUrl}}/v1/accounts/{account-id}/rules/{rule-id}',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'PUT',\n CURLOPT_POSTFIELDS =>'{\n \"actions\": {\n \"webhook\": {\n \"webhook-url\": \"\",\n \"access-token\": \"\",\n \"access-token-key\": \"\"\n },\n \"email\": {\n \"to\": \"\",\n \"cc\": \"\",\n \"bcc\": \"\"\n },\n \"block-usage\": {\n \"period\": \"\"\n }\n },\n \"conditions\": [\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n },\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n }\n ],\n \"enabled\": \"\",\n \"event-name\": \"\",\n \"rule-name\": \"\",\n \"alert-strategy\": {\n \"batching\": {\n \"type\": \"\",\n \"times\": [\n \"\"\n ]\n }\n }\n}',\n CURLOPT_HTTPHEADER => array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n" - lang: py label: Python source: "import requests\nimport json\n\nurl = \"{{baseUrl}}/v1/accounts/{account-id}/rules/{rule-id}\"\n\npayload = json.dumps({\n \"actions\": {\n \"webhook\": {\n \"webhook-url\": \"\",\n \"access-token\": \"\",\n \"access-token-key\": \"\"\n },\n \"email\": {\n \"to\": \"\",\n \"cc\": \"\",\n \"bcc\": \"\"\n },\n \"block-usage\": {\n \"period\": \"\"\n }\n },\n \"conditions\": [\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n },\n {\n \"attribute-name\": \"\",\n \"condition-operator\": \"\",\n \"attribute-value\": \"\"\n }\n ],\n \"enabled\": \"\",\n \"event-name\": \"\",\n \"rule-name\": \"\",\n \"alert-strategy\": {\n \"batching\": {\n \"type\": \"\",\n \"times\": [\n \"\"\n ]\n }\n }\n})\nheaders = {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n" __originalOperationId: updateRuleByRuleId security: - {} - Auth: [] - api_key: [] /v1/accounts/{account-id}/alerts: get: tags: - alerting summary: Lists All Alert History description: Gets a list of alerts for an account in the last 15 days parameters: - name: account-id in: path description: The unique identifier of your account required: true style: simple explode: false schema: type: string - name: start-date in: query description: 'Specifies the date from which alert history will be shown.
eg: YYYY-MM-DD' required: false style: form explode: true schema: type: string format: date - name: end-date in: query description: 'Specifies the date from which alert history will be shown.
eg: YYYY-MM-DD' required: false style: form explode: true schema: type: string format: date - name: page-index in: query description: Specifies the index of a page during pagination. required: false style: form explode: true schema: type: number - name: page-size in: query description: Specifies the maximum number of records that needs to be included in the page. required: false style: form explode: true schema: type: number responses: '200': description: 200 response headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: page-index: type: number page-size: type: number total-records: type: number alerts: type: array items: type: object properties: id: type: string rule-id: type: string date-added: type: string format: date all-actions-complete: type: boolean actions: type: array items: anyOf: - type: object properties: type: type: string enum: - webhook event-ids: type: array items: type: string fire-date: type: string format: date success: type: boolean details: type: object properties: url: type: string access-token: type: string payload: type: object properties: alert-id: type: string alert-message-date: type: string format: date rule-id: type: string rule-name: type: string event-name: type: string account: type: string events: type: array items: type: object - type: object properties: type: type: string enum: - email event-ids: type: array items: type: string fire-date: type: string format: date success: type: boolean details: type: object properties: to: type: string format: email cc: type: string format: email bcc: type: string format: email - type: object properties: type: type: string enum: - block-Usage - unblock-usage event-ids: type: array items: type: string fire-date: type: string format: date success: type: boolean details: type: object properties: request-id: type: string subscription-id: type: string $$ref: '#/components/schemas/AlertHistoryDetails' $$ref: '#/components/schemas/AlertHistory' '400': description: Bad Request headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '401': description: Unauthorised User headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: required: - error - message type: object properties: error: type: integer format: int32 message: type: string $$ref: '#/components/schemas/Error' '403': description: Forbidden headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '404': description: The Specified Resource Was Not Found headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: INFO: type: string $$ref: '#/components/schemas/NotFound_Error' '500': description: Server Error headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' x-code-samples: - lang: cURL label: cURL source: 'curl --location --globoff ''{{baseUrl}}/v1/accounts/{account-id}/alerts?start-date=&end-date=&page-index=&page-size='' \ --header ''Accept: application/json''' - lang: js label: NodeJs source: "var request = require('request');\nvar options = {\n 'method': 'GET',\n 'url': '{{baseUrl}}/v1/accounts/{account-id}/alerts?start-date=&end-date=&page-index=&page-size=',\n 'headers': {\n 'Accept': 'application/json'\n }\n};\nrequest(options, function (error, response) {\n if (error) throw new Error(error);\n console.log(response.body);\n});\n" - lang: java label: Java source: "OkHttpClient client = new OkHttpClient().newBuilder()\n .build();\nMediaType mediaType = MediaType.parse(\"text/plain\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n .url(\"{{baseUrl}}/v1/accounts/{account-id}/alerts?start-date=&end-date=&page-index=&page-size=\")\n .method(\"GET\", body)\n .addHeader(\"Accept\", \"application/json\")\n .build();\nResponse response = client.newCall(request).execute();" - lang: cs label: C# source: "var options = new RestClientOptions(\"{{baseUrl}}/v1/accounts/{account-id}/alerts?start-date=&end-date=&page-index=&page-size=\")\n{\n MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"\", Method.Get);\nrequest.AddHeader(\"Accept\", \"application/json\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);" - lang: PHP label: Php source: " '{{baseUrl}}/v1/accounts/{account-id}/alerts?start-date=&end-date=&page-index=&page-size=',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'GET',\n CURLOPT_HTTPHEADER => array(\n 'Authorization: Bearer ',\n 'x-api-key: ')\n CURLOPT_HTTPHEADER => array(\n 'Accept: application/json'\n ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n" - lang: py label: Python source: "import requests\n\nurl = \"{{baseUrl}}/v1/accounts/{account-id}/alerts?start-date=&end-date=&page-index=&page-size=\"\n\npayload = {}\nheaders = {\n 'Accept': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n" security: - {} - Auth: [] - api_key: [] /v1/accounts/{account-id}/alerts/{alert-id}: get: tags: - alerting summary: Lists Alert History By ID description: Gets details of a specific alert for an account parameters: - name: account-id in: path description: The unique identifier of your account required: true style: simple explode: false schema: type: string - name: alert-id in: path description: This specifies the id of an alert. required: true style: simple explode: false schema: type: string responses: '200': description: 200 response headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: id: type: string rule-id: type: string date-added: type: string format: date all-actions-complete: type: boolean actions: type: array items: anyOf: - type: object properties: type: type: string enum: - webhook event-ids: type: array items: type: string fire-date: type: string format: date success: type: boolean details: type: object properties: url: type: string access-token: type: string payload: type: object properties: alert-id: type: string alert-message-date: type: string format: date rule-id: type: string rule-name: type: string event-name: type: string account: type: string events: type: array items: type: object - type: object properties: type: type: string enum: - email event-ids: type: array items: type: string fire-date: type: string format: date success: type: boolean details: type: object properties: to: type: string format: email cc: type: string format: email bcc: type: string format: email - type: object properties: type: type: string enum: - block-Usage - unblock-usage event-ids: type: array items: type: string fire-date: type: string format: date success: type: boolean details: type: object properties: request-id: type: string subscription-id: type: string $$ref: '#/components/schemas/AlertHistoryDetails' '400': description: Bad Request headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '401': description: Unauthorised User headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: required: - error - message type: object properties: error: type: integer format: int32 message: type: string $$ref: '#/components/schemas/Error' '403': description: Forbidden headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '404': description: The Specified Resource Was Not Found headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: INFO: type: string $$ref: '#/components/schemas/NotFound_Error' '500': description: Server Error headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' x-code-samples: - lang: cURL label: cURL source: 'curl --location --globoff ''{{baseUrl}}/v1/accounts/{account-id}/alerts/{alert-id}'' \ --header ''Accept: application/json''' - lang: js label: NodeJs source: "var request = require('request');\nvar options = {\n 'method': 'GET',\n 'url': '{{baseUrl}}/v1/accounts/{account-id}/alerts/{alert-id}',\n 'headers': {\n 'Accept': 'application/json'\n }\n};\nrequest(options, function (error, response) {\n if (error) throw new Error(error);\n console.log(response.body);\n});\n" - lang: java label: Java source: "OkHttpClient client = new OkHttpClient().newBuilder()\n .build();\nMediaType mediaType = MediaType.parse(\"text/plain\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n .url(\"{{baseUrl}}/v1/accounts/{account-id}/alerts/{alert-id}\")\n .method(\"GET\", body)\n .addHeader(\"Accept\", \"application/json\")\n .build();\nResponse response = client.newCall(request).execute();" - lang: cs label: C# source: "var options = new RestClientOptions(\"{{baseUrl}}/v1/accounts/{account-id}/alerts/{alert-id}\")\n{\n MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"\", Method.Get);\nrequest.AddHeader(\"Accept\", \"application/json\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);" - lang: PHP label: Php source: " '{{baseUrl}}/v1/accounts/{account-id}/alerts/{alert-id}',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'GET',\n CURLOPT_HTTPHEADER => array(\n 'Authorization: Bearer ',\n 'x-api-key: ')\n CURLOPT_HTTPHEADER => array(\n 'Accept: application/json'\n ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n" - lang: py label: Python source: "import requests\n\nurl = \"{{baseUrl}}/v1/accounts/{account-id}/alerts/{alert-id}\"\n\npayload = {}\nheaders = {\n 'Accept': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n" security: - {} - Auth: [] - api_key: [] /v1/accounts/{account-id}/actions: get: tags: - alerting summary: Lists All Actions description: Gets all supported actions for an account parameters: - name: account-id in: path description: The unique identifier of your account required: true style: simple explode: false schema: type: string responses: '200': description: 200 response headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: array items: type: object properties: name: type: string description: type: string attributes: type: array items: type: object properties: name: type: string description: type: string type: type: string $$ref: '#/components/schemas/Actions_inner' $$ref: '#/components/schemas/Actions' '400': description: Bad Request headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '401': description: Unauthorised User headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: required: - error - message type: object properties: error: type: integer format: int32 message: type: string $$ref: '#/components/schemas/Error' '403': description: Forbidden headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' '404': description: The Specified Resource Was Not Found headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: INFO: type: string $$ref: '#/components/schemas/NotFound_Error' '500': description: Server Error headers: Access-Control-Allow-Origin: style: simple explode: false schema: type: string Access-Control-Allow-Methods: style: simple explode: false schema: type: string Access-Control-Allow-Credentials: style: simple explode: false schema: type: string Access-Control-Allow-Headers: style: simple explode: false schema: type: string content: application/json: schema: type: object properties: message: type: string $$ref: '#/components/schemas/xxx_Error' x-code-samples: - lang: cURL label: cURL source: 'curl --location --globoff ''{{baseUrl}}/v1/accounts/{account-id}/actions'' \ --header ''Accept: application/json''' - lang: js label: NodeJs source: "var request = require('request');\nvar options = {\n 'method': 'GET',\n 'url': '{{baseUrl}}/v1/accounts/{account-id}/actions',\n 'headers': {\n 'Accept': 'application/json'\n }\n};\nrequest(options, function (error, response) {\n if (error) throw new Error(error);\n console.log(response.body);\n});\n" - lang: java label: Java source: "OkHttpClient client = new OkHttpClient().newBuilder()\n .build();\nMediaType mediaType = MediaType.parse(\"text/plain\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n .url(\"{{baseUrl}}/v1/accounts/{account-id}/actions\")\n .method(\"GET\", body)\n .addHeader(\"Accept\", \"application/json\")\n .build();\nResponse response = client.newCall(request).execute();" - lang: cs label: C# source: "var options = new RestClientOptions(\"{{baseUrl}}/v1/accounts/{account-id}/actions\")\n{\n MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"\", Method.Get);\nrequest.AddHeader(\"Accept\", \"application/json\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);" - lang: PHP label: Php source: " '{{baseUrl}}/v1/accounts/{account-id}/actions',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'GET',\n CURLOPT_HTTPHEADER => array(\n 'Authorization: Bearer ',\n 'x-api-key: ')\n CURLOPT_HTTPHEADER => array(\n 'Accept: application/json'\n ),\n));\n\n$response = curl_exec($curl);\n\ncurl_close($curl);\necho $response;\n" - lang: py label: Python source: "import requests\n\nurl = \"{{baseUrl}}/v1/accounts/{account-id}/actions\"\n\npayload = {}\nheaders = {\n 'Accept': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n" security: - {} - Auth: [] - api_key: [] components: securitySchemes: api_key: type: apiKey name: x-api-key in: header Auth: type: oauth2 description: token expiry is given in seconds flows: clientCredentials: tokenUrl: https://api.korewireless.com/Api/api/token scopes: {}