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

# Tencent Slider

> Giải Tencent slider captcha (global.captcha.gtimg.com) bằng SliderAllWebTask — bộ giải kéo-thả chung.

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

<Note>
  Tencent slider được giải qua **`SliderAllWebTask`** — bộ giải kéo-thả chung cho mọi nhà cung cấp. Xem trang [SliderAllWebTask](/vi/api/slider-all/overview) để biết chi tiết đầy đủ. Trang này giữ lại cho mục đích tham khảo với `domain` thực tế của Tencent.
</Note>

## 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` |     ✅    | `SliderAllWebTask`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `task.imageBase64` | `String` |     ✅    | Ảnh nền (background) đã mã hoá Base64.<br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/tencent-slider-image.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=18c994f4c7a9098062e49a205153639c" style={{ maxWidth: "260px", width: "100%" }} width="672" height="390" data-path="images/tencent-slider-image.png" /> |
| `task.puzzle`      | `String` |     ✅    | Hình ảnh được mã hóa base64.<br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/tencent-slider-puzzle.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=d40acaf55f939a076ec516311f8b5c26" style={{ maxWidth: "120px", width: "100%" }} width="682" height="620" data-path="images/tencent-slider-puzzle.png" />   |
| `task.domain`      | `String` |     ✅    | Domain của iframe chứa captcha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `task.widthView`   | `Number` |     ✅    | Width thực tế hiển thị của ảnh captcha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `task.heightView`  | `Number` |     ✅    | Height thực tế hiển thị của ảnh captcha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### 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": "SliderAllWebTask",
        "imageBase64": "BASE64_BACKGROUND",
        "puzzle": "BASE64_PUZZLE",
        "domain": "global.captcha.gtimg.com",
        "widthView": 340,
        "heightView": 243
      }
    }'
  ```

  ```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: "SliderAllWebTask",
        imageBase64: "BASE64_BACKGROUND",
        puzzle: "BASE64_PUZZLE",
        domain: "global.captcha.gtimg.com",
        widthView: 340,
        heightView: 243
      }
    })
  });
  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": "SliderAllWebTask",
          "imageBase64": "BASE64_BACKGROUND",
          "puzzle": "BASE64_PUZZLE",
          "domain": "global.captcha.gtimg.com",
          "widthView": 340,
          "heightView": 243
      }
  })
  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" => "SliderAllWebTask",
      "imageBase64" => "BASE64_BACKGROUND",
      "puzzle" => "BASE64_PUZZLE",
      "domain" => "global.captcha.gtimg.com",
      "widthView" => 340,
      "heightView" => 243
    ]
  ]));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  echo curl_exec($ch);
  ```
</CodeGroup>

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

```json theme={null}
{
  "errorId": 0,
  "taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

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

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

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

```json theme={null}
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "end": { "x": 150, "y": 42 }
  }
}
```

`solution.end` là toạ độ điểm thả mảnh ghép trong hệ toạ độ của ảnh nền.
