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 action = await client.actions.update('id');
console.log(action.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
)
action = client.actions.update(
id="id",
)
print(action.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
action = moderation_api.actions.update("id")
puts(action)<?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 {
$action = $client->actions->update(
'id',
builtIn: true,
description: 'description',
filterInQueueIDs: ['string'],
freeText: true,
key: 'key',
name: 'name',
position: 'ALL_QUEUES',
possibleValues: [['value' => 'value']],
queueBehaviour: 'REMOVE',
type: 'AUTHOR_BLOCK',
valueRequired: true,
);
var_dump($action);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Actions;
ModerationApiClient client = new();
ActionUpdateParams parameters = new() { ID = "id" };
var action = await client.Actions.Update(parameters);
Console.WriteLine(action);{
"id": "<string>",
"createdAt": "<string>",
"name": "<string>",
"builtIn": false,
"queueBehaviour": "NO_CHANGE",
"filterInQueueIds": [],
"position": "ALL_QUEUES",
"possibleValues": [],
"valueRequired": false,
"freeText": false,
"key": "<string>",
"description": "<string>",
"type": "AUTHOR_BLOCK"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "CONFLICT",
"message": "Action with this key already exists",
"issues": []
}Update an action
Update an action.
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 action = await client.actions.update('id');
console.log(action.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
)
action = client.actions.update(
id="id",
)
print(action.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
action = moderation_api.actions.update("id")
puts(action)<?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 {
$action = $client->actions->update(
'id',
builtIn: true,
description: 'description',
filterInQueueIDs: ['string'],
freeText: true,
key: 'key',
name: 'name',
position: 'ALL_QUEUES',
possibleValues: [['value' => 'value']],
queueBehaviour: 'REMOVE',
type: 'AUTHOR_BLOCK',
valueRequired: true,
);
var_dump($action);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Actions;
ModerationApiClient client = new();
ActionUpdateParams parameters = new() { ID = "id" };
var action = await client.Actions.Update(parameters);
Console.WriteLine(action);{
"id": "<string>",
"createdAt": "<string>",
"name": "<string>",
"builtIn": false,
"queueBehaviour": "NO_CHANGE",
"filterInQueueIds": [],
"position": "ALL_QUEUES",
"possibleValues": [],
"valueRequired": false,
"freeText": false,
"key": "<string>",
"description": "<string>",
"type": "AUTHOR_BLOCK"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "CONFLICT",
"message": "Action with this key already exists",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the action to update.
Body
User defined key of the action.
The name of the action.
The description of the action.
The type of the action.
AUTHOR_BLOCK, AUTHOR_BLOCK_TEMP, AUTHOR_UNBLOCK, AUTHOR_DELETE, AUTHOR_REPORT, AUTHOR_WARN, AUTHOR_CUSTOM, ITEM_REJECT, ITEM_ALLOW, ITEM_CUSTOM Whether the action is a built-in action or a custom one.
Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.
REMOVE, ADD, NO_CHANGE The IDs of the queues the action is available in.
Show the action in all queues, selected queues or no queues (to use via API only).
ALL_QUEUES, SOME_QUEUES, HIDDEN The possible values of the action. The user will be prompted to select one of these values when executing the action.
Show child attributes
Show child attributes
Whether the action requires a value to be executed.
Whether the action allows any text to be entered as a value or if it must be one of the possible values.
Response
Action updated successfully
The ID of the action.
The date the action was created.
The name of the action.
Whether the action is a built-in action or a custom one.
Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status.
REMOVE, ADD, NO_CHANGE The IDs of the queues the action is available in.
Show the action in all queues, selected queues or no queues (to use via API only).
ALL_QUEUES, SOME_QUEUES, HIDDEN The possible values of the action. The user will be prompted to select one of these values when executing the action.
Show child attributes
Show child attributes
Whether the action requires a value to be executed.
Whether the action allows any text to be entered as a value or if it must be one of the possible values.
User defined key of the action.
The description of the action.
The type of the action.
AUTHOR_BLOCK, AUTHOR_BLOCK_TEMP, AUTHOR_UNBLOCK, AUTHOR_DELETE, AUTHOR_REPORT, AUTHOR_WARN, AUTHOR_CUSTOM, ITEM_REJECT, ITEM_ALLOW, ITEM_CUSTOM Was this page helpful?