Create Sidecar
curl --request POST \
--url https://use.hoop.dev/api/sidecars \
--header 'Content-Type: application/json' \
--data '
{
"name": "payments-sidecar"
}
'import requests
url = "https://use.hoop.dev/api/sidecars"
payload = { "name": "payments-sidecar" }
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({name: 'payments-sidecar'})
};
fetch('https://use.hoop.dev/api/sidecars', 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",
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([
'name' => 'payments-sidecar'
]),
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"
payload := strings.NewReader("{\n \"name\": \"payments-sidecar\"\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")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"payments-sidecar\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sidecars")
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 \"name\": \"payments-sidecar\"\n}"
response = http.request(request)
puts response.read_body{
"connections": [
"pg-prod"
],
"created_at": "<string>",
"created_by": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_seen_at": "<string>",
"name": "payments-sidecar",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token": "hsc_Ab3fX9kL...",
"version": "1.0.0"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Sidecars
Create Sidecar
Register a sidecar. The token is returned only once in this response and cannot be recovered.
POST
/
sidecars
Create Sidecar
curl --request POST \
--url https://use.hoop.dev/api/sidecars \
--header 'Content-Type: application/json' \
--data '
{
"name": "payments-sidecar"
}
'import requests
url = "https://use.hoop.dev/api/sidecars"
payload = { "name": "payments-sidecar" }
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({name: 'payments-sidecar'})
};
fetch('https://use.hoop.dev/api/sidecars', 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",
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([
'name' => 'payments-sidecar'
]),
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"
payload := strings.NewReader("{\n \"name\": \"payments-sidecar\"\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")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"payments-sidecar\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/sidecars")
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 \"name\": \"payments-sidecar\"\n}"
response = http.request(request)
puts response.read_body{
"connections": [
"pg-prod"
],
"created_at": "<string>",
"created_by": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_seen_at": "<string>",
"name": "payments-sidecar",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token": "hsc_Ab3fX9kL...",
"version": "1.0.0"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Body
application/json
The request body resource
Unique name of the resource
Example:
"payments-sidecar"
Response
Created
Names of the connections this sidecar fronts
Example:
["pg-prod"]
Creation timestamp
Subject of the admin who created it
Unique identifier
Last time this gateway process saw the sidecar. Same lifetime as Version.
Human-readable name
Example:
"payments-sidecar"
Organization ID
The generated token, sent in the hoop-sidecar-token header. This is the only time it is shown; it is stored hashed and cannot be recovered.
Example:
"hsc_Ab3fX9kL..."
Version reported at the last handshake. Held in gateway memory, not stored, so it is empty until the sidecar calls and again after a gateway restart.
Example:
"1.0.0"
Was this page helpful?