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 accounts = await client.account.list();
console.log(accounts.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
)
accounts = client.account.list()
print(accounts.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
accounts = moderation_api.account.list
puts(accounts)<?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 {
$accounts = $client->account->list();
var_dump($accounts);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Account;
ModerationApiClient client = new();
AccountListParams parameters = new();
var accounts = await client.Account.List(parameters);
Console.WriteLine(accounts);{
"id": "<string>",
"paid_plan_name": "<string>",
"text_api_quota": 123,
"remaining_quota": 123,
"current_project": {
"id": "<string>",
"name": "<string>"
}
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}Get account details
Get account details
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 accounts = await client.account.list();
console.log(accounts.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
)
accounts = client.account.list()
print(accounts.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
accounts = moderation_api.account.list
puts(accounts)<?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 {
$accounts = $client->account->list();
var_dump($accounts);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Account;
ModerationApiClient client = new();
AccountListParams parameters = new();
var accounts = await client.Account.List(parameters);
Console.WriteLine(accounts);{
"id": "<string>",
"paid_plan_name": "<string>",
"text_api_quota": 123,
"remaining_quota": 123,
"current_project": {
"id": "<string>",
"name": "<string>"
}
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Was this page helpful?
⌘I