Anura Docs

Script Integration - Result

Anura Script result values may be obtained by calling the endpoint directly.

Method URL Note
GET, POST https://script.anura.io/result.json HTTPS recommended

Example Request

PHP
<?php // FOR DEMONSTRATION PURPOSES ONLY!
// declare an array of request parameters
$params = array();
$params["instance"] = yourAssignedInstanceId;
$params["id"] = $_POST["responseId"];
// declare curl options
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://script.anura.io/result.json?".http_build_query($params));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// execute and decode the returned json string
$response = json_decode(curl_exec($curl));
// output the redirection url based on the returned result value
echo isset($response->result) && $response->result === "good" ? "https://anura.io/protected-resource": "https://anura.io/not-found";
?>

The PHP example above completes our demonstration, using the POSTed response ID and performing a cURL request to the Result endpoint. If the returned result value is found to be GOOD the user will be redirected to a protected resource. Whereas, if the user is WARN or BAD, they will be redirected to a page that is not found.

Parameters

Required Type Description Note
instance integer Your instance ID.
id string The response ID that is used to request the result value from Anura's servers.
Optional Type Description Note
exid string The unique external tracking ID, declared by you, that is used to query the result from Anura's servers. Send "exid" instead of "id" when using the exid parameter.

Depending on your integration, multiple queries to the result endpoint may be required. We find this to be an acceptable practice within reason.

Response ID results will be available for 15 minutes and are removed immediately after a successful result query.

Example Response

{
    "result": "bad",
    "mobile": 1,
    "adblocker": 0,
    "rule_sets": [
        "UE",
        "SP"
    ],
    "invalid_traffic_type": "SIVT"
}

Result Values

Result Description
good The visitor has passed our tests and appears to be trustworthy.
warn There are aspects about the visitor that raise concerns. However, we cannot say for certain they are bad. It is your decision how to interpret this value.
bad The visitor has failed our testing and should be considered untrustworthy.

Refer to our script result definitions documentation for more information on these values.

Rule Set Values

Result Description
DI Data Integrity
UE User Environment
DC Data Center
TO Traffic Origin
IP IP Integrity
SP Spoofing
WC Web Crawler

The "rule_sets" array requires "return rule sets" to be enabled. Talk to support about enabling or disabling the return rule sets feature.

The "invalid_traffic_type" string requires "return invalid traffic type" to be enabled. Talk to support about enabling or disabling the return invalid traffic type feature.

Refer to our rule set definitions documentation for more information on these values.