Skip to content

Latest commit

 

History

History
180 lines (123 loc) · 18 KB

README.md

File metadata and controls

180 lines (123 loc) · 18 KB

Queue

Overview

Available Operations

list

List the review queues of the project. The default queue comes first. The list is paginated. To get the item counts of a queue, use GET /queue/{id}.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use ModerationApi;

$sdk = ModerationApi\ModerationApi::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$responses = $sdk->queue->list(
    page: 1,
    pageSize: 20

);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
page ?int ➖ N/A
pageSize ?int ➖ N/A
projectId ?string ➖ The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.

Response

?Operations\ListQueuesResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestError 400 application/json
Errors\AuthenticationError 401 application/json
Errors\PermissionDeniedError 403 application/json
Errors\NotFoundError 404 application/json
Errors\RateLimitError 429 application/json
Errors\InternalServerError 500 application/json
Errors\APIException 4XX, 5XX */*

retrieve

Get a review queue with its item counts. The counts use the filters and the date window of the queue, the same as the dashboard.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use ModerationApi;

$sdk = ModerationApi\ModerationApi::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->queue->retrieve(
    id: '<id>'
);

if ($response->object !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ The queue ID.
projectId ?string ➖ The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.

Response

?Operations\GetQueueResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestError 400 application/json
Errors\AuthenticationError 401 application/json
Errors\PermissionDeniedError 403 application/json
Errors\NotFoundError 404 application/json
Errors\RateLimitError 429 application/json
Errors\InternalServerError 500 application/json
Errors\APIException 4XX, 5XX */*

getStats

Get review statistics of a queue for a period: resolved and pending items, the top reviewers and the resolved items per day.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use ModerationApi;

$sdk = ModerationApi\ModerationApi::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->queue->getStats(
    id: '<id>',
    withinDays: 30

);

if ($response->object !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ The queue ID.
withinDays ?int ➖ N/A
projectId ?string ➖ The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.

Response

?Operations\GetQueueStatsResponse

Errors

Error Type Status Code Content Type
Errors\BadRequestError 400 application/json
Errors\AuthenticationError 401 application/json
Errors\PermissionDeniedError 403 application/json
Errors\NotFoundError 404 application/json
Errors\RateLimitError 429 application/json
Errors\InternalServerError 500 application/json
Errors\APIException 4XX, 5XX */*