Skip to content

Latest commit

 

History

History
146 lines (104 loc) · 18.4 KB

README.md

File metadata and controls

146 lines (104 loc) · 18.4 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

require 'moderation_api'

Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
  secret_key: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.queue.list(page: 1, page_size: 20)

unless res.object.nil?
  # handle response
end

Parameters

Parameter Type Required Description
page T.nilable(::Integer) ➖ N/A
page_size T.nilable(::Integer) ➖ N/A
project_id T.nilable(::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

T.nilable(Models::Operations::ListQueuesResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestError 400 application/json
Models::Errors::AuthenticationError 401 application/json
Models::Errors::PermissionDeniedError 403 application/json
Models::Errors::NotFoundError 404 application/json
Models::Errors::RateLimitError 429 application/json
Models::Errors::InternalServerError 500 application/json
Errors::APIError 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

require 'moderation_api'

Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
  secret_key: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.queue.retrieve(id: '<id>')

unless res.object.nil?
  # handle response
end

Parameters

Parameter Type Required Description
id ::String ✔️ The queue ID.
project_id T.nilable(::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

T.nilable(Models::Operations::GetQueueResponse)

Errors

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

get_stats

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

Example Usage

require 'moderation_api'

Models = ::ModerationApi::Models
s = ::ModerationApi::ModerationApi.new(
  secret_key: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.queue.get_stats(id: '<id>', within_days: 30)

unless res.object.nil?
  # handle response
end

Parameters

Parameter Type Required Description
id ::String ✔️ The queue ID.
within_days T.nilable(::Integer) ➖ N/A
project_id T.nilable(::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

T.nilable(Models::Operations::GetQueueStatsResponse)

Errors

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