TypeScript
import { ModerationApi } from "@moderation-api/sdk";
const moderationApi = new ModerationApi({
secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
});
async function run() {
const result = await moderationApi.queue.items.list({
id: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();
import os
from moderation_api import ModerationAPI
with ModerationAPI(
secret_key=os.environ["MODAPI_SECRET_KEY"],
) as moderation_api:
res = moderation_api.queue.items.list(id="<id>", page=1, page_size=20)
while res is not None:
# Handle items
res = res.next()
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
getenv('MODAPI_SECRET_KEY')
)
->build();
$request = new Operations\ListQueueItemsRequest(
id: '<id>',
);
$responses = $sdk->queue->items->list(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
require 'moderation_api'
Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
secret_key: ENV.fetch('MODAPI_SECRET_KEY')
)
req = Models::Operations::ListQueueItemsRequest.new(
id: '<id>'
)
res = s.queue.items.list(request: req)
unless res.object.nil?
# handle response
end
modapi queue items list --secret-key "$MODAPI_SECRET_KEY" --id '<id>' --page 1 --page-size 20
{
"data": [
{
"id": "<string>",
"contentId": "<string>",
"content": {
"type": "text",
"text": "<string>"
},
"labels": [
{
"label": "<string>",
"score": 123,
"manual": true,
"flagged": true,
"shadow_flagged": true,
"matches": [
{
"match": "<string>",
"probability": 123,
"span": [
123,
123
],
"mask": "<string>",
"reasons": [
"<string>"
],
"signals": {
"brand_impersonation": {
"brand": "<string>",
"method": "<string>"
},
"has_suspicious_characters": true,
"is_link_shortener": true,
"domain_age_days": 123,
"has_email_setup": true,
"redirect_count": 123,
"final_url": "<string>",
"bot_protection": true,
"is_reported": true
},
"entity_type": "<string>",
"scripts": [
"<string>"
],
"skeleton": "<string>"
}
]
}
],
"flagged": true,
"severity": 123,
"status": "pending",
"timestamp": 123,
"language": "<string>",
"conversationId": "<string>",
"authorId": "<string>",
"contentType": "<string>"
}
],
"pagination": {
"page": 123,
"pageSize": 123,
"total": 123,
"totalPages": 123,
"hasMore": true
}
}{
"type": "invalid_request_error",
"code": "invalid_request",
"message": "Invalid input data",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "authentication_error",
"code": "unauthorized",
"message": "Authorization not provided",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "permission_error",
"code": "permission_denied",
"message": "Insufficient access",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "not_found_error",
"code": "resource_not_found",
"message": "Not found",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "api_error",
"code": "internal_error",
"message": "Internal server error",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}List queue items
List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item id to resolve or unresolve an item.
TypeScript
import { ModerationApi } from "@moderation-api/sdk";
const moderationApi = new ModerationApi({
secretKey: process.env["MODAPI_SECRET_KEY"] ?? "",
});
async function run() {
const result = await moderationApi.queue.items.list({
id: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();
import os
from moderation_api import ModerationAPI
with ModerationAPI(
secret_key=os.environ["MODAPI_SECRET_KEY"],
) as moderation_api:
res = moderation_api.queue.items.list(id="<id>", page=1, page_size=20)
while res is not None:
# Handle items
res = res.next()
declare(strict_types=1);
require 'vendor/autoload.php';
use ModerationApi;
use ModerationApi\Models\Operations;
$sdk = ModerationApi\ModerationApi::builder()
->setSecurity(
getenv('MODAPI_SECRET_KEY')
)
->build();
$request = new Operations\ListQueueItemsRequest(
id: '<id>',
);
$responses = $sdk->queue->items->list(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
require 'moderation_api'
Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
secret_key: ENV.fetch('MODAPI_SECRET_KEY')
)
req = Models::Operations::ListQueueItemsRequest.new(
id: '<id>'
)
res = s.queue.items.list(request: req)
unless res.object.nil?
# handle response
end
modapi queue items list --secret-key "$MODAPI_SECRET_KEY" --id '<id>' --page 1 --page-size 20
{
"data": [
{
"id": "<string>",
"contentId": "<string>",
"content": {
"type": "text",
"text": "<string>"
},
"labels": [
{
"label": "<string>",
"score": 123,
"manual": true,
"flagged": true,
"shadow_flagged": true,
"matches": [
{
"match": "<string>",
"probability": 123,
"span": [
123,
123
],
"mask": "<string>",
"reasons": [
"<string>"
],
"signals": {
"brand_impersonation": {
"brand": "<string>",
"method": "<string>"
},
"has_suspicious_characters": true,
"is_link_shortener": true,
"domain_age_days": 123,
"has_email_setup": true,
"redirect_count": 123,
"final_url": "<string>",
"bot_protection": true,
"is_reported": true
},
"entity_type": "<string>",
"scripts": [
"<string>"
],
"skeleton": "<string>"
}
]
}
],
"flagged": true,
"severity": 123,
"status": "pending",
"timestamp": 123,
"language": "<string>",
"conversationId": "<string>",
"authorId": "<string>",
"contentType": "<string>"
}
],
"pagination": {
"page": 123,
"pageSize": 123,
"total": 123,
"totalPages": 123,
"hasMore": true
}
}{
"type": "invalid_request_error",
"code": "invalid_request",
"message": "Invalid input data",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "authentication_error",
"code": "unauthorized",
"message": "Authorization not provided",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "permission_error",
"code": "permission_denied",
"message": "Insufficient access",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "not_found_error",
"code": "resource_not_found",
"message": "Not found",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}{
"type": "api_error",
"code": "internal_error",
"message": "Internal server error",
"request_id": "h8fkz6kkzoa446ffve37atys",
"doc_url": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
],
"code": "<string>"
}
]
}Authorizations
Headers
Query Parameters
Was this page helpful?