Server-Side Verification
After a user completes the captcha, verify the token on your server.
Request
HTTP
POST https://api.sloxly.com/v1/Captcha/verify.php Content-Type: application/x-www-form-urlencoded
Parameters
| Parameter | Required | Description |
|---|---|---|
secret | Yes | Your captcha secret key |
token | Yes | The token from the captcha widget |
Success Response
JSON — 200
{
"status": "success",
"message": "Captcha verified"
}Error Responses
| Error | Cause |
|---|---|
Invalid secret key | Secret key doesn't match any registered key |
Invalid, consumed, or expired token block | Token already used, expired, or tampered |
Missing required fields | secret or token not provided |
Each captcha token can only be verified once. Do not retry verification with the same token.
Complete PHP Example
PHP
function verifyCaptcha($token, $secretKey) { $ch = curl_init("https://api.sloxly.com/v1/Captcha/verify.php"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => http_build_query([ 'secret' => $secretKey, 'token' => $token, ]) ]); $resp = json_decode(curl_exec($ch), true); curl_close($ch); return ($resp['status'] ?? '') === 'success'; } // Usage in form handler if (!verifyCaptcha($_POST['sloxly_captcha_token'], 'YOUR_SECRET')) { die('Captcha verification failed'); }