curl -X GET 'https://your-hatch-server/api/sync/vaults/{vault}/rules' \
-H 'Authorization: Bearer <token>'
const res = await fetch("https://your-hatch-server/api/sync/vaults/{vault}/rules", {
method: "GET",
headers: {
Authorization: "Bearer <token>",
},
})
const data = await res.json()
import requests
res = requests.request("GET", "https://your-hatch-server/api/sync/vaults/{vault}/rules", headers={"Authorization": "Bearer <token>"})
data = res.json()
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://your-hatch-server/api/sync/vaults/{vault}/rules", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <token>")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}
require "net/http"
uri = URI('https://your-hatch-server/api/sync/vaults/{vault}/rules')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer <token>'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(req)
end
puts res.body
<?php
$ch = curl_init('https://your-hatch-server/api/sync/vaults/{vault}/rules');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
],
]);
$response = curl_exec($ch);
echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://your-hatch-server/api/sync/vaults/{vault}/rules"))
.header("Authorization", "Bearer <token>")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
{
"rules": [
{
"folder": "string",
"who": "string",
"role": "editor",
"at": 0,
"by": "string"
}
],
"epoch": 0
}
{
"message": "string",
"code": "string",
"retryable": true,
"requestId": "string"
}