Page tree

Versions Compared

Key

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

Table of Contents
typeflat

Getting the captcha

Using captchas are currently free of usage. The API module is quite simple built: Requesting a captcha from https://api.tornevall.net/2.0/captcha/ will return a hash and an image url. You can also call for the captcha with /captcha/getCaptcha.

...

Code Block
languagejs
titlecaptchaResponse
"response": {
        "captchaResponse": {
            "imageUrl": "https:\/\/api.tornevall.net\/2.0\/captcha\/getImage\/hash\/b437802a590d7fb50030eb5e4d3522ed61369f0c",
            "imageHash": "b437802a590d7fb50030eb5e4d3522ed61369f0c"
        }
    }
Response Parameter KeyResponse Parameter Value
imageUrlThe url of where you can find the captcha image
imageHashThe hash string that you use for matching the captcha string

Example of a captcha rendered by the captchaApi:

Image Added

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

...

Example of a captcha rendered by the captchaApi:

...

Testing this string against the captchaApi is being made either through (example): https://api.tornevall.net/2.0/captcha/testcaptcha/hash/<imageHash>/response/q23lqctg or https://api.tornevall.net/2.0/captcha/testcaptcha and the rest as POST-content or JSON.

...