JavaScript
import ModerationAPI from '@moderation-api/sdk';
const client = new ModerationAPI({
secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted
});
const word = await client.wordlist.words.remove('id', { words: ['string'] });
console.log(word.removedCount);import os
from moderation_api import ModerationAPI
client = ModerationAPI(
secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted
)
word = client.wordlist.words.remove(
id="id",
words=["string"],
)
print(word.removed_count)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
word = moderation_api.wordlist.words.remove("id", words: ["string"])
puts(word)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ModerationAPI\Client;
use ModerationAPI\Core\Exceptions\APIException;
$client = new Client(secretKey: getenv('MODAPI_SECRET_KEY') ?: 'My Secret Key');
try {
$word = $client->wordlist->words->remove('id', words: ['string']);
var_dump($word);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Wordlist.Words;
ModerationApiClient client = new();
WordRemoveParams parameters = new()
{
ID = "id",
Words =
[
"string"
],
};
var word = await client.Wordlist.Words.Remove(parameters);
Console.WriteLine(word);{
"removedCount": 123,
"totalCount": 123,
"removedWords": [
"<string>"
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}Remove words from wordlist
Remove words from an existing wordlist
JavaScript
import ModerationAPI from '@moderation-api/sdk';
const client = new ModerationAPI({
secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted
});
const word = await client.wordlist.words.remove('id', { words: ['string'] });
console.log(word.removedCount);import os
from moderation_api import ModerationAPI
client = ModerationAPI(
secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted
)
word = client.wordlist.words.remove(
id="id",
words=["string"],
)
print(word.removed_count)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
word = moderation_api.wordlist.words.remove("id", words: ["string"])
puts(word)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ModerationAPI\Client;
use ModerationAPI\Core\Exceptions\APIException;
$client = new Client(secretKey: getenv('MODAPI_SECRET_KEY') ?: 'My Secret Key');
try {
$word = $client->wordlist->words->remove('id', words: ['string']);
var_dump($word);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Wordlist.Words;
ModerationApiClient client = new();
WordRemoveParams parameters = new()
{
ID = "id",
Words =
[
"string"
],
};
var word = await client.Wordlist.Words.Remove(parameters);
Console.WriteLine(word);{
"removedCount": 123,
"totalCount": 123,
"removedWords": [
"<string>"
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the wordlist to remove words from
Query Parameters
Array of words to remove from the wordlist
Was this page helpful?
⌘I