Direct Integration
Anura Direct is for fast, pre-bid analysis of traffic quality and is ideal for time-sensitive traffic analysis often associated with click and programmatic campaigns.
Direct Integration - Endpoint
Direct result values may be obtained by calling the endpoint directly.
Method | URL | Note |
---|---|---|
GET, POST | https://direct.anura.io/direct.json | HTTPS recommended |
Example Request
<?php // FOR DEMONSTRATION PURPOSES ONLY!
// declare an array of request parameters
$params = array();
$params["instance"] = yourAssignedInstanceId;
$params["source"] = "optionalSourceTrackingId";
$params["ip"] = "visitorIPAddress";
// declare curl options
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://direct.anura.io/direct.json?".http_build_query($params));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// execute and decode the returned json string
$direct = json_decode(curl_exec($curl));
// redirect based on the returned result value
header("Location: ".(isset($direct->result) && $direct->result === "non-suspect" ? "https://anura.io/protected-resource": "https://anura.io/not-found"));
?>
The PHP example above demonstrates a cURL request to the Direct endpoint, including a source value of 'optionalSourceTrackingId' and the visitor's IP address. If the returned result value is found to be NON-SUSPECT the user will be redirected to a protected resource. Whereas, if the user is SUSPECT they will be redirected to a page that is not found.
Parameters
Required | Type | Description | Note |
---|---|---|---|
instance | integer | Your instance ID. | |
ip | string | The IP address of your visitor. IPV6 addresses are also supported. |
Optional | Type | Description | Note |
---|---|---|---|
source | string | A variable, declared by you, to identify "source" traffic within Anura's dashboard interface. | |
campaign | string | A subset variable of "source," declared by you, to identify "campaign" traffic within Anura's dashboard interface. | |
ua | string | The user agent string of your visitor. | Do not modify the user agent string of your visitor. Modifications to the user agent string may cause adverse results. |
app | string | The application package identifier of your visitor (when available.) | Also referred to as: app ID, bundle ID, package name, etc. |
device | string | The device identifier of your visitor (when available.) | |
additional | string | An array of Additional Data declared as a JSON encoded string. | Read more about using Additional Data. |
Source and campaign parameters are limited to a maximum of 128 characters.
Source and campaign parameters may not equal the following values: "all sources", "all campaigns", "&", "*", "?", "%".
Security
Anura Direct offers an optional "Authorized IP Addresses" locking feature to protect against unauthorized use of your instance ID. Once enabled, requests will only be accepted from client authorized IP addresses. Talk to support for more information about the Anura Direct authorized IP addresses locking feature.
Example Response
{
"result": "suspect",
"mobile": null,
"rule_sets": [
"IP"
],
"invalid_traffic_type": "GIVT"
}
Result Values
Result | Description |
---|---|
suspect | Based on available data; we have determined the visitor to be suspect. |
non-suspect | Based on available data; we have determined the visitor to be non-suspect. |
Refer to our direct result definitions documentation for more information on these values.
Rule Set Values
Result | Description |
---|---|
UE | User Environment |
DC | Data Center |
IP | IP Integrity |
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.