API REFERENCE
Monitors base info
Update a monitor
1 min
{ "name" "update a monitor ", "method" "put", "url" "https //api sandbox klavi ai/monitor/v1/monitors/{id}", "description" "update a monitor base information by monitor id", "tab" "examples", "examples" { "languages" \[ { "id" "me9clfbyy ayvfypgakks", "language" "curl", "code" "curl location globoff request put 'https //api sandbox klavi ai/monitor/v1/monitors/{id}' \\\\\n header 'authorization string' \\\\\n data '{\\"name\\" \\"string\\",\\"onlinestatus\\" \\"string\\",\\"monitorweekdays\\" \\"array\\",\\"monitorfrequency\\" \\"number\\",\\"notificationemails\\" \\"array\\"}'", "customlabel" "" }, { "id" "kjpfnzqchf rrruco mah", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'put',\n 'url' 'https //api sandbox klavi ai/monitor/v1/monitors/{id}',\n 'headers' {\n 'authorization' 'string'\n },\n body '{\\"name\\" \\"string\\",\\"onlinestatus\\" \\"string\\",\\"monitorweekday\\" \\"string\\",\\"monitortimes\\" \\"string\\",\\"notificationemails\\" \\"string\\"}'\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "customlabel" "" }, { "id" "zmyxsltistyjx27pjbspq", "language" "javascript", "code" "var myheaders = new headers();\nmyheaders append(\\"authorization\\", \\"string\\");\n\nvar raw = \\"{\\\\\\"name\\\\\\" \\\\\\"string\\\\\\",\\\\\\"onlinestatus\\\\\\" \\\\\\"string\\\\\\",\\\\\\"monitorweekday\\\\\\" \\\\\\"string\\\\\\",\\\\\\"monitortimes\\\\\\" \\\\\\"string\\\\\\",\\\\\\"notificationemails\\\\\\" \\\\\\"string\\\\\\"}\\";\n\nvar requestoptions = {\n method 'put',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //api sandbox klavi ai/monitor/v1/monitors/{id}\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" }, { "id" "z7ubswy6wuw2xgepqrwxb", "language" "python", "code" "import requests\n\nurl = \\"https //api sandbox klavi ai/monitor/v1/monitors/{id}\\"\n\npayload = \\"{\\\\\\"name\\\\\\" \\\\\\"string\\\\\\",\\\\\\"onlinestatus\\\\\\" \\\\\\"string\\\\\\",\\\\\\"monitorweekday\\\\\\" \\\\\\"string\\\\\\",\\\\\\"monitortimes\\\\\\" \\\\\\"string\\\\\\",\\\\\\"notificationemails\\\\\\" \\\\\\"string\\\\\\"}\\"\nheaders = {\n 'authorization' 'string'\n}\n\nresponse = requests request(\\"put\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "customlabel" "" }, { "id" "rv 2lmggh91q5lxetjcds", "language" "ruby", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //api sandbox klavi ai/monitor/v1/monitors/{id}\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http put new(url)\nrequest\[\\"authorization\\"] = \\"string\\"\nrequest body = \\"{\\\\\\"name\\\\\\" \\\\\\"string\\\\\\",\\\\\\"onlinestatus\\\\\\" \\\\\\"string\\\\\\",\\\\\\"monitorweekday\\\\\\" \\\\\\"string\\\\\\",\\\\\\"monitortimes\\\\\\" \\\\\\"string\\\\\\",\\\\\\"notificationemails\\\\\\" \\\\\\"string\\\\\\"}\\"\n\nresponse = https request(request)\nputs response read body\n", "customlabel" "" } ], "selectedlanguageid" "me9clfbyy ayvfypgakks" }, "results" { "languages" \[ { "id" "51mscc1gcoqaorvxuft83", "language" "200", "customlabel" "", "code" "{\n \\"id\\" \\"64a8c71f 71db 4972 82b1 1aadc5434dd8\\"\n}" } ], "selectedlanguageid" "51mscc1gcoqaorvxuft83" }, "request" { "pathparameters" \[ { "name" "id", "kind" "required", "type" "string", "description" "id of the monitor", "" "id of the monitor" } ], "queryparameters" \[], "headerparameters" \[ { "name" "authorization", "kind" "required", "type" "string", "description" "bearer access token, it returned by the /auth", "" "bearer access token, it returned by the /auth" } ], "bodydataparameters" \[ { "name" "name", "kind" "required", "type" "string", "description" "name of the monitor", "" "required" }, { "name" "onlinestatus", "kind" "required", "type" "boolean", "description" "monitor status true/false", "" "required" }, { "name" "monitorweekdays", "kind" "required", "type" "array", "description" "monitoring dates within a week \[\\"mon\\",\\"tue\\",\\"wed\\",\\"thu\\",\\"fri\\",\\"sat\\",\\"sun\\"]", "" "required" }, { "name" "monitorfrequency", "kind" "required", "type" "number", "description" "daily monitoring frequency \[1, 2]\n", "" "required" }, { "name" "notificationemails", "kind" "optional", "type" "array", "description" "mailing list for sending notifications, the mail must be created in advance in the klavi console", "" "mailing list for sending notifications, the mail must be created in advance in the klavi console" } ], "formdataparameters" \[] }, "currentnewparameter" { "label" "header parameter", "value" "headerparameters" }, "hastryitout" false, "response" \[ { "name" "id", "kind" "optional", "type" "string", "description" "id of the monitor" } ] }