Create a Whitelist record
curl --request POST \
--url http://localhost/api/api/whitelist \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rules": [
123
],
"bucket": "<string>",
"subject": "<string>"
}
'import requests
url = "http://localhost/api/api/whitelist"
payload = {
"rules": [123],
"bucket": "<string>",
"subject": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({rules: [123], bucket: '<string>', subject: '<string>'})
};
fetch('http://localhost/api/api/whitelist', 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 => "http://localhost/api/api/whitelist",
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([
'rules' => [
123
],
'bucket' => '<string>',
'subject' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://localhost/api/api/whitelist"
payload := strings.NewReader("{\n \"rules\": [\n 123\n ],\n \"bucket\": \"<string>\",\n \"subject\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost/api/api/whitelist")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rules\": [\n 123\n ],\n \"bucket\": \"<string>\",\n \"subject\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/api/whitelist")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rules\": [\n 123\n ],\n \"bucket\": \"<string>\",\n \"subject\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"rules": [
123
],
"bucket": "<string>",
"subject": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": 123,
"modified_by": 123
}{
"detail": "<string>",
"code": "<string>",
"field_errors": {}
}Whitelist
Create a Whitelist record
Create a new whitelist record with rules, bucket, and subject.
POST
/
api
/
whitelist
Create a Whitelist record
curl --request POST \
--url http://localhost/api/api/whitelist \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rules": [
123
],
"bucket": "<string>",
"subject": "<string>"
}
'import requests
url = "http://localhost/api/api/whitelist"
payload = {
"rules": [123],
"bucket": "<string>",
"subject": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({rules: [123], bucket: '<string>', subject: '<string>'})
};
fetch('http://localhost/api/api/whitelist', 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 => "http://localhost/api/api/whitelist",
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([
'rules' => [
123
],
'bucket' => '<string>',
'subject' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "http://localhost/api/api/whitelist"
payload := strings.NewReader("{\n \"rules\": [\n 123\n ],\n \"bucket\": \"<string>\",\n \"subject\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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("http://localhost/api/api/whitelist")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rules\": [\n 123\n ],\n \"bucket\": \"<string>\",\n \"subject\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/api/whitelist")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rules\": [\n 123\n ],\n \"bucket\": \"<string>\",\n \"subject\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"rules": [
123
],
"bucket": "<string>",
"subject": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": 123,
"modified_by": 123
}{
"detail": "<string>",
"code": "<string>",
"field_errors": {}
}Authorizations
CustomAuthenticationcookieAuth
JWT token obtained from AWS Cognito or custom authentication service
Body
application/json
Response
Whitelist record created successfully
Whitelist object with all details
Whitelist record ID
List of rule IDs
Bucket identifier
Subject identifier
Creation timestamp
Last update timestamp
ID of user who created the record
ID of user who last modified the record
⌘I
