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

# ShopeeSliderWebTask

> Solve Shopee slider captcha on web.

Shopee slider captcha is a common image challenge. The user has to drag a small puzzle piece to the correct position on the background image.

<Frame caption="Example of Shopee slider captcha">
  <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/shopee-slider-modal.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=fa91111138931f23d210c896a62f44f5" style={{ maxWidth: "360px", width: "100%" }} width="327" height="309" data-path="images/shopee-slider-modal.png" />
</Frame>

<Info>
  `ShopeeSliderWebTask` supports **two modes**:

  * **Regular slider** — drag horizontally (returns `end` coordinates).
  * **Undetermined trajectory** (`typeCaptcha = "rotate"`) — drag along an arbitrary path (returns `point`).
</Info>

## 1a. Create task — Regular slider

### Request

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

| Parameter           | Type              | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------- | ----------------- | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientKey`         | `String`          |     ✅    | Client API key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `task.type`         | `String`          |     ✅    | Captcha service class name (`ShopeeSliderWebTask`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `task.imageBase64s` | `Array of String` |     ✅    | Array of 2 base64 strings: **\[mask image, background image]** <br /><br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/shopee-slider-mask.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=9f02ef8931a35b7b3b7881696667376e" style={{ maxWidth: "90px", width: "100%" }} width="47" height="43" data-path="images/shopee-slider-mask.png" /> <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/shopee-slider-background.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=efe610e609a829b610b99e7aa550d895" style={{ maxWidth: "260px", width: "100%" }} width="280" height="150" data-path="images/shopee-slider-background.png" /> |

### Code samples

<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": "ShopeeSliderWebTask",
        "imageBase64s": [
          "BASE64_MASK_BODY_HERE",
          "BASE64_BACKGROUND_BODY_HERE"
        ]
      }
    }'
  ```

  ```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: 'ShopeeSliderWebTask',
      imageBase64s: [
        'BASE64_MASK_BODY_HERE',
        'BASE64_BACKGROUND_BODY_HERE',
      ],
    },
  });

  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': 'ShopeeSliderWebTask',
          'imageBase64s': [
              'BASE64_MASK_BODY_HERE',
              'BASE64_BACKGROUND_BODY_HERE',
          ],
      },
  })

  print(resp.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_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
      'clientKey' => 'OMO_API_KEY',
      'task' => [
          'type' => 'ShopeeSliderWebTask',
          'imageBase64s' => [
              'BASE64_MASK_BODY_HERE',
              'BASE64_BACKGROUND_BODY_HERE',
          ],
      ],
  ]));

  $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 `taskId` on success.

## 1b. Create task — Undetermined trajectory

Used when the captcha requires dragging along an **arbitrary path** (not restricted to horizontal). Add `typeCaptcha = "rotate"`.

<Frame caption="Example of Shopee undetermined-trajectory captcha">
  <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/shopee-slider-rotate-modal.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=7e2d336b7793746c7bceaebf3a9bda89" style={{ maxWidth: "360px", width: "100%" }} width="332" height="351" data-path="images/shopee-slider-rotate-modal.png" />
</Frame>

### Request

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

| Parameter           | Type              | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------- | ----------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientKey`         | `String`          |     ✅    | Client API key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `task.type`         | `String`          |     ✅    | Captcha service class name (`ShopeeSliderWebTask`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `task.typeCaptcha`  | `String`          |     ✅    | Captcha type, value: `rotate`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `task.imageBase64s` | `Array of String` |     ✅    | Array of 2 base64 strings: **\[mask image, background image]** <br /><br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/shopee-slider-rotate-mask.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=1d0e059360a8eef8db0ae472f1f50afa" style={{ maxWidth: "90px", width: "100%" }} width="44" height="44" data-path="images/shopee-slider-rotate-mask.png" /> <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/shopee-slider-rotate-background.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=1c23bb4741339deaf921e87785b7a6aa" style={{ maxWidth: "260px", width: "100%" }} width="280" height="150" data-path="images/shopee-slider-rotate-background.png" /> |

### Code samples

<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": "ShopeeSliderWebTask",
        "typeCaptcha": "rotate",
        "imageBase64s": [
          "BASE64_MASK_BODY_HERE",
          "BASE64_BACKGROUND_BODY_HERE"
        ]
      }
    }'
  ```

  ```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: 'ShopeeSliderWebTask',
      typeCaptcha: 'rotate',
      imageBase64s: [
        'BASE64_MASK_BODY_HERE',
        'BASE64_BACKGROUND_BODY_HERE',
      ],
    },
  });

  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': 'ShopeeSliderWebTask',
          'typeCaptcha': 'rotate',
          'imageBase64s': [
              'BASE64_MASK_BODY_HERE',
              'BASE64_BACKGROUND_BODY_HERE',
          ],
      },
  })

  print(resp.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_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
      'clientKey' => 'OMO_API_KEY',
      'task' => [
          'type' => 'ShopeeSliderWebTask',
          'typeCaptcha' => 'rotate',
          'imageBase64s' => [
              'BASE64_MASK_BODY_HERE',
              'BASE64_BACKGROUND_BODY_HERE',
          ],
      ],
  ]));

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

### Response

**Success:**

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

**Failure:**

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

The server returns `errorId = 1` and the corresponding `errorCode`. See the [Error codes](/en/api/error-codes) list.

## 2a. Get task result — Regular slider

### Request

`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": {
    "end": {
      "x": 150,
      "y": 42
    }
  }
}
```

| Field            | Type   | Description                                       |
| ---------------- | ------ | ------------------------------------------------- |
| `solution.end.x` | Number | **X** coordinate to drag the puzzle piece to (px) |
| `solution.end.y` | Number | **Y** coordinate to drag the puzzle piece to (px) |

## 2b. Get task result — Undetermined trajectory

### Request

`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": {
    "point": {
      "x": 153,
      "y": 78
    }
  }
}
```

| Field              | Type   | Description                                              |
| ------------------ | ------ | -------------------------------------------------------- |
| `solution.point.x` | Number | **X** target coordinate to move the puzzle piece to (px) |
| `solution.point.y` | Number | **Y** target coordinate to move the puzzle piece to (px) |

<Tip>
  Coordinates are in the pixel space of the uploaded background image. Combine the starting position of the puzzle piece with the returned coordinate to compute the path, then simulate the drag gesture (mousedown → mousemove → mouseup) along a natural trajectory.
</Tip>

**Processing:**

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

The server returns `errorId = 0` and `status = processing`. Wait **2 seconds** then retry.

**Failure:**

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

The server returns `errorId = 1`. See details at [Error codes](/en/api/error-codes).
