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)

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

default value: ["fafafa"]
includeLineBackgroundboolean(optional)

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

lineColorsarray of a hex color string(optional)

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

default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]
maxAttemptsnumber(optional)

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

default value: 5
sizestring(optional)

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

default value: "medium"
textColorsarray of a hex color string(optional)

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

default value: ["9b1111"]
validCharactersarray of characters

a set of characters eligible to be included in the CAPTCHA

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']

DateOptions

{
    type: "DATE",
    maxAttempts: 3
}

Attributes

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

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

default value: ["fafafa"]
maxAttemptsnumber(optional)

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

default value: 5
sizestring(optional)

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

default value: "medium"

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)

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

default value: ["fafafa"]
includeLineBackgroundboolean(optional)

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

default value: false
includeParenthesesboolean(optional)

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

lineColorsarray of a hex color string(optional)

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

default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]
maxAttemptsnumber(optional)

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

default value: 5
sizestring(optional)

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

default value: "medium"
textColorsarray of a hex color string(optional)

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

default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]

NavalCommandOptions

{
    type: "NAVAL_COMMAND",
    size: "large",
    backgroundColors: ["5e0808" , "445566"]
}

Attributes

typestring(required)
always value: "NAVAL_COMMAND"
backgroundColorsarray of a hex color string(optional)

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

default value: ["22347d"]
maxAttemptsnumber(optional)

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

default value: 5
sizestring(optional)

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

default value: "medium"

PathOptions

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

Attributes

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

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

default value: ["333333"]
maxAttemptsnumber(optional)

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

default value: 5
maxPathLengthnumber(optional)

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

default value: 15
minPathLengthnumber(optional)

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

default value: 10
pathColorsarray of a hex color string(optional)

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

default value: ["808080"]
resetTextstring(optional)

the text to be displayed on the reset button

default value: "Start over"
sizestring(optional)

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

default value: "medium"
squareColorsarray of a hex color string(optional)

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

default value: ["ff0000"]

SplitOptions

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

Attributes

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

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

default value: ["e5e5e5"]
imageSetsarray of string(optional)

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

default value: ["pictures", "strings"]
maxAttemptsnumber(optional)

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

default value: 5
resetTextstring(optional)

the text to be displayed on the reset button

default value: "Start over"
sizestring(optional)

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

default value: "medium"

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)

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

default value: ["fafafa"]
includeLineBackgroundboolean(optional)

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

default value: false
keyShapesarray of string(optional)

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

default value: ["circle", "star", "triangle", "square"]
lineColorsarray of a hex color string(optional)

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

default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]
maxAttemptsnumber(optional)

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

default value: 5
maxKeyShapesnumber(optional)

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

default value: 5
maxShapesnumber(optional)

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

default value: 15
minKeyShapesnumber(optional)

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

default value: 3
minShapesnumber(optional)

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

default value: 10
nonKeyShapesarray of string(optional)

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

default value: ["circle", "star", "triangle", "square"]
onlyIncludeKeyShapeboolean(optional)

if true, only the key shape type will be included

default value: false
resetTextstring(optional)

the text to be displayed on the reset button

default value: "Start over"
shapeColorsarray of a hex color string(optional)

a set of colors for the shapes

default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]
sizestring(optional)

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

default value: "medium"

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)

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

default value: ["fafafa"]
lineColorsarray of a hex color string(optional)

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

default value: ["9b1111", "2d5fc4", "e27909", "027a36", "424242", "35259b", "22730e"]
maxAttemptsnumber(optional)

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

default value: 5
sizestring(optional)

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

default value: "medium"
textColorsarray of a hex color string(optional)

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

default value: ["9b1111"]
includeLineBackgroundboolean

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

default value: false