# Image

{% hint style="info" %}
Hướng dẫn giải captcha ảnh bằng api capsieure
{% endhint %}

### Import

## Create task

<mark style="color:green;">`POST`</mark> `/createTask`

```
endpoint: https://api.capsieure.com/createTask
```

Tạo Task mới

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

```
{
  "clientKey": "67b6bcbb1a728ea8d563de6d169a2057",
  "task": {
    "type": "ImageToTextTask",
    "body": "BASE64_BODY",
    ""
  }
}
```

| Name       | Type   | Description                                            |
| ---------- | ------ | ------------------------------------------------------ |
| clientKey  | string | api key lấy [tại đây](https://capsieure.com/thong-tin) |
| type       | string | default: RecaptchaV3TaskProxyless                      |
| body       | string | base64 của ảnh captcha                                 |
| pageAction | string | hành động của bạn trên web này mặc định "verify"       |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "errorId": 0,
  "taskId": 7654321
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "errorId": 1,
  "message": "Lỗi ở đây"
}
```

{% endtab %}
{% endtabs %}

## Getting result

<mark style="color:green;">`POST`</mark> `/getTaskResult`

```
endpoint: https://api.capsieure.com/getTaskResult
```

Lấy kết quả

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |

**Body**

```
{
  "clientKey": "67b6bcbb1a728ea8d563de6d169a2057",
  "taskId": 7654321
}
```

| Name        | Type   | Description                                            |
| ----------- | ------ | ------------------------------------------------------ |
| `clientKey` | string | api key lấy [tại đâ](https://capsieure.com/thong-tin)y |
| taskId      | number | là kết quả trả về của createTask bên trên              |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "gRecaptchaResponse": "3AHJ_VuvYIBNBW5yyv0zRYJ7......."
  }
}

hoặc đang tiến trình

{
  "errorId": 0,
  "status": "processing"
}
```

{% endtab %}
{% endtabs %}
