CAPTCHA type

{
    "id": "aeiHw3M8GCf6JpVUM0Sx2NAJLNWorMi1dL2ovA5eQ4A2YfXAOSVG9y2QRKFTYHKyv",
    "type": "PATH",
    "displayInformation": {
        "caption": "Use the arrow keys to move the square along the path",
        "obType": 31,
        "startPosition": 0,
        "squareColor": "ff0000",
        "resetText": "Start over",
        "width": 300
    }
}

Attributes

displayInformationobject

A JSON object that instructs the client JavaScript on how to initialize the CAPTCHA. It should simply be passed from the server output to the CAPTCHA initialization. For CAPTCHAs that don't use JavaScript, the "caption" field can be used to display instructions for solving the CAPTCHA.

idstring

A unique identifier for the CAPTCHA.

typestring

A string representing the CAPTCHA type

Options:
  • "PATH"
  • "SPLIT"
  • "SPOTTER"
  • "MATH"
  • "SUBSTRING"
  • "BASIC"
  • "DATE"
  • "BATTLESHIP"

Create a CAPTCHA

POST/shibboleth/captchas

Parameters

Configuration options for the CAPTCHA.

ip_addressstring(optional)

Example: Create a Basic CAPTCHA

Request

curl "https://api.nettoolkit.com/v1/shibboleth/captchas" \
-H "X-NTK-KEY: $YOUR_KEY_HERE" \
-d options="{ 'type': 'BASIC' }"

Response

{
    "code": 1000,
    "results": [
        {
            "id": "aUSzvy2BiUz9FLTClhiwbxwlfsKQ6R8cpwclvf7AzXr7lxCEv68fC9LVcKuK5_MGU",
            "type": "BASIC",
            "displayInformation": {
                "caption": "Type all of the characters",
                "obType": 30
            }
        }
    ]
}

Verify a CAPTCHA attempt

POST/shibboleth/captchas/:id/verification

Example: Verify a Basic CAPTCHA attempt

Request

curl "https://api.nettoolkit.com/v1/shibboleth/captchas/aUSzvy2BiUz9FLTClhiwbxwlfsKQ6R8cpwclvf7AzXr7lxCEv68fC9LVcKuK5_MGU/verification" \
-H "X-NTK-KEY: $YOUR_KEY_HERE" \
-d submitted_key=D4y8Yf

Response

{
    "code": 1000,
    "query": {
        "submitted_key": "D4y8Yf"
    },
    "results": [
        {
            "pass": true
        }
    ]
}

Other types

BasicOptions

{
    type: "BASIC",
    includeLineBackground: true,
    backgroundColors: ["74cf7e", "e3c3bc", "89b0d6", "5e0808" ]
}

Attributes

typestring(required)
always value: "BASIC"
backgroundColorsarray of a hex color string(optional)
default value: ["fafafa"]

a set of colors eligible to be the background color of the CAPTCHA

includeLineBackgroundboolean(optional)

if true, the CAPTCHA will have a background of colorful lines

lineColorsarray of a hex color string(optional)
default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]

a set of colors eligible to be the in the line background of the CAPTCHA

maxAttemptsnumber(optional)
default value: 5

the maximum number of attempts that can be made on a CAPTCHA

sizestring(optional)
default value: "medium"

size of the CAPTCHA ("small", "medium" or "large")

textColorsarray of a hex color string(optional)
default value: ["9b1111"]

a set of colors eligible to be the text color of the CAPTCHA

validCharactersarray of characters
default value: default: ['a', 'b', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'n', 'r', 't', 'y', 'A', 'B', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'N', 'Q', 'R', 'T', 'Y', '3', '4', '6', '7', '8']

a set of characters eligible to be included in the CAPTCHA

DateOptions

{
    type: "DATE",
    maxAttempts: 3
}

Attributes

typestring(required)
always value: "DATE"
backgroundColorsarray of a hex color string(optional)
default value: ["fafafa"]

a set of colors eligible to be the background color of the CAPTCHA

maxAttemptsnumber(optional)
default value: 5

the maximum number of attempts that can be made on a CAPTCHA

sizestring(optional)
default value: "medium"

size of the CAPTCHA ("small", "medium" or "large")

MathOptions

{
    type: "MATH",
    size: "small",
    includeLineBackground: true,
    lineColors: ["89b0d6", "5e0808", "9b1111", "2d5fc4", "e27909", "027a36", "424242"],
}

Attributes

typestring(required)
always value: "MATH"
backgroundColorsarray of a hex color string(optional)
default value: ["fafafa"]

a set of colors eligible to be the background color of the CAPTCHA

includeLineBackgroundboolean(optional)
default value: false

if true, the CAPTCHA will have a background of colorful lines

includeParenthesesboolean(optional)

if true, expressions with more than two terms will use parentheses

lineColorsarray of a hex color string(optional)
default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]

a set of colors eligible to be the in the line background of the CAPTCHA

maxAttemptsnumber(optional)
default value: 5

the maximum number of attempts that can be made on a CAPTCHA

sizestring(optional)
default value: "medium"

size of the CAPTCHA ("small", "medium" or "large")

textColorsarray of a hex color string(optional)
default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]

a set of colors eligible to be the text color of the CAPTCHA

PathOptions

{
    type: "PATH",
    squareColors: ["445566", "4eaebd", "7c007c"]
}

Attributes

typestring(required)
always value: "PATH"
backgroundColorsarray of a hex color string(optional)
default value: ["333333"]

a set of colors eligible to be the background color of the CAPTCHA

maxAttemptsnumber(optional)
default value: 5

the maximum number of attempts that can be made on a CAPTCHA

maxPathLengthnumber(optional)
default value: 15

maximum length for the path (must be greater than 2 and less than 21)

minPathLengthnumber(optional)
default value: 10

minimum length for the path (must be greater than 2 and less than 21)

pathColorsarray of a hex color string(optional)
default value: ["808080"]

a set of colors eligible to be the color of the path

resetTextstring(optional)
default value: "Start over"

the text to be displayed on the reset button

sizestring(optional)
default value: "medium"

size of the CAPTCHA ("small", "medium" or "large")

squareColorsarray of a hex color string(optional)
default value: ["ff0000"]

a set of colors eligible to be the color of the moveable square

SplitOptions

{
    type: "SPLIT",
    size: "small",
    maxAttempts: 7,
}

Attributes

typestring(required)
always value: "SPLIT"
backgroundColorsarray of a hex color string(optional)
default value: ["e5e5e5"]

a set of colors eligible to be the background color of the CAPTCHA

imageSetsarray of string(optional)
default value: ["pictures", "strings"]

which sets of images should be included (options are "pictures" or "strings")

maxAttemptsnumber(optional)
default value: 5

the maximum number of attempts that can be made on a CAPTCHA

resetTextstring(optional)
default value: "Start over"

the text to be displayed on the reset button

sizestring(optional)
default value: "medium"

size of the CAPTCHA ("small", "medium" or "large")

SpotterOptions

{
    type: "SPOTTER",
    size: "large",
    minKeyShapes: 5,
    maxKeyShapes: 8,
    keyShapes: ["circle", "square"],
}

Attributes

typestring(required)
always value: "SPOTTER"
backgroundColorsarray of a hex color string(optional)
default value: ["fafafa"]

a set of colors eligible to be the background color of the CAPTCHA

includeLineBackgroundboolean(optional)
default value: false

if true, the CAPTCHA will have a background of colorful lines

keyShapesarray of string(optional)
default value: ["circle", "star", "triangle", "square"]

which types of shapes are eligible to be the key shape (options are "circle", "star", "square" or "triangle")

lineColorsarray of a hex color string(optional)
default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]

a set of colors eligible to be the in the line background of the CAPTCHA

maxAttemptsnumber(optional)
default value: 5

the maximum number of attempts that can be made on a CAPTCHA

maxKeyShapesnumber(optional)
default value: 5

minimum number of key shapes to be included (must be greater than 0 and less than 21)

maxShapesnumber(optional)
default value: 15

minimum number of total shapes to be included (must be greater than 0 and less than 21)

minKeyShapesnumber(optional)
default value: 3

minimum number of key shapes to be included (must be greater than 0 and less than 21)

minShapesnumber(optional)
default value: 10

minimum number of total shapes to be included (must be greater than 0 and less than 21)

nonKeyShapesarray of string(optional)
default value: ["circle", "star", "triangle", "square"]

which types of shapes are eligible to be non-key shapes (options are "circle", "star", "square" or "triangle")

onlyIncludeKeyShapeboolean(optional)
default value: false

if true, only the key shape type will be included

resetTextstring(optional)
default value: "Start over"

the text to be displayed on the reset button

shapeColorsarray of a hex color string(optional)
default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]

a set of colors for the shapes

sizestring(optional)
default value: "medium"

size of the CAPTCHA ("small", "medium" or "large")

SubstringOptions

{
    type: "SUBSTRING",
    size: "medium",
    includeLineBackground: false,
    textColors: ["89b0d6", "5e0808", "9b1111", "2d5fc4", "e27909", "027a36", "424242"],
}

Attributes

typestring(required)
always value: "SUBSTRING"
backgroundColorsarray of a hex color string(optional)
default value: ["fafafa"]

a set of colors eligible to be the background color of the CAPTCHA

lineColorsarray of a hex color string(optional)
default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]

a set of colors eligible to be the in the line background of the CAPTCHA

maxAttemptsnumber(optional)
default value: 5

the maximum number of attempts that can be made on a CAPTCHA

sizestring(optional)
default value: "medium"

size of the CAPTCHA ("small", "medium" or "large")

textColorsarray of a hex color string(optional)
default value: ["9b1111"]

a set of colors eligible to be the text color of the CAPTCHA

includeLineBackgroundboolean
default value: false

if true, the CAPTCHA will have a background of colorful lines