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 author = await client.authors.retrieve('id');
console.log(author.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
)
author = client.authors.retrieve(
"id",
)
print(author.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
author = moderation_api.authors.retrieve("id")
puts(author)<?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 {
$author = $client->authors->retrieve('id');
var_dump($author);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Authors;
ModerationApiClient client = new();
AuthorRetrieveParams parameters = new() { ID = "id" };
var author = await client.Authors.Retrieve(parameters);
Console.WriteLine(author);{
"id": "<string>",
"first_seen": 123,
"last_seen": 123,
"status": "enabled",
"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
}{
"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 author details
Get detailed information about a specific author including historical data and analysis
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 author = await client.authors.retrieve('id');
console.log(author.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
)
author = client.authors.retrieve(
"id",
)
print(author.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
author = moderation_api.authors.retrieve("id")
puts(author)<?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 {
$author = $client->authors->retrieve('id');
var_dump($author);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Authors;
ModerationApiClient client = new();
AuthorRetrieveParams parameters = new() { ID = "id" };
var author = await client.Authors.Retrieve(parameters);
Console.WriteLine(author);{
"id": "<string>",
"first_seen": 123,
"last_seen": 123,
"status": "enabled",
"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
}{
"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
Either external ID or the ID assigned by moderation API.
Response
Successful response
Author ID in Moderation API
Timestamp when author first appeared
Timestamp of last activity
Current author status
enabled, suspended, blocked Show child attributes
Show child attributes
Block or suspension details, if applicable. Null if the author is enabled.
Show child attributes
Show child attributes
Risk assessment details, if available.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process.
Show child attributes
Show child attributes
The author's ID from your system
URL of the author's profile picture
URL of the author's external profile
Author name or identifier
Author email address
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$The author's company or organization
Timestamp of last incident
Was this page helpful?