update a moderation setting
curl --request PUT \
--url https://apix.us.amity.co/api/v2/moderation-settings \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"maxRepetition": 1,
"maxRepetitionTimeout": 1,
"blacklistMuteTimeout": 1,
"whitelistMuteTimeout": 1,
"maxRepetitionMuteTimeout": 1,
"enableImageModeration": true,
"imageModeration": {
"nudity": 1,
"suggestive": 1,
"violence": 1,
"disturbing": 1
}
}
'import requests
url = "https://apix.us.amity.co/api/v2/moderation-settings"
payload = {
"maxRepetition": 1,
"maxRepetitionTimeout": 1,
"blacklistMuteTimeout": 1,
"whitelistMuteTimeout": 1,
"maxRepetitionMuteTimeout": 1,
"enableImageModeration": True,
"imageModeration": {
"nudity": 1,
"suggestive": 1,
"violence": 1,
"disturbing": 1
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>",
"X-API-Key": "<api-key>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'Content-Type': '<content-type>',
'X-API-Key': '<api-key>'
},
body: JSON.stringify({
maxRepetition: 1,
maxRepetitionTimeout: 1,
blacklistMuteTimeout: 1,
whitelistMuteTimeout: 1,
maxRepetitionMuteTimeout: 1,
enableImageModeration: true,
imageModeration: {nudity: 1, suggestive: 1, violence: 1, disturbing: 1}
})
};
fetch('https://apix.us.amity.co/api/v2/moderation-settings', 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/moderation-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'maxRepetition' => 1,
'maxRepetitionTimeout' => 1,
'blacklistMuteTimeout' => 1,
'whitelistMuteTimeout' => 1,
'maxRepetitionMuteTimeout' => 1,
'enableImageModeration' => true,
'imageModeration' => [
'nudity' => 1,
'suggestive' => 1,
'violence' => 1,
'disturbing' => 1
]
]),
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/moderation-settings"
payload := strings.NewReader("{\n \"maxRepetition\": 1,\n \"maxRepetitionTimeout\": 1,\n \"blacklistMuteTimeout\": 1,\n \"whitelistMuteTimeout\": 1,\n \"maxRepetitionMuteTimeout\": 1,\n \"enableImageModeration\": true,\n \"imageModeration\": {\n \"nudity\": 1,\n \"suggestive\": 1,\n \"violence\": 1,\n \"disturbing\": 1\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://apix.us.amity.co/api/v2/moderation-settings")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.header("X-API-Key", "<api-key>")
.body("{\n \"maxRepetition\": 1,\n \"maxRepetitionTimeout\": 1,\n \"blacklistMuteTimeout\": 1,\n \"whitelistMuteTimeout\": 1,\n \"maxRepetitionMuteTimeout\": 1,\n \"enableImageModeration\": true,\n \"imageModeration\": {\n \"nudity\": 1,\n \"suggestive\": 1,\n \"violence\": 1,\n \"disturbing\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v2/moderation-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request["X-API-Key"] = '<api-key>'
request.body = "{\n \"maxRepetition\": 1,\n \"maxRepetitionTimeout\": 1,\n \"blacklistMuteTimeout\": 1,\n \"whitelistMuteTimeout\": 1,\n \"maxRepetitionMuteTimeout\": 1,\n \"enableImageModeration\": true,\n \"imageModeration\": {\n \"nudity\": 1,\n \"suggestive\": 1,\n \"violence\": 1,\n \"disturbing\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200
}{
"status": "error",
"code": 400,
"message": "Bad Request."
}{
"status": "error",
"code": 500,
"message": "Unexpected error"
}Moderation
update a moderation setting
Update a moderation setting
PUT
/
api
/
v2
/
moderation-settings
update a moderation setting
curl --request PUT \
--url https://apix.us.amity.co/api/v2/moderation-settings \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"maxRepetition": 1,
"maxRepetitionTimeout": 1,
"blacklistMuteTimeout": 1,
"whitelistMuteTimeout": 1,
"maxRepetitionMuteTimeout": 1,
"enableImageModeration": true,
"imageModeration": {
"nudity": 1,
"suggestive": 1,
"violence": 1,
"disturbing": 1
}
}
'import requests
url = "https://apix.us.amity.co/api/v2/moderation-settings"
payload = {
"maxRepetition": 1,
"maxRepetitionTimeout": 1,
"blacklistMuteTimeout": 1,
"whitelistMuteTimeout": 1,
"maxRepetitionMuteTimeout": 1,
"enableImageModeration": True,
"imageModeration": {
"nudity": 1,
"suggestive": 1,
"violence": 1,
"disturbing": 1
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>",
"X-API-Key": "<api-key>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: '<authorization>',
'Content-Type': '<content-type>',
'X-API-Key': '<api-key>'
},
body: JSON.stringify({
maxRepetition: 1,
maxRepetitionTimeout: 1,
blacklistMuteTimeout: 1,
whitelistMuteTimeout: 1,
maxRepetitionMuteTimeout: 1,
enableImageModeration: true,
imageModeration: {nudity: 1, suggestive: 1, violence: 1, disturbing: 1}
})
};
fetch('https://apix.us.amity.co/api/v2/moderation-settings', 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/moderation-settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'maxRepetition' => 1,
'maxRepetitionTimeout' => 1,
'blacklistMuteTimeout' => 1,
'whitelistMuteTimeout' => 1,
'maxRepetitionMuteTimeout' => 1,
'enableImageModeration' => true,
'imageModeration' => [
'nudity' => 1,
'suggestive' => 1,
'violence' => 1,
'disturbing' => 1
]
]),
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/moderation-settings"
payload := strings.NewReader("{\n \"maxRepetition\": 1,\n \"maxRepetitionTimeout\": 1,\n \"blacklistMuteTimeout\": 1,\n \"whitelistMuteTimeout\": 1,\n \"maxRepetitionMuteTimeout\": 1,\n \"enableImageModeration\": true,\n \"imageModeration\": {\n \"nudity\": 1,\n \"suggestive\": 1,\n \"violence\": 1,\n \"disturbing\": 1\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://apix.us.amity.co/api/v2/moderation-settings")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.header("X-API-Key", "<api-key>")
.body("{\n \"maxRepetition\": 1,\n \"maxRepetitionTimeout\": 1,\n \"blacklistMuteTimeout\": 1,\n \"whitelistMuteTimeout\": 1,\n \"maxRepetitionMuteTimeout\": 1,\n \"enableImageModeration\": true,\n \"imageModeration\": {\n \"nudity\": 1,\n \"suggestive\": 1,\n \"violence\": 1,\n \"disturbing\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v2/moderation-settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request["X-API-Key"] = '<api-key>'
request.body = "{\n \"maxRepetition\": 1,\n \"maxRepetitionTimeout\": 1,\n \"blacklistMuteTimeout\": 1,\n \"whitelistMuteTimeout\": 1,\n \"maxRepetitionMuteTimeout\": 1,\n \"enableImageModeration\": true,\n \"imageModeration\": {\n \"nudity\": 1,\n \"suggestive\": 1,\n \"violence\": 1,\n \"disturbing\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200
}{
"status": "error",
"code": 400,
"message": "Bad Request."
}{
"status": "error",
"code": 500,
"message": "Unexpected error"
}Authorizations
Body
application/json
moderation setting information
Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Show child attributes
Show child attributes
⌘I