/v2/insights/{insight_id}
1 min
code examples curl request patch \\ \ url https //dev api cloudzero com/v2/insights/{insight id} \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "cost impact" {} }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "cost impact" {} }); var requestoptions = { method 'patch', headers myheaders, body raw, redirect 'follow' }; fetch("https //dev api cloudzero com/v2/insights/{insight id}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //dev api cloudzero com/v2/insights/{insight id}") https = net http new(url host, url port) https use ssl = true request = net http patch new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "cost impact" {} }) response = https request(request) puts response read body import requests import json url = "https //dev api cloudzero com/v2/insights/{insight id}" payload = json dumps({ "cost impact" {} }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("patch", url, headers=headers, data=payload) print(response text) responses // successful operation { "insight" {} }// bad request error { "error" { "message" "", "type" "" } }// forbidden { "message" "" }