Reporting API

Report incorrect predictions to improve our system accuracy

Overview

The Reporting API allows you to report incorrect predictions from both text CAPTCHA and audio CAPTCHA solutions. By providing feedback, you help improve our system's accuracy. When a prediction is incorrect, you can submit the correct answer, which helps train our models to be more precise in the future.

This API is used for both text CAPTCHA and audio CAPTCHA prediction corrections.

Endpoint

POST
/api/report

Request

Headers

Name Required Description
Content-Type Yes application/json
x-api-key Yes Your API key

Body Parameters

Parameter Type Required Description
captchaGUID string Yes The unique identifier returned from a previous CAPTCHA or audio CAPTCHA solution
correction string No The correct value/text that should have been predicted

Example Request

{
  "captchaGUID": "7587c9c6-cf5f-4dc9-a382-a808a2d90dc8",
  "correction": "KWG90"
}

Response

Success Response (200 OK)

{
  "isSuccess": true,
  "statusCode": 200,
  "errorMessage": null,
  "data": true
}

Response Fields

Field Type Description
isSuccess boolean Indicates if the request was successful
statusCode number HTTP status code
errorMessage string Error message (null if successful)
data boolean True if the report was successfully submitted

Error Response

{
  "isSuccess": false,
  "statusCode": 404,
  "errorMessage": "CAPTCHA with the specified GUID not found.",
  "data": null
}

Error Codes

Status Code Message Description
400 Invalid request The request is malformed or missing required parameters
401 Unauthorized Invalid API key or not provided
404 CAPTCHA not found No CAPTCHA solution was found with the provided GUID
500 Internal server error Something went wrong on our end

Benefits of Reporting

Improved Accuracy

Your reports help train our models to become more accurate over time.

System Enhancement

Reports help us identify patterns in error cases and make systematic improvements.

Potential Refunds

Incorrect predictions may be eligible for credits or refunds depending on your plan.

Community Improvement

Your contributions benefit all users by making the service better for everyone.

Code Examples

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

public class ReportingExample
{
    private static readonly HttpClient client = new HttpClient();
    private const string ApiUrl = "/api/report";
    private const string ApiKey = "YOUR_API_KEY";

    public static async Task ReportIncorrectPrediction(string captchaGUID, string correction)
    {
        // Prepare request
        client.DefaultRequestHeaders.Add("x-api-key", ApiKey);

        var payload = new
        {
            captchaGUID = captchaGUID,
            correction = correction
        };

        var content = new StringContent(
            JsonConvert.SerializeObject(payload),
            Encoding.UTF8,
            "application/json"
        );

        // Send request
        var response = await client.PostAsync(ApiUrl, content);
        var responseString = await response.Content.ReadAsStringAsync();
        
        // Parse response
        dynamic result = JsonConvert.DeserializeObject(responseString);
        
        if (result.isSuccess)
        {
            return true;
        }
        else
        {
            throw new Exception($"Error: {result.errorMessage}");
        }
    }
}
import requests
import json

API_URL = "/api/report"
API_KEY = "YOUR_API_KEY"

def report_incorrect_prediction(captcha_guid, correction):
    # Prepare headers and payload
    headers = {
        "Content-Type": "application/json",
        "x-api-key": API_KEY
    }
    
    payload = {
        "captchaGUID": captcha_guid,
        "correction": correction
    }
    
    # Make request
    response = requests.post(API_URL, headers=headers, json=payload)
    result = response.json()
    
    if result["isSuccess"]:
        return True
    else:
        raise Exception(f"Error: {result['errorMessage']}")

# Example usage
try:
    captcha_guid = "7587c9c6-cf5f-4dc9-a382-a808a2d90dc8"
    correction = "KWG90"
    success = report_incorrect_prediction(captcha_guid, correction)
    print(f"Report submitted successfully: {success}")
except Exception as e:
    print(str(e))
// Reporting Example

async function reportIncorrectPrediction(captchaGUID, correction) {
  const API_URL = "/api/report";
  const API_KEY = "YOUR_API_KEY";
  
  // Prepare request
  const payload = {
    captchaGUID: captchaGUID,
    correction: correction
  };
  
  // Send request
  const response = await fetch(API_URL, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': API_KEY
    },
    body: JSON.stringify(payload)
  });
  
  const result = await response.json();
  
  if (result.isSuccess) {
    return true;
  } else {
    throw new Error(`Error: ${result.errorMessage}`);
  }
}

// Example usage
async function submitReport() {
  try {
    const captchaGUID = "7587c9c6-cf5f-4dc9-a382-a808a2d90dc8";
    const correction = "KWG90";
    
    const success = await reportIncorrectPrediction(captchaGUID, correction);
    console.log(`Report submitted successfully: ${success}`);
  } catch (error) {
    console.error(error.message);
  }
}