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 wordlist = await client.wordlist.retrieve('id');
console.log(wordlist.id);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
)
wordlist = client.wordlist.retrieve(
"id",
)
print(wordlist.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
wordlist = moderation_api.wordlist.retrieve("id")
puts(wordlist)<?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 {
$wordlist = $client->wordlist->retrieve('id');
var_dump($wordlist);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Wordlist;
ModerationApiClient client = new();
WordlistRetrieveParams parameters = new() { ID = "id" };
var wordlist = await client.Wordlist.Retrieve(parameters);
Console.WriteLine(wordlist);{
"id": "<string>",
"name": "<string>",
"words": [
"<string>"
],
"createdAt": "<string>",
"organizationId": "<string>",
"userId": "<string>",
"strict": true
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Get wordlist
Get a specific wordlist by ID
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 wordlist = await client.wordlist.retrieve('id');
console.log(wordlist.id);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
)
wordlist = client.wordlist.retrieve(
"id",
)
print(wordlist.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
wordlist = moderation_api.wordlist.retrieve("id")
puts(wordlist)<?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 {
$wordlist = $client->wordlist->retrieve('id');
var_dump($wordlist);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Wordlist;
ModerationApiClient client = new();
WordlistRetrieveParams parameters = new() { ID = "id" };
var wordlist = await client.Wordlist.Retrieve(parameters);
Console.WriteLine(wordlist);{
"id": "<string>",
"name": "<string>",
"words": [
"<string>"
],
"createdAt": "<string>",
"organizationId": "<string>",
"userId": "<string>",
"strict": true
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"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.
Path Parameters
ID of the wordlist to get
Response
Successful response
ID of the wordlist
Name of the wordlist
Words in the wordlist
Creation date of the wordlist
ID of the organization
ID of the user
Strict mode
Was this page helpful?
⌘I