Get Approval List
curl --request GET \
--url https://use.hoop.dev/api/reviewsimport requests
url = "https://use.hoop.dev/api/reviews"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://use.hoop.dev/api/reviews', 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/reviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/reviews"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://use.hoop.dev/api/reviews")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"access_duration": 0,
"access_request_rule_name": "default-access-request-rule",
"approval_ttl_sec": 600,
"connection": {
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"name": "pgdemo"
},
"created_at": "2024-07-25T15:56:35.317601Z",
"expires_at": "2024-07-25T16:11:35.000Z",
"force_approval_groups": [
"sre-team"
],
"id": "9F9745B4-C77B-4D52-84D3-E24F67E3623C",
"listener_name": "appdb",
"min_approvals": 2,
"rejection_reason": "This command is not allowed in production.",
"requester": {
"email": "john.wick@bad.org",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"name": "John Wick",
"slack_id": "U053ELZHB53"
},
"review_groups_data": [
{
"forced_review": false,
"group": "sre",
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"review_date": "2024-07-25T19:36:41Z",
"reviewed_by": {
"email": "john.wick@bad.org",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"name": "John Wick",
"slack_id": "U053ELZHB53"
},
"status": "APPROVED"
}
],
"revoke_at": "",
"risk_level": "high",
"routing": {
"candidates": [
"payments-approvers",
"sre"
],
"channels": [
{
"id": "C0123ABC",
"integration": "slack",
"name": "#payments-approvals"
}
],
"decided_at": "2024-07-25T15:56:35.317601Z",
"fallback_cause": "timeout",
"fallback_detail": "no answer in 20s",
"groups": [
"sre"
],
"integrations": [
{
"delivery": "both",
"integrated": true,
"name": "slack"
}
],
"mode": "ai",
"notified_users": [
{
"email": "ana@example.com",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"integrations": [
"slack"
],
"name": "Ana"
}
],
"notify_fallback": "no_target",
"notify_fallback_delivery": "dm",
"notify_fallback_posted": true,
"reason": "The sre group approved similar statements fast.",
"undelivered_channels": [
{
"cause": "not reachable from this listener",
"id": "C0123ABC",
"integration": "slack"
}
],
"unreachable": [
{
"cause": "no slack id",
"integration": "slack",
"name": "Bob",
"user_id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90"
}
]
},
"session": "35DB0A2F-E5CE-4AD8-A308-55C3108956E5",
"sidecar_id": "5F5E5C6E-6C3A-4E9A-9E8B-2D6A7F1B0C4D",
"status": "PENDING",
"time_window": {
"configuration": {
"end_time": "18:00",
"start_time": "09:00"
},
"type": "time_range"
},
"type": "onetime",
"via_handoff": false
}
]{
"message": "the error description"
}{
"message": "the error description"
}Approvals
Get Approval List
Get the approval requests the user made or can decide. Admins and auditors get all approval requests. /reviews is an alias.
GET
/
reviews
Get Approval List
curl --request GET \
--url https://use.hoop.dev/api/reviewsimport requests
url = "https://use.hoop.dev/api/reviews"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://use.hoop.dev/api/reviews', 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/reviews",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/reviews"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://use.hoop.dev/api/reviews")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/reviews")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"access_duration": 0,
"access_request_rule_name": "default-access-request-rule",
"approval_ttl_sec": 600,
"connection": {
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"name": "pgdemo"
},
"created_at": "2024-07-25T15:56:35.317601Z",
"expires_at": "2024-07-25T16:11:35.000Z",
"force_approval_groups": [
"sre-team"
],
"id": "9F9745B4-C77B-4D52-84D3-E24F67E3623C",
"listener_name": "appdb",
"min_approvals": 2,
"rejection_reason": "This command is not allowed in production.",
"requester": {
"email": "john.wick@bad.org",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"name": "John Wick",
"slack_id": "U053ELZHB53"
},
"review_groups_data": [
{
"forced_review": false,
"group": "sre",
"id": "20A5AABE-C35D-4F04-A5A7-C856EE6C7703",
"review_date": "2024-07-25T19:36:41Z",
"reviewed_by": {
"email": "john.wick@bad.org",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"name": "John Wick",
"slack_id": "U053ELZHB53"
},
"status": "APPROVED"
}
],
"revoke_at": "",
"risk_level": "high",
"routing": {
"candidates": [
"payments-approvers",
"sre"
],
"channels": [
{
"id": "C0123ABC",
"integration": "slack",
"name": "#payments-approvals"
}
],
"decided_at": "2024-07-25T15:56:35.317601Z",
"fallback_cause": "timeout",
"fallback_detail": "no answer in 20s",
"groups": [
"sre"
],
"integrations": [
{
"delivery": "both",
"integrated": true,
"name": "slack"
}
],
"mode": "ai",
"notified_users": [
{
"email": "ana@example.com",
"id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90",
"integrations": [
"slack"
],
"name": "Ana"
}
],
"notify_fallback": "no_target",
"notify_fallback_delivery": "dm",
"notify_fallback_posted": true,
"reason": "The sre group approved similar statements fast.",
"undelivered_channels": [
{
"cause": "not reachable from this listener",
"id": "C0123ABC",
"integration": "slack"
}
],
"unreachable": [
{
"cause": "no slack id",
"integration": "slack",
"name": "Bob",
"user_id": "D5BFA2DD-7A09-40AE-AFEB-C95787BA9E90"
}
]
},
"session": "35DB0A2F-E5CE-4AD8-A308-55C3108956E5",
"sidecar_id": "5F5E5C6E-6C3A-4E9A-9E8B-2D6A7F1B0C4D",
"status": "PENDING",
"time_window": {
"configuration": {
"end_time": "18:00",
"start_time": "09:00"
},
"type": "time_range"
},
"type": "onetime",
"via_handoff": false
}
]{
"message": "the error description"
}{
"message": "the error description"
}Response
OK
The status of the approval request
- PENDING - The resource is waiting for approval
- APPROVED - The resource is fully approved
- REJECTED - The resource is fully rejected
- REVOKED - The resource was revoked after being approved
- PROCESSING - The approval request is being executed
- EXECUTED - The approval request was executed
- UNKNOWN - Unable to know the status of the approval request
- EXPIRED - A sidecar approval request passed its deadline; it never releases the statement
Available options:
PENDING, APPROVED, REJECTED, REVOKED, PROCESSING, EXECUTED, UNKNOWN, EXPIRED Was this page helpful?