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 response = await client.actions.execute.executeByID('actionId');
console.log(response.ids);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
)
response = client.actions.execute.execute_by_id(
action_id="actionId",
)
print(response.ids)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
response = moderation_api.actions.execute.execute_by_id("actionId")
puts(response)<?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 {
$response = $client->actions->execute->executeByID(
'actionId',
authorIDs: ['string'],
contentIDs: ['string'],
queueID: 'queueId',
value: 'value',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Actions.Execute;
ModerationApiClient client = new();
ExecuteExecuteByIDParams parameters = new() { ActionID = "actionId" };
var response = await client.Actions.Execute.ExecuteByID(parameters);
Console.WriteLine(response);{
"success": true,
"actionId": "<string>",
"ids": [
"<string>"
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}Execute an action
deprecated
Execute an action on a set of content items in a queue.
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 response = await client.actions.execute.executeByID('actionId');
console.log(response.ids);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
)
response = client.actions.execute.execute_by_id(
action_id="actionId",
)
print(response.ids)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
response = moderation_api.actions.execute.execute_by_id("actionId")
puts(response)<?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 {
$response = $client->actions->execute->executeByID(
'actionId',
authorIDs: ['string'],
contentIDs: ['string'],
queueID: 'queueId',
value: 'value',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Actions.Execute;
ModerationApiClient client = new();
ExecuteExecuteByIDParams parameters = new() { ActionID = "actionId" };
var response = await client.Actions.Execute.ExecuteByID(parameters);
Console.WriteLine(response);{
"success": true,
"actionId": "<string>",
"ids": [
"<string>"
]
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID or key of the action to execute.
Body
application/json
Was this page helpful?