Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

All captchas are valid in 5 minutes after requesting them.

Getting the captcha

Using captchas are currently free of usage. The API module is quite simple built: Requesting a captcha from /3.0/captcha/ will return a hash and an image url. You can also call for the captcha with /captcha/getCaptcha (works for APIv2 also).

...

Info
titleAdditional responses

By running /captcha/getCaptcha, your response will instead be something like below:

Code Block
languagejs
titlegetCaptchaResponse
collapsetrue
"response": {
        "getCaptchaResponse": {
            "imageUrl": "https:\/\/api.tornevall.net\/2.0\/captcha\/getImage\/hash\/f3d5f4f46bbf12cefda8398eb09d07e42b117245",
            "imageHash": "f3d5f4f46bbf12cefda8398eb09d07e42b117245"
        }
    }


Test the captcha string

Testing this string against the captchaApi is being made either through

...

Code Block
languagejs
titleMismatch Captcha
{
  "response": [],
  "errors": {
    "code": "401",
    "success": "",
    "faultstring": "Captcha test failed"
  }
}


Get the image for a specific hash

As the URLs above reveals, getImage() is used to show a generated captcha image. Using /getImage/<hashString> will give you the image. For the example below, you'll get "test", since hashes expires after 5 minutes and will not be available for viewing after this.

...