# Captcha Validation

### `GET` Captcha HTML Form

This endpoint retrieves a CAPTCHA HTML form to verify the authenticity of a user attempting to access or interact with the system. CAPTCHA is used as a security measure to prevent automated bots from performing malicious activities. The HTML response includes the necessary fields and scripts for displaying and submitting the CAPTCHA form.

**Path:** `/users/captcha/`

**Authentication Required:** No

**Headers:**

```
Accept-Language: <iso_language_code>
Accept: application/json
```

**Example Request**

```py
import requests

headers = {
  'Accept-Language': '<iso_language_code>'
}

url = "https://{commerce_url}/users/captcha/"

response = requests.get(url)
print(response.json())
```

**Example Response (200 OK)**

```json
{
  "html": "<h1 class=\"auth__form__title\">\n	DEVAM ETMEK İÇİN\n  </h1>\n<form method=\"post\">\n	<input type='hidden' name='csrfmiddlewaretoken' value=<token> />\n	<div class=\"g-recaptcha\"  data-sitekey=\"\" id=\"id_captcha\" required></div>\n	<script type=\"text/javascript\" src=\"https://www.google.com/recaptcha/api.js\"></script>\n	<input type=\"submit\" value=\"Devam et\">\n</form>"
}
```

**Response Parameters**

| Property | Data Type | Description                                                                                               |
| -------- | --------- | --------------------------------------------------------------------------------------------------------- |
| html     | String    | Contains the CAPTCHA form as an HTML string, including the hidden CSRF token and Google reCAPTCHA widget. |

### `POST` Captcha Validation

This endpoint processes the CAPTCHA form submission to validate that the user is human. It verifies the Google reCAPTCHA response and the CSRF token, ensuring both are correct. Upon successful validation, the throttled IP is authorized to proceed with further actions.

**Path:** `/users/captcha/`

**Authentication Required:** No

**Headers:**

```
Content-Type: application/x-www-form-urlencoded
Accept-Language: <iso_language_code>
x-csrftoken: <token>
```

**Body Parameters**

| Property             | Data Type | Required | Description                                                        |
| -------------------- | --------- | -------- | ------------------------------------------------------------------ |
| csrfmiddlewaretoken  | string    | True     | The token included in the CAPTCHA form for CSRF protection.        |
| g-recaptcha-response | string    | True     | The response token provided by Google after verifying the CAPTCHA. |

**Request Body**

```json
{
	"csrfmiddlewaretoken": "<your csrfmiddlewaretoken>",
	"g-recaptcha-response": "<your recaptcha response>"
}
```

**Example Request**

```py
import requests

url = "https://www.converse.com.tr/users/captcha/"

payload = {
	"csrfmiddlewaretoken": "<your csrfmiddlewaretoken>",
	"g-recaptcha-response": "<your recaptcha response>"
}
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Accept-Language': '<iso_language_code>'
  'x-csrftoken': '<token>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

**Example Response (302 Found)**

A successful validation that redirects the user to the next step or process.

```json
{}
```

### `GET` Captcha HTML Form for Project Zero

This endpoint retrieves a CAPTCHA HTML form to verify the authenticity of a user attempting to access or interact with the system. CAPTCHA serves as a security measure to prevent automated bots from carrying out malicious activities. The HTML response includes the necessary fields and scripts for displaying and submitting the CAPTCHA form.

**Path:** `/users/pz-captcha/`

**Authentication Required:** No

**Headers:**

```
Accept-Language: <iso_language_code>
Accept: application/json
```

**Example Request**

```py
import requests

headers = {
  'Accept-Language': '<iso_language_code>'
}

url = "https://{commerce_url}/users/pz-captcha/"

response = requests.get(url)
print(response.json())
```

**Example Response (200 OK)**

```json
{
    "html": "<h1 class=\"auth__form__title\">\n    DEVAM ETMEK İÇİN\n  </h1>\n<form method=\"post\">\n    <input type='hidden' name='csrfmiddlewaretoken' value='ZpnY581oNXa1fLa8eE9yOIHB3aUhBXWjNDVyZElJh9kMB7b3QMsoNbxnr8hf2xJs' />\n    <div class=\"g-recaptcha\"  data-sitekey=\"\" id=\"id_captcha\" required></div>\n    <script type=\"text/javascript\" src=\"https://www.google.com/recaptcha/api.js\"></script>\n    <input type=\"submit\" value=\"Devam et\">\n</form>"
}
```

**Response Parameters:**

| Property | Data Type | Description                                                                                                        |
| -------- | --------- | ------------------------------------------------------------------------------------------------------------------ |
| html     | String    | Contains the CAPTCHA form as an HTML string, which includes the hidden CSRF token and the Google reCAPTCHA widget. |

### `POST` Captcha Validation for Project Zero

This endpoint processes the CAPTCHA form submission to validate that the user is human. It verifies both the Google reCAPTCHA response and the CSRF token to ensure they are correct. Upon successful validation, the throttled IP is authorized to proceed with further actions.

**Path:** `/users/pz-captcha/`

**Authentication Required:** No

**Headers:**

```
Content-Type: application/x-www-form-urlencoded
Accept-Language: <iso_language_code>
x-csrftoken: <token>
```

**Body Parameters**

| Property             | Data Type | Required | Description                                                        |
| -------------------- | --------- | -------- | ------------------------------------------------------------------ |
| csrfmiddlewaretoken  | string    | True     | The token included in the CAPTCHA form for CSRF protection.        |
| g-recaptcha-response | string    | True     | The response token provided by Google after verifying the CAPTCHA. |

**Request Body**

```json
{
	"csrfmiddlewaretoken": "<your csrfmiddlewaretoken>",
	"g-recaptcha-response": "<your recaptcha response>"
}
```

**Example Request**

```py
import requests

url = "https://www.converse.com.tr/users/pz-captcha/"

payload = {
	"csrfmiddlewaretoken": "<your csrfmiddlewaretoken>",
	"g-recaptcha-response": "<your recaptcha response>"
}
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Accept-Language': '<iso_language_code>'
  'x-csrftoken': '<token>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

**Example Response (302 Found)**

A successful validation that redirects the user to the next step or process.

```json
{}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/commerce/users/captcha-validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
