/v2/events/batch
1 min
code examples var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "events" \[ { "type" "helplinedisplay", "sessionid" "3f0c8a2e 1d4b 4c9a 9e2f 7a1b2c3d4e5f", "timestamp" "2026 07 05t12 34 56z" } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api throughlinecare com/v2/events/batch?atomic=boolean", 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 //api throughlinecare com/v2/events/batch?atomic=boolean") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "events" \[ { "type" "helplinedisplay", "sessionid" "3f0c8a2e 1d4b 4c9a 9e2f 7a1b2c3d4e5f", "timestamp" "2026 07 05t12 34 56z" } ] }) response = https request(request) puts response read body import requests import json url = "https //api throughlinecare com/v2/events/batch?atomic=boolean" payload = json dumps({ "events" \[ { "type" "helplinedisplay", "sessionid" "3f0c8a2e 1d4b 4c9a 9e2f 7a1b2c3d4e5f", "timestamp" "2026 07 05t12 34 56z" } ] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) okhttpclient client = new okhttpclient() newbuilder() build(); mediatype mediatype = mediatype parse("application/json"); requestbody body = requestbody create(mediatype, "{\n \\"events\\" \[\n {\n \\"type\\" \\"helplinedisplay\\",\n \\"sessionid\\" \\"3f0c8a2e 1d4b 4c9a 9e2f 7a1b2c3d4e5f\\",\n \\"timestamp\\" \\"2026 07 05t12 34 56z\\"\n }\n ]\n}"); request request = new request builder() url("https //api throughlinecare com/v2/events/batch?atomic=boolean") method("post", body) addheader("accept", "application/json") addheader("content type", "application/json") build(); response response = client newcall(request) execute();let parameters = "{\n \\"events\\" \[\n {\n \\"type\\" \\"helplinedisplay\\",\n \\"sessionid\\" \\"3f0c8a2e 1d4b 4c9a 9e2f 7a1b2c3d4e5f\\",\n \\"timestamp\\" \\"2026 07 05t12 34 56z\\"\n }\n ]\n}" let postdata = parameters data(using utf8) var request = urlrequest(url url(string "https //api throughlinecare com/v2/events/batch?atomic=boolean")!,timeoutinterval double infinity) request addvalue("application/json", forhttpheaderfield "accept") request addvalue("application/json", forhttpheaderfield "content type") request httpmethod = "post" request httpbody = postdata let task = urlsession shared datatask(with request) { data, response, error in guard let data = data else { print(string(describing error)) return } print(string(data data, encoding utf8)!) } task resume() responses // batch accepted // malformed request // unauthorized // payload too large // storage unavailable