PRODUCT TEST WORKSPACE

Imperva Captcha

Captcha verification product

IMPERVA

01 / CREATE

Create task

The editor starts with required fields and one conditional branch. Optional fields are listed below and can be loaded into the editor.

02 / REQUEST

Request preview

POST /api/validator/create.cgi
{
  "productCode" : "IMPERVA",
  "adapter" : {
    "websiteURL" : "https://example.com/register",
    "incapsulaScriptUrl" : "/_Incapsula_Resource?SWJIYLWA=YOUR_CURRENT_SCRIPT_ID",
    "incapsulaCookies" : "incap_ses_YOUR_ID=YOUR_SESSION_VALUE; visid_incap_YOUR_ID=YOUR_VISITOR_VALUE",
    "proxyType" : "http",
    "proxyAddress" : "YOUR_PROXY_HOST",
    "proxyPort" : 8080
  }
}

03 / RESULT

Response example

EXAMPLE
Task ID —
{
  "code" : 0,
  "msg" : "Success",
  "data" : {
    "taskId" : "11111111-1111-4111-8111-111111111111",
    "productCode" : "IMPERVA",
    "state" : "SUCCEEDED",
    "solution" : {
      "domains" : {
        "https://site-example.com" : {
          "cookies" : {
            "___utmvc" : "EXAMPLE____UTMVC"
          }
        }
      }
    }
  }
}

Illustrative response; not a live task result. Replace all request placeholders before submitting.

Read data.solution after state becomes SUCCEEDED. The solution fields depend on the product; other states may return an empty object.

04 / API REFERENCE

Imperva Captcha · API

For task creation and queries, send the API key in the apiKey HTTP header. JSON request bodies contain business parameters only.

Content-Type: application/json
apiKey: YOUR_API_KEY

Request example

POST /api/validator/create.cgi · JSONC
{
  "productCode": "IMPERVA", // Product code matching the adapter parameters.
  "adapter": { // Product-specific parameter object.
    "websiteURL": "https://example.com/register", // Full URL of the actual Imperva-protected page. Collect the script and cookies from this same target session.
    "websiteKey": "YOUR_WEBSITEKEY", // Deprecated compatibility field, ignored for Imperva. A site key cannot replace the required script, cookies or proxy.
    "incapsulaScriptUrl": "/_Incapsula_Resource?SWJIYLWA=YOUR_CURRENT_SCRIPT_ID", // Fresh Incapsula script URL or path from the target page/network, including its query string; for example /_Incapsula_Resource?SWJIYLWA=... . Do not substitute a site key.
    "incapsulaCookies": "incap_ses_YOUR_ID=YOUR_SESSION_VALUE; visid_incap_YOUR_ID=YOUR_VISITOR_VALUE", // Cookie-header string from the same fresh target session, including its actual incap_ses_* and visid_incap_* values where issued. Preserve values; do not copy example cookies.
    "reese84UrlEndpoint": "YOUR_REESE84URLENDPOINT", // Optional actual Reese84 endpoint observed in target network requests, commonly ending in ?d=the-target-host. Omit when not present; do not invent it.
    "userAgent": "YOUR_BROWSER_USER_AGENT", // Actual User-Agent used to collect this session. Keep it consistent when applying the returned cookies, or use the returned User-Agent when supplied.
    "proxyType": "http", // Required upstream proxy protocol: http, socks4 or socks5. This Imperva integration has no documented proxyless mode.
    "proxyAddress": "YOUR_PROXY_HOST", // Reachable proxy hostname or IP, separate from its port and credentials. Use the same proxy egress for challenge collection, solving and subsequent target requests.
    "proxyPort": 8080, // Proxy TCP port, an integer from 1 to 65535; not a URL or a host:port string.
    "proxyLogin": "YOUR_PROXYLOGIN", // Username for the supplied proxy when authentication is required; not your Nex Captcha API key.
    "proxyPassword": "YOUR_PROXYPASSWORD" // Password for the supplied proxy when authentication is required. Preserve the original credential.
  }
}

Request headers: apiKey: YOUR_API_KEY

Comments explain the fields. Copy produces valid JSON without comments.

Response example

POST /api/validator/query.cgi · JSONC
{
  "code": 0, // Business result code: 0 means success; other values indicate an error.
  "msg": "Success", // Result message; may be empty on success.
  "data": { // Response data; may be null on an error.
    "taskId": "11111111-1111-4111-8111-111111111111", // Task ID returned by task creation.
    "productCode": "IMPERVA", // Product code matching the adapter parameters.
    "state": "SUCCEEDED", // Task state: CREATED, SUBMITTING, PROCESSING, SUCCEEDED, FAILED or EXPIRED.
    "solution": { // Product answer when SUCCEEDED; empty while processing or on failure.
      "domains": { // Verification results grouped by target domain.
        "https://site-example.com": { // Product-specific answer field; use it according to the target website verification protocol.
          "cookies": { // Verification cookies for the target domain.
            "___utmvc": "EXAMPLE____UTMVC" // Product-specific answer field; use it according to the target website verification protocol.
          }
        }
      }
    }
  }
}

Creating a task returns its ID and initial state. Query the result or use WebSocket to receive the completed answer shown below.

Request parameters

FieldTypeRequiredDescription
productCodestringYesProduct code matching the adapter parameters.
adapterobjectYesProduct-specific parameter object.
adapter.websiteURLstringYesFull URL of the actual Imperva-protected page. Collect the script and cookies from this same target session.
adapter.websiteKeystringNoDeprecated compatibility field, ignored for Imperva. A site key cannot replace the required script, cookies or proxy.
adapter.incapsulaScriptUrlstringYesFresh Incapsula script URL or path from the target page/network, including its query string; for example /_Incapsula_Resource?SWJIYLWA=... . Do not substitute a site key.
adapter.incapsulaCookiesstringYesCookie-header string from the same fresh target session, including its actual incap_ses_* and visid_incap_* values where issued. Preserve values; do not copy example cookies.
adapter.reese84UrlEndpointstringNoOptional actual Reese84 endpoint observed in target network requests, commonly ending in ?d=the-target-host. Omit when not present; do not invent it.
adapter.userAgentstringNoActual User-Agent used to collect this session. Keep it consistent when applying the returned cookies, or use the returned User-Agent when supplied.
adapter.proxyTypestringYesRequired upstream proxy protocol: http, socks4 or socks5. This Imperva integration has no documented proxyless mode.
adapter.proxyAddressstringYesReachable proxy hostname or IP, separate from its port and credentials. Use the same proxy egress for challenge collection, solving and subsequent target requests.
adapter.proxyPortintegerYesProxy TCP port, an integer from 1 to 65535; not a URL or a host:port string.
adapter.proxyLoginstringNoUsername for the supplied proxy when authentication is required; not your Nex Captcha API key.
adapter.proxyPasswordstringNoPassword for the supplied proxy when authentication is required. Preserve the original credential.

Response parameters

FieldTypeDescription
codeintegerBusiness result code: 0 means success; other values indicate an error.
msgstringResult message; may be empty on success.
dataobject | nullResponse data; may be null on an error.
data.taskIdstringTask ID returned by task creation.
data.productCodestringProduct code matching the adapter parameters.
data.statestringTask state: CREATED, SUBMITTING, PROCESSING, SUCCEEDED, FAILED or EXPIRED.
data.solutionobjectProduct answer when SUCCEEDED; empty while processing or on failure.
data.failureobject | omittedPublic diagnosis for FAILED/EXPIRED only; no raw provider messages. Follow the failure handling guide.
data.failure.codestringFailure code
data.failure.nextActionstringNext action
data.solution.domainsobjectVerification results grouped by target domain.
data.solution.domains.https://site-example.comobjectProduct-specific answer field; use it according to the target website verification protocol.
data.solution.domains.https://site-example.com.cookiesobjectVerification cookies for the target domain.
data.solution.domains.https://site-example.com.cookies.___utmvcstringProduct-specific answer field; use it according to the target website verification protocol.

Responses

HTTP business responses contain code, msg and data; code 0 means success. WebSocket uses a separate message structure.

-1317
Invalid API key.
-1100 / -1101
Invalid or missing request parameters.
-1401
Insufficient balance. Add funds before creating a task.
-1400 / -1001
System or task creation error.
API documentation