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

# ZaloSliderPhoneTask

> Solve Zalo mobile slider drag-and-drop captcha

Drag-and-drop on mobile app is a common type of image verification.

<Frame>
  <img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/zalo-slider-phone-modal.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=8fa81a14670c47c29ca3db9206f213cc" style={{ maxWidth: "360px", width: "100%" }} width="1080" height="2220" data-path="images/zalo-slider-phone-modal.png" />
</Frame>

## 1. Create task

**Request**

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

| Parameter          | Type     | Required | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------ | -------- | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `clientKey`        | `String` |     ✅    | Client account API key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `task.type`        | `String` |     ✅    | Captcha service class name: `ZaloSliderPhoneTask`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `task.imageBase64` | `String` |     ✅    | Base64-encoded screenshot image <br /><br /><img src="https://mintcdn.com/omocaptcha/Jc1mwaiUF23R0W3R/images/zalo-slider-phone-modal.png?fit=max&auto=format&n=Jc1mwaiUF23R0W3R&q=85&s=8fa81a14670c47c29ca3db9206f213cc" style={{ maxWidth: "260px", width: "100%" }} width="1080" height="2220" data-path="images/zalo-slider-phone-modal.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": "ZaloSliderPhoneTask",
        "imageBase64": "BASE64_BODY_HERE"
      }
    }'
  ```

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

  const response = await axios.post('https://api.omocaptcha.com/v2/createTask', {
    clientKey: 'OMO_API_KEY',
    task: {
      type: 'ZaloSliderPhoneTask',
      imageBase64: 'BASE64_BODY_HERE'
    }
  });

  console.log(response.data);
  ```

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

  response = requests.post(
      'https://api.omocaptcha.com/v2/createTask',
      json={
          'clientKey': 'OMO_API_KEY',
          'task': {
              'type': 'ZaloSliderPhoneTask',
              'imageBase64': 'BASE64_BODY_HERE'
          }
      }
  )

  print(response.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' => 'ZaloSliderPhoneTask',
          'imageBase64' => 'BASE64_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 a `taskId` on success.

Failure:

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

The server returns `errorId = 1` with `errorCode` as the error code.

## 2. Get task 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": {
    "start": {
      "x": 100,
      "y": 250
    },
    "end": {
      "x": 300,
      "y": 250
    }
  }
}
```

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

| Field              | Type     | Description                                     |
| ------------------ | -------- | ----------------------------------------------- |
| `solution.start.x` | `Number` | X coordinate of drag start point (puzzle piece) |
| `solution.start.y` | `Number` | Y coordinate of drag start point (puzzle piece) |
| `solution.end.x`   | `Number` | X coordinate of drop point (target hole)        |
| `solution.end.y`   | `Number` | Y coordinate of drop point (target hole)        |

<Tip>
  Simulate touch gestures on the app: `touchstart` at `start` → `touchmove` along a natural trajectory to `end` → `touchend`. Avoid linear or overly fast movement to reduce the chance of being detected as a bot.
</Tip>

Processing:

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

The server returns `errorId = 0` and `status = processing` while the task is still being processed. 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` on failure.
