DocumentationAPI v1
POST/api/v1/getTaskResult

Retrieve Task Result

Fetches the current execution status and final solution for a task created via POST /createTask. Pass wait to enable low-latency long polling instead of tight 1-second loops.

Task Status Lifecycle

pending

Task accepted and waiting to start.

processing

Task is currently being solved.

completed

Solved — solution payload is ready to use.

failed

Unsolvable or expired — balance auto-refunded.

Request Parameters

FieldTypeRequiredDescription
clientKeystringrequiredYour ByeCap API key (also accepted as client_key or X-API-Key header).
taskIdstringrequiredUUID returned by POST /createTask (also accepted as task_id).
waitintegeroptionalOptional server-side long-poll duration in seconds (0–30). Holds the connection until solved to minimize round-trips.

Polling Examples

POST /getTaskResult
curl -X POST https://api.byecap.org/api/v1/getTaskResult \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "taskId": "76f8a21c-9b3e-4e11-a210-9c881c2e77a1",
    "wait": 10
  }'

Response Payloads

200 OK — Completed
{
  "taskId": "76f8a21c-9b3e-4e11-a210-9c881c2e77a1",
  "status": "completed",
  "solution": {
    "text": "7K4M9"
  }
}
200 OK — Failed (Auto-Refunded)
{
  "taskId": "76f8a21c-9b3e-4e11-a210-9c881c2e77a1",
  "status": "failed",
  "error": {
    "code": "TASK_TIMEOUT",
    "message": "Task execution timed out"
  }
}