> For the complete documentation index, see [llms.txt](https://docs.capsieure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.capsieure.com/getting-started/quickstart.md).

# Recaptcha V2

{% hint style="info" %}
Hướng dẫn giải recaptcha v2 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": "RecaptchaV2TaskProxyless",
    "websiteURL": "https://example.com/test",
    "websiteKey": "6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
    "isEnterprise" : false,
    "cheap": false
  }
}
```

| Name         | Type   | Description                                                     |
| ------------ | ------ | --------------------------------------------------------------- |
| `clientKey`  | string | api key lấy [tại đây](https://capsieure.com/thong-tin)          |
| `type`       | string | default: RecaptchaV2TaskProxyless                               |
| websiteURL   | string | url web chứa recaptcha                                          |
| websiteKey   | string | key của recaptcha                                               |
| isEnterprise | bool   | mặc định là false                                               |
| cheap        | bool   | mặc định false, nếu cheap bằng false sẽ là captcha tốc độ nhanh |

**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" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "errorId": 0,
  "status": "ready",
  "solution": {
    "gRecaptchaResponse": "answer"
  }
}

hoặc đang tiến trình

{
  "errorId": 0,
  "status": "processing"
}
</code></pre>

{% endtab %}

{% tab title="400" %}

```json
{
  "errorId": 1,
  "status": "Báo lỗi ở đây"
}
```

{% endtab %}
{% endtabs %}
