curl -X PATCH https://api.reveniq.com/v1/meters/:id -H 'Authorization: YOUR_API_TOKEN_HERE' -H 'Content-Type: application/json'-d '{ "name": "meter1", "aggregate_method": "max", "time_window": "hour"}'
require 'uri'require 'net/http' url = URI("https://api.reveniq.com/v1/meters/:id") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Patch.new(url)request["Content-Type"] = 'application/json'request["Authorization"] = 'YOUR_API_TOKEN_HERE'request.body = '{ "name": "meter1", "aggregate_method": "max", "time_window": "hour"}' response = http.request(request)puts response.read_body
HttpResponse<String> response = Unirest.patch("https://api.reveniq.com/v1/meters/:id") .header("Content-Type", "application/json") .header("Authorization", "YOUR_API_TOKEN_HERE") .body('{ "name": "meter1", "aggregate_method": "max", "time_window": "hour"}'') .asString();
import requests url = "https://api.reveniq.com/v1/meters/:id" payload = '{"name":"meter1","aggregate_method":"max","time_window":"hour"}'headers = { 'Content-Type': "application/json", 'Authorization': "YOUR_API_TOKEN_HERE", } response = requests.request("PATCH", url, data=payload, headers=headers) print(response.text)
var data = '{"name":"meter1","aggregate_method":"max","time_window":"hour"}'; var xhr = new XMLHttpRequest(); xhr.addEventListener("readystatechange", function () { if (this.readyState === 4) { console.log(this.responseText); }}); xhr.open("PATCH", "https://api.reveniq.com/v1/meters/:id");xhr.setRequestHeader("Content-Type", "application/json");xhr.setRequestHeader("Authorization", "YOUR_API_TOKEN_HERE"); xhr.send(data);