Compare input values

Prev Next

Available in Classic and VPC

Compare the value (string or number) of the CAPTCHA image entered by the user to the actual CAPTCHA value (string or number).

Request

The following describes the request format for the endpoint. The request format is as follows:

Method URI
GET /nkey

Request headers

For headers common to all CAPTCHA APIs, see Common CAPTCHA headers.

Request query parameters

The following describes the request query parameters.

Field Type Required Description
code Integer Optional Input value for comparing CAPTCHA keys
  • 0 | 1 (default)
key String Required Key value received from the Issue CAPTCHA key API call
value String Required User's input value for the CAPTCHA image

Request example

The following is a sample request.

curl --location --request GET 'https://naveropenapi.apigw.ntruss.com/captcha/v1/nkey?code=1&key={key}&value={value}' \
--header 'X-NCP-APIGW-API-KEY-ID: {Client ID issued when registering the app}' \
--header 'X-NCP-APIGW-API-KEY: {Client secret issued when registering the app}'

Response

The following describes the response format.

Response body

The following describes the response body.

Field Type Required Description
result Boolean - Whether the user's CAPTCHA input is correct
  • true | false
    • true: correct
    • false: incorrect
responseTime Double - Time taken to get the correct answer (second)
  • -1 - 7200
  • Represent up to 2 decimal places
    • <e.g.> 123.12

Response status codes

For response status codes common to all CAPTCHA APIs, see Common CAPTCHA response status codes.

Response example

The following is a sample example.

{
    "result": true,
    "responseTime": 22.9
}