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 authors = await client.authors.list();
console.log(authors.authors);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
)
authors = client.authors.list()
print(authors.authors)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
authors = moderation_api.authors.list
puts(authors)<?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 {
$authors = $client->authors->list(
contentTypes: 'contentTypes',
lastActiveDate: 'lastActiveDate',
memberSinceDate: 'memberSinceDate',
pageNumber: 0,
pageSize: 0,
sortBy: 'trustLevel',
sortDirection: 'asc',
);
var_dump($authors);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Authors;
ModerationApiClient client = new();
AuthorListParams parameters = new();
var authors = await client.Authors.List(parameters);
Console.WriteLine(authors);{
"authors": [
{
"id": "<string>",
"first_seen": 123,
"last_seen": 123,
"trust_level": {
"level": 123,
"manual": true
},
"block": {
"until": 123,
"reason": "<string>"
},
"risk_evaluation": {
"risk_level": 50
},
"metrics": {
"total_content": 123,
"flagged_content": 123,
"average_sentiment": 123
},
"metadata": {
"email_verified": true,
"phone_verified": true,
"identity_verified": true,
"is_paying_customer": true
},
"external_id": "<string>",
"profile_picture": "<string>",
"external_link": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"company": "<string>",
"last_incident": 123
}
],
"pagination": {
"total": 123,
"pageSize": 123,
"pageNumber": 123,
"hasNextPage": true,
"hasPreviousPage": 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": []
}List authors (Enterprise)
Get a paginated list of authors with their activity metrics and reputation
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 authors = await client.authors.list();
console.log(authors.authors);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
)
authors = client.authors.list()
print(authors.authors)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
authors = moderation_api.authors.list
puts(authors)<?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 {
$authors = $client->authors->list(
contentTypes: 'contentTypes',
lastActiveDate: 'lastActiveDate',
memberSinceDate: 'memberSinceDate',
pageNumber: 0,
pageSize: 0,
sortBy: 'trustLevel',
sortDirection: 'asc',
);
var_dump($authors);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Authors;
ModerationApiClient client = new();
AuthorListParams parameters = new();
var authors = await client.Authors.List(parameters);
Console.WriteLine(authors);{
"authors": [
{
"id": "<string>",
"first_seen": 123,
"last_seen": 123,
"trust_level": {
"level": 123,
"manual": true
},
"block": {
"until": 123,
"reason": "<string>"
},
"risk_evaluation": {
"risk_level": 50
},
"metrics": {
"total_content": 123,
"flagged_content": 123,
"average_sentiment": 123
},
"metadata": {
"email_verified": true,
"phone_verified": true,
"identity_verified": true,
"is_paying_customer": true
},
"external_id": "<string>",
"profile_picture": "<string>",
"external_link": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"company": "<string>",
"last_incident": 123
}
],
"pagination": {
"total": 123,
"pageSize": 123,
"pageNumber": 123,
"hasNextPage": true,
"hasPreviousPage": 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.
Query Parameters
Number of authors per page
Page number to fetch
Available options:
trustLevel, violationCount, reportCount, memberSince, lastActive, contentCount, flaggedContentRatio, averageSentiment Sort direction
Available options:
asc, desc Was this page helpful?
⌘I