TargetedOffers API
The Targeted Offers API is designed to simplify the process of your implementation(s).
Most offers in our network have Mobile Rules attached to them that are critical to know and follow to secure a high chance of converting the offer.
So, for example you have a website and you want to show targeted offers (meaning offers that are almost hanpicked for the user's device) to your users.
To achive that, you can make a POST call to the endpoint:
https://api.digitaltechnewyork.com/api/targetedOffers
with just 3 parameters:
- Your api key
- The User Agent
- The ip address
Example code in PHP:
$post_fields = array(
'api_key' => 'your_api_key',
'ip' => 'the user's IP address',
'ua' => 'the user's UA (User Agent)'
);
$url = 'https://api.digitaltechnewyork.com/api/targetedOffers';
$c = curl_init();
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $url);
//curl_setopt($c, CURLOPT_INTERFACE, $use_ip);
$content = curl_exec($c);
curl_close($c);
$usersOffers = json_decode($content, TRUE);
The offers you will receive, if any (it may be an empty json array if there are no offers for that settings) are offers specially selected for that user's device and ip address.