add rules to whitelist.
curl --request POST \
--url https://apix.us.amity.co/api/v2/whitelist/records \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"regexs": [
"<string>"
],
"isMatchExactWord": true
}
'import requests
url = "https://apix.us.amity.co/api/v2/whitelist/records"
payload = {
"regexs": ["<string>"],
"isMatchExactWord": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>",
"X-API-Key": "<api-key>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'Content-Type': '<content-type>',
'X-API-Key': '<api-key>'
},
body: JSON.stringify({regexs: ['<string>'], isMatchExactWord: true})
};
fetch('https://apix.us.amity.co/api/v2/whitelist/records', 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://apix.us.amity.co/api/v2/whitelist/records",
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([
'regexs' => [
'<string>'
],
'isMatchExactWord' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>",
"X-API-Key: <api-key>"
],
]);
$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://apix.us.amity.co/api/v2/whitelist/records"
payload := strings.NewReader("{\n \"regexs\": [\n \"<string>\"\n ],\n \"isMatchExactWord\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apix.us.amity.co/api/v2/whitelist/records")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.header("X-API-Key", "<api-key>")
.body("{\n \"regexs\": [\n \"<string>\"\n ],\n \"isMatchExactWord\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v2/whitelist/records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request["X-API-Key"] = '<api-key>'
request.body = "{\n \"regexs\": [\n \"<string>\"\n ],\n \"isMatchExactWord\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "error",
"code": 404,
"message": "Resource Not Found."
}{
"status": "error",
"code": 500,
"message": "Unexpected error"
}Moderation
add rules to whitelist.
Add rules to whitelist
POST
/
api
/
v2
/
whitelist
/
records
add rules to whitelist.
curl --request POST \
--url https://apix.us.amity.co/api/v2/whitelist/records \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"regexs": [
"<string>"
],
"isMatchExactWord": true
}
'import requests
url = "https://apix.us.amity.co/api/v2/whitelist/records"
payload = {
"regexs": ["<string>"],
"isMatchExactWord": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>",
"X-API-Key": "<api-key>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'Content-Type': '<content-type>',
'X-API-Key': '<api-key>'
},
body: JSON.stringify({regexs: ['<string>'], isMatchExactWord: true})
};
fetch('https://apix.us.amity.co/api/v2/whitelist/records', 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://apix.us.amity.co/api/v2/whitelist/records",
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([
'regexs' => [
'<string>'
],
'isMatchExactWord' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>",
"X-API-Key: <api-key>"
],
]);
$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://apix.us.amity.co/api/v2/whitelist/records"
payload := strings.NewReader("{\n \"regexs\": [\n \"<string>\"\n ],\n \"isMatchExactWord\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apix.us.amity.co/api/v2/whitelist/records")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.header("X-API-Key", "<api-key>")
.body("{\n \"regexs\": [\n \"<string>\"\n ],\n \"isMatchExactWord\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v2/whitelist/records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request["X-API-Key"] = '<api-key>'
request.body = "{\n \"regexs\": [\n \"<string>\"\n ],\n \"isMatchExactWord\": true\n}"
response = http.request(request)
puts response.read_body{
"status": "error",
"code": 404,
"message": "Resource Not Found."
}{
"status": "error",
"code": 500,
"message": "Unexpected error"
}⌘I