Custom API FraudHunt
Custom API Flow
To enable access to our API send an email to info@fraudhunt.net from your registered email address.API Integration
The API is hosted on the server of your choosing, preferrably as close to your website server as possible.Minimum hardware requirements
CPU: DualCore
RAM: 4Gb
System: Linux CentOS
Server Settings
1. Install Redis.
2. Install Webdis .
3. Grant access to redis port 6379 from external IPs provided by FraudHunt.Script integration
The script is to be integrated into the head tag of your page
<script async>
src="https://dlqe6njq49pwj.cloudfront.net/fp/Scripts/ffp-aws.js" data-cid="yourcid">
</script>
Global callback integration
The callback function fpiCb: grabs the key once it is generated by the script. The function is activated the moment a key appears in the script.
< script>
var fhcnt = 0;
function send() {
fhcnt++;
var fpk = window.fppixel && fppixel.fpk;
if (fpk) {
handleFpKey(fpk);
} else {
__fpiGlobalVariables = {
__fpiCb: handleFpKey
}
if (fhcnt <= 20) {
setTimeout(send, 700);
}
}
return fpk;
}
send();
</script>
FPkey handle function
The handle function writes the FPkey in upper case and creates the API call. It can also be used to save the key on your server, etc.
< script>
function handleFpKey(fpKey) {
var apiHost = '//yourserveraddress/';
urlArgs = '?fpkey=' + fpKey;
var xhr = new XMLHttpRequest();
xhr.open("GET", apiHost + 'GET/' + 'yourcid'+ fpKey.toUpperCase(), true);
</script>
API call and response
The completed API call has the following format: http://yourserveraddress/GET/11111111BBBW507B2B6F83A88E5EC4BD0B9F37F7?type=json where 111111111 is the example of a datacid value. The API returns data in the json format and contains following information:
{
"fingerprintKey":
"httpInfo":
"refererUrl":
"originUrl":
"publicIp":
"location":
"user Agent":
"language":
"timezone":
"cookies":
"plugins":
"browser":
"broswerVersion":
"OS":
"deviceModel":
"screenInfo":
"triggers": true or false on chosen triggers
"fraudScore":
}