> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omocaptcha.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AmznSelectObjectTask

> Solve Amazon object-selection captcha (3x3 grid)

Object-selection is a common Amazon captcha. The user must select every tile matching the question topic from a 3x3 image grid.

<Frame>
  <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/amzn-select-object-modal.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=c8f974914eff9f33774f90b039dddc33" style={{ maxWidth: "360px", width: "100%" }} width="320" height="483" data-path="images/amzn-select-object-modal.png" />
</Frame>

## 1. Create task

**Request**

```text theme={null}
POST https://api.omocaptcha.com/v2/createTask
```

| Parameter          | Type     | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------ | -------- | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientKey`        | `String` |     ✅    | Client account key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `task.type`        | `String` |     ✅    | Captcha service class name. Value: `AmznSelectObjectTask`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `task.imageBase64` | `String` |     ✅    | Base64-encoded 3x3 grid image<br /><br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/amzn-select-object-grid.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=91b1885a94c8fb04565c67271d138539" style={{ maxWidth: "260px", width: "100%" }} width="320" height="320" data-path="images/amzn-select-object-grid.png" />                                           |
| `task.other`       | `String` |     ✅    | Captcha question text (e.g. `the bags`)<br /><br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/amzn-select-object-question.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=769ae8ea6ca67c1a116552354a2bd12f" style={{ maxWidth: "260px", width: "100%" }} width="321" height="484" data-path="images/amzn-select-object-question.png" /> |

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.omocaptcha.com/v2/createTask \
    -H "Content-Type: application/json" \
    -d '{
      "clientKey": "OMO_API_KEY",
      "task": {
        "type": "AmznSelectObjectTask",
        "imageBase64": "BASE64_BODY_HERE",
        "other": "the bags"
      }
    }'
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const { data } = await axios.post('https://api.omocaptcha.com/v2/createTask', {
    clientKey: 'OMO_API_KEY',
    task: {
      type: 'AmznSelectObjectTask',
      imageBase64: 'BASE64_BODY_HERE',
      other: 'the bags'
    }
  });

  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  res = requests.post('https://api.omocaptcha.com/v2/createTask', json={
      'clientKey': 'OMO_API_KEY',
      'task': {
          'type': 'AmznSelectObjectTask',
          'imageBase64': 'BASE64_BODY_HERE',
          'other': 'the bags'
      }
  })

  print(res.json())
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.omocaptcha.com/v2/createTask');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
      'clientKey' => 'OMO_API_KEY',
      'task' => [
          'type' => 'AmznSelectObjectTask',
          'imageBase64' => 'BASE64_BODY_HERE',
          'other' => 'the bags'
      ]
  ]));

  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```
</CodeGroup>

**Response**

Success:

```json theme={null}
{
  "errorId": 0,
  "taskId": "49f9f60a-c809-4af0-93c0-0409b72e67e0"
}
```

The server returns `errorId = 0` and a `taskId` on success.

Failure:

```json theme={null}
{
  "errorId": 1,
  "errorCode": "",
  "errorDescription": ""
}
```

The server returns `errorId = 1` together with the corresponding `errorCode`.

## 2. Get task result

**Request**

```text theme={null}
POST https://api.omocaptcha.com/v2/getTaskResult
```

```json theme={null}
{
  "clientKey": "OMO_API_KEY",
  "taskId": "49f9f60a-c809-4af0-93c0-0409b72e67e0"
}
```

**Response**

Success:

```json theme={null}
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "objects": [0, 1, 2, 3]
  }
}
```

The server returns `errorId = 0` and `status = ready`. Read the result from `solution`.

<Tip>
  The `objects` array contains the indices of the tiles to click in the 3x3 grid, numbered **0 to 8**, from **left to right, top to bottom**:

  ```text theme={null}
  0 | 1 | 2
  3 | 4 | 5
  6 | 7 | 8
  ```

  After clicking the matching tiles, press the **Confirm** button to submit.
</Tip>

Processing:

```json theme={null}
{
  "status": "processing",
  "errorId": 0,
  "errorCode": "",
  "errorDescription": ""
}
```

The server returns `errorId = 0` and `status = processing`. Wait 2 seconds and try again.

Failure:

```json theme={null}
{
  "errorId": 1,
  "errorCode": "ERROR_JOB_STATUS",
  "errorDescription": "Job failed",
  "status": "fail",
  "solution": {}
}
```

The server returns `errorId = 1` when the job fails.
