Last active 1726905831

CaptchaApiService.md Raw

Captcha API Service

Methods;

Generate Challenge

https://api.alveus.dev/captcha/v1/challenge

Generates a challenge and returns the answer symbol, the symbol name, and the captcha image as a base64 encoded jpeg image.

API Key

Api key can be provided in one of two ways;

URL Paramater: https://api.alveus.dev/captcha/v1/challenge?apiKey=xxxxx:xxxxx

Header: x-api-key=xxxxx:xxxxx

Successful Response:

{
  "success": true,
  "data": {
    "symbol": "<symbol>",
    "symbolName": "<name of symbol>",
    "generator": 1,
    "imageData": "data:image/jpeg;base64,...."
  }
}
  • success: A boolean of true when successful.
  • symbol: The symbol (i.e. emoji) that is the correct answer.
  • symbolName: The name of a symbol (i.e. "popcorn").
  • generator: The image generator version.
  • imageData: Base64 encoded image data.

Unsuccessful Response:

{
  "success": false,
  "error": "<error code>",
  "message": "<human error message>"
}
  • success: A boolean of false indicating that the request failed.
  • error: An error code (See below).
  • message: A humanised message describing the error.

Error codes:

  • unauthorized: The provided API key is invalid.
  • unknown_error: An unknown error has occured.