Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Getting the captcha

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

The getCaptchaResponse looks like this:

"response": {
        "captchaResponse": {
            "imageUrl": "https:\/\/\/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:

Additional responses

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

"response": {
        "getCaptchaResponse": {
            "imageUrl": "https:\/\/\/2.0\/captcha\/getImage\/hash\/f3d5f4f46bbf12cefda8398eb09d07e42b117245",
            "imageHash": "f3d5f4f46bbf12cefda8398eb09d07e42b117245"

Test the captcha string

Testing this string against the captchaApi is being made either through (example):<imageHash>/response/q23lqctg or and the rest as POST-content or JSON.

In this case, the response of this query will be:

    "response": {
        "testCaptchaResponse": "1"

If the control instead fails, the response will throw back an exception with error code 2003: TAPI_PLUGIN_CAPTCHA_STRING_MISMATCH

Mismatch Captcha
    "response": {
        "responseString": ""
    "errors": {
        "success": "",
        "faultstring": "Captcha test failed",
        "action": "",
        "code": "2003"
    "api": {
        "endPoint": "captcha",
        "verb": "testCaptcha"
    "request": [],
    "client": []

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.

An alternative to this is to use /captcha/getImage/hash/<hashString>

Captcha Expiration

Each captcha expires after 5 minutes.

  • No labels