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

# TiktokSelectObjectWebTask

> Pick 2 objects with the same shape on TikTok web captcha

Picking 2 objects on the web is a common captcha type on TikTok.

<Frame caption="Example of the 'Pick 2 objects with the same shape' TikTok captcha">
  <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/tiktok-select-object-modal.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=b6279d1f6dea4bc07d1d2381385a5775" alt="Tiktok select object modal" width="1520" height="855" data-path="images/tiktok-select-object-modal.png" />
</Frame>

## 1. Create the task

### Request

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

| Parameter          | Type   | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------ | ------ | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientKey`        | String |     ✅    | Your client API key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `task.type`        | String |     ✅    | Captcha service class name — `TiktokSelectObjectWebTask`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `task.imageBase64` | String |     ✅    | Base64-encoded challenge image <br /> <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/tiktok-select-object-image.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=1c7c0e4493c62c8751345a6943cfeb0f" alt="Challenge image" style={{ width: "100%", maxWidth: "260px", marginTop: "8px" }} width="552" height="344" data-path="images/tiktok-select-object-image.png" /> |
| `task.widthView`   | Number |     ✅    | Rendered image width on the web (px) <br /> <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/tiktok-width-view.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=bfc8a4a07bf1baa3903cc0cedc7885ab" alt="widthView" style={{ width: "100%", maxWidth: "260px", marginTop: "8px" }} width="422" height="212" data-path="images/tiktok-width-view.png" />                                                                         |
| `task.heightView`  | Number |     ✅    | Rendered image height on the web (px) <br /> <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/tiktok-height-view.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=4dad715d2002d4eb5434abf1ed80e78d" alt="heightView" style={{ width: "100%", maxWidth: "260px", marginTop: "8px" }} width="422" height="212" data-path="images/tiktok-height-view.png" />                                                               |
| `task.question`    | String |     ✅    | Captcha question (e.g. `Which of these objects are used in hoops?`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

<Info>
  `widthView` and `heightView` are the image dimensions **as rendered on the page** (not the original image size). Right-click the image → *Inspect element* to read the correct values.
</Info>

<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": "TiktokSelectObjectWebTask",
        "imageBase64": "BASE64_BODY_HERE",
        "widthView": 340,
        "heightView": 212,
        "question": "Which of these objects.?"
      }
    }'
  ```

  ```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: "TiktokSelectObjectWebTask",
      imageBase64: "BASE64_BODY_HERE",
      widthView: 340,
      heightView: 212,
      question: "Which of these objects.?",
    },
  });

  console.log(data);
  ```

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

  resp = requests.post(
      "https://api.omocaptcha.com/v2/createTask",
      json={
          "clientKey": "OMO_API_KEY",
          "task": {
              "type": "TiktokSelectObjectWebTask",
              "imageBase64": "BASE64_BODY_HERE",
              "widthView": 340,
              "heightView": 212,
              "question": "Which of these objects.?",
          },
      },
  )
  print(resp.json())
  ```

  ```php PHP theme={null}
  <?php
  $payload = [
      "clientKey" => "OMO_API_KEY",
      "task" => [
          "type"        => "TiktokSelectObjectWebTask",
          "imageBase64" => "BASE64_BODY_HERE",
          "widthView"   => 340,
          "heightView"  => 212,
          "question"    => "Which of these objects.?",
      ],
  ];

  $ch = curl_init("https://api.omocaptcha.com/v2/createTask");
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_POST           => true,
      CURLOPT_HTTPHEADER     => ["Content-Type: application/json"],
      CURLOPT_POSTFIELDS     => json_encode($payload),
  ]);
  echo curl_exec($ch);
  curl_close($ch);
  ```
</CodeGroup>

### Response

**Success:**

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

The server returns `errorId = 0` with a `taskId` when the task is created successfully.

**Failure:**

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

The server returns `errorId = 1` and the corresponding `errorCode`.

## 2. Get the result

### Request

```http 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": {
    "pointA": { "x": 50, "y": 30 },
    "pointB": { "x": 100, "y": 70 }
  }
}
```

The server returns `errorId = 0` and `status = ready`. Read the two click points from `solution.pointA` and `solution.pointB`.

<Tip>
  `x` and `y` are given in the rendered image coordinate system (based on `widthView` × `heightView`). Click those two points and then press **Confirm**.
</Tip>

**Processing:**

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

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

**Failure:**

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

The server returns `errorId = 1` — see [Error Codes](/en/api/error-codes) for handling.
