> ## 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.

# TencentSelectObjectTask

> Giải Tencent captcha chọn đối tượng (select object) bằng TencentSelectObjectTask.

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

Captcha select object là một loại hình ảnh xác thực phổ biến — người dùng cần chọn các đối tượng phù hợp với câu hỏi (hoặc ảnh anchor) trong lưới ảnh.

## 1. Tạo yêu cầu

**Endpoint:** `POST https://api.omocaptcha.com/v2/createTask`

### Tham số

| Tham số            | Kiểu     | Bắt buộc | Mô tả                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------ | -------- | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientKey`        | `String` |     ✅    | API key trong tài khoản của bạn.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `task.type`        | `String` |     ✅    | Tên class dịch vụ captcha cần giải                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `task.imageBase64` | `String` |     ✅    | Hình ảnh captcha đã mã hoá Base64.<br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/tencent-select-object-image.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=7b173c7b00abd5297a22bebf04d8e99f" style={{ maxWidth: "260px", width: "100%" }} width="672" height="480" data-path="images/tencent-select-object-image.png" />            |
| `task.question`    | `String` |     ✅    | Câu hỏi của captcha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `task.anchor`      | `String` |     ❌    | Ảnh anchor (nếu có) ngay sau câu hỏi.<br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/tencent-select-object-anchor.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=015873e486e8507238c5d82ddb51bb65" style={{ maxWidth: "120px", width: "100%" }} width="198" height="194" data-path="images/tencent-select-object-anchor.png" /> |

### Ví dụ request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.omocaptcha.com/v2/createTask \
    -H "Content-Type: application/json" \
    -d '{
      "clientKey": "YOUR_API_KEY",
      "task": {
        "type": "TencentSelectObjectTask",
        "imageBase64": "BASE64_IMAGE",
        "question": "choose the most alike",
        "anchor": "BASE64_ANCHOR"
      }
    }'
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://api.omocaptcha.com/v2/createTask", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      clientKey: "YOUR_API_KEY",
      task: {
        type: "TencentSelectObjectTask",
        imageBase64: "BASE64_IMAGE",
        question: "choose the most alike",
        anchor: "BASE64_ANCHOR"
      }
    })
  });
  console.log(await res.json());
  ```

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

  res = requests.post("https://api.omocaptcha.com/v2/createTask", json={
      "clientKey": "YOUR_API_KEY",
      "task": {
          "type": "TencentSelectObjectTask",
          "imageBase64": "BASE64_IMAGE",
          "question": "choose the most alike",
          "anchor": "BASE64_ANCHOR"
      }
  })
  print(res.json())
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init("https://api.omocaptcha.com/v2/createTask");
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, ["Content-Type: application/json"]);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    "clientKey" => "YOUR_API_KEY",
    "task" => [
      "type" => "TencentSelectObjectTask",
      "imageBase64" => "BASE64_IMAGE",
      "question" => "choose the most alike",
      "anchor" => "BASE64_ANCHOR"
    ]
  ]));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  echo curl_exec($ch);
  ```
</CodeGroup>

### Ví dụ phản hồi

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

## 2. Lấy kết quả

**Endpoint:** `POST https://api.omocaptcha.com/v2/getTaskResult`

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

### Ví dụ phản hồi

```json theme={null}
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "objects": [4, 5]
  }
}
```

`solution.objects` là danh sách chỉ số (bắt đầu từ `0`) của các ô ảnh cần chọn trong lưới, đọc từ trái sang phải, trên xuống dưới.
