curl --request POST \
--url https://use.hoop.dev/api/sidecars/events \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"event": {},
"seq": 1
}
]
}
'import requests
url = "https://use.hoop.dev/api/sidecars/events"
payload = { "events": [
{
"event": {},
"seq": 1
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({events: [{event: {}, seq: 1}]})
};
fetch('https://use.hoop.dev/api/sidecars/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/sidecars/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
[
'event' => [
],
'seq' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/sidecars/events"
payload := strings.NewReader("{\n \"events\": [\n {\n \"event\": {},\n \"seq\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/sidecars/events")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"event\": {},\n \"seq\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sidecars/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"event\": {},\n \"seq\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": 42,
"duplicates": 0
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Record Sidecar Session Events
Record a sidecar’s audit events as sessions. The sidecar is taken from the token, never the body, and every session it writes is its own. 2xx means the batch is applied, now or by an earlier request: an event at or below its session’s last applied seq is ignored. 4xx means the sidecar must not resend the batch; a 422 names the sessions that can never be recorded, and the other sessions of the batch were applied. 5xx means it may resend it as it is. The organization must have the experimental.sidecar_session_events flag on; the handshake answers the hoop-sidecar-session-events header when it does.
curl --request POST \
--url https://use.hoop.dev/api/sidecars/events \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"event": {},
"seq": 1
}
]
}
'import requests
url = "https://use.hoop.dev/api/sidecars/events"
payload = { "events": [
{
"event": {},
"seq": 1
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({events: [{event: {}, seq: 1}]})
};
fetch('https://use.hoop.dev/api/sidecars/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/sidecars/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
[
'event' => [
],
'seq' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/sidecars/events"
payload := strings.NewReader("{\n \"events\": [\n {\n \"event\": {},\n \"seq\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/sidecars/events")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"event\": {},\n \"seq\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sidecars/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"event\": {},\n \"seq\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accepted": 42,
"duplicates": 0
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Headers
The token returned when the sidecar was created. Omit it when sending hoop-sidecar-identity.
A Kubernetes or Google service account JWT, raw, that a sidecar service account mapping allows. Omit it when sending hoop-sidecar-token.
Body
The request body resource
The events, in the order the sidecar numbered them. At most 500, and the body at most 4 MiB; above either the answer is 413
Show child attributes
Show child attributes
Was this page helpful?