What a rule would have queued
const url = 'https://example.com/v1/projects/example/judging-rules/preview';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/v1/projects/example/judging-rules/preview \ --header 'Authorization: Bearer <token>'Among the project’s last last top-level runs (not replays), how many a rule with these fields (and its sample) would have queued. The rule editor’s “would have added N of the last 100”. Lists are comma-separated. Needs read on the project.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ProjectId — opaque branded string.
Query Parameters
Section titled “Query Parameters”Comma-separated.
Comma-separated.
Comma-separated; live for the live version.
Comma-separated: completed, failed, cancelled.
true to count dry runs.
0 < sample ≤ 1. Default 1.
How many recent runs to look at, 1 to 500. Default 100.
An existing rule’s id, to sample as that rule does: matched is then exactly the runs it would take. Without it, matched is an estimate.
Responses
Section titled “Responses”The preview.
object
The recent runs looked at.
Those the rule would have queued, with its sample (maxOpen isn’t applied).
Examplegenerated
{ "considered": 1, "matched": 1}A malformed field (bad-input).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No project with that id (project-not-found).
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}