---
type: how-to
title: Ejemplos de integración de backend
summary: La llamada /siteverify en Node, Python, PHP, Go, Ruby, .NET y curl. No hay SDK que instalar.
---

[La integración del lado del servidor](/docs/integration-guides/verify-on-your-backend) es un POST de JSON plano, así que no hay un SDK de primera parte en ningún lenguaje: usa el cliente HTTP que tu backend ya tenga. Cada ejemplo de abajo envía tu secreto y el token del formulario, luego lee `success` de la respuesta. Todos asumen que el secreto está en una variable de entorno, nunca en código.

## Node (`fetch`, integrado desde la 18)

```javascript
const res = await fetch("https://verify.caputchin.com/v1/siteverify", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ secret: process.env.CAPUTCHIN_SECRET, response: token }),
});
const result = await res.json();
if (!result.success) throw new Error("verification failed");
```

## Python (`requests`)

```python
import os, requests

res = requests.post(
    "https://verify.caputchin.com/v1/siteverify",
    json={"secret": os.environ["CAPUTCHIN_SECRET"], "response": token},
    timeout=10,
)
res.raise_for_status()
if not res.json()["success"]:
    raise RuntimeError("verification failed")
```

## PHP (cURL)

```php
$ch = curl_init("https://verify.caputchin.com/v1/siteverify");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
    CURLOPT_POSTFIELDS => json_encode([
        "secret" => getenv("CAPUTCHIN_SECRET"),
        "response" => $token,
    ]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$result["success"]) throw new Exception("verification failed");
```

## Go (`net/http`)

```go
body, _ := json.Marshal(map[string]string{
    "secret":   os.Getenv("CAPUTCHIN_SECRET"),
    "response": token,
})
res, err := http.Post("https://verify.caputchin.com/v1/siteverify", "application/json", bytes.NewReader(body))
if err != nil {
    return err
}
defer res.Body.Close()
var result struct {
    Success bool `json:"success"`
}
json.NewDecoder(res.Body).Decode(&result)
if !result.Success {
    return fmt.Errorf("verification failed")
}
```

## Ruby (`Net::HTTP`)

```ruby
require "net/http"
require "json"

uri = URI("https://verify.caputchin.com/v1/siteverify")
res = Net::HTTP.post(
  uri,
  { secret: ENV["CAPUTCHIN_SECRET"], response: token }.to_json,
  "Content-Type" => "application/json",
)
raise "verification failed" unless JSON.parse(res.body)["success"]
```

## .NET (`HttpClient`)

```csharp
using var http = new HttpClient();
var payload = JsonSerializer.Serialize(new {
    secret = Environment.GetEnvironmentVariable("CAPUTCHIN_SECRET"),
    response = token,
});
var res = await http.PostAsync(
    "https://verify.caputchin.com/v1/siteverify",
    new StringContent(payload, Encoding.UTF8, "application/json"));
var result = JsonSerializer.Deserialize<JsonElement>(await res.Content.ReadAsStringAsync());
if (!result.GetProperty("success").GetBoolean()) throw new Exception("verification failed");
```

## curl (para una prueba rápida)

```bash
curl -sS https://verify.caputchin.com/v1/siteverify \
  -H "Content-Type: application/json" \
  -d "{\"secret\":\"$CAPUTCHIN_SECRET\",\"response\":\"$TOKEN\"}"
```

## Un cliente tipado

Si prefieres trabajar con un cliente tipado, apunta un generador de OpenAPI a la [referencia de la API de Runtime](/docs/api-reference#runtime); `/siteverify` vive en la spec de runtime, no en la de gestión. El contrato es pequeño, así que la salida generada es corta.

## Véase también

- [Integración del lado del servidor](/docs/integration-guides/verify-on-your-backend) para la forma de la respuesta y las reglas.
