Skip to content

AWS WAF image grid

Summary

PropertyValue
v1 typeimage.grid.aws beta
Compatibility namesnone: native API (v1) only
Proxynot used
Deadline60 seconds (starting value). A task not solved by then fails with timeout and is not charged.

Parameters

The params object of POST /v1/tasks. Unknown fields are rejected with 422 invalid_params.

FieldTypeDescription
image
required
string

Base64 of the whole 3x3 grid image.

min length 1 · max length 1,000,000
question
optional
string

The full question as shown on the page, e.g. Select all hats.

min length 1 · max length 1,024

Solution

The solution object of a solved task.

FieldTypeDescription
objects
required
array of integer

Zero-based indexes of the images or tiles to select, left to right, top to bottom.

max items 64 · unique items
confidences
optional
array of numbermax items 64

Example: native API (v1)

Runs as is with a test key (nop_test_…) in the sandbox; use a live key for real tasks.

POST /v1/tasks
{
"type": "image.grid.aws",
"params": {
"image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"question": "Select all hats"
}
}
Terminal window
export NOPTCHA_KEY=nop_test_... # your test or live key
# waits up to 60 s; 200 = finished (solved or failed), 202 = still processing
IDEMPOTENCY_KEY=$(uuidgen) # one key per task you want; a retry of the same request reuses it
curl -s -X POST "https://api.noptcha.com/v1/tasks" \
-H "Authorization: Bearer $NOPTCHA_KEY" \
-H 'Prefer: wait=60' \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H 'Content-Type: application/json' \
-d @- <<EOF
{
"type": "image.grid.aws",
"params": {
"image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"question": "Select all hats"
}
}
EOF
# on 202: long-poll with the "id" from the response
TASK_ID=...
curl -s "https://api.noptcha.com/v1/tasks/$TASK_ID?wait=60" \
-H "Authorization: Bearer $NOPTCHA_KEY"

In the sandbox the task is solved at once and solution is:

{
"objects": [
0
]
}