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 wordlists = await client.wordlist.list();
console.log(wordlists);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
)
wordlists = client.wordlist.list()
print(wordlists)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
wordlists = moderation_api.wordlist.list
puts(wordlists)<?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 {
$wordlists = $client->wordlist->list();
var_dump($wordlists);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Wordlist;
ModerationApiClient client = new();
WordlistListParams parameters = new();
var wordlists = await client.Wordlist.List(parameters);
Console.WriteLine(wordlists);[
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"createdAt": "<string>",
"userId": "<string>"
}
]{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}List wordlists
List all wordlists for the authenticated organization
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 wordlists = await client.wordlist.list();
console.log(wordlists);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
)
wordlists = client.wordlist.list()
print(wordlists)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
wordlists = moderation_api.wordlist.list
puts(wordlists)<?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 {
$wordlists = $client->wordlist->list();
var_dump($wordlists);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Wordlist;
ModerationApiClient client = new();
WordlistListParams parameters = new();
var wordlists = await client.Wordlist.List(parameters);
Console.WriteLine(wordlists);[
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"createdAt": "<string>",
"userId": "<string>"
}
]{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Successful response
Was this page helpful?
⌘I