Help with API in PHP

Talk about scripts, analytics, API, software, and shrinkers here.
Forum rules
WARNING: Tools in this forum are being supported or maintained by the original author and not Adf.ly Staff. Proceed at your own risk.
nadal28
Newbie
Posts: 5
Joined: Mon Jun 20, 2016 7:29 pm

Help with API in PHP

Postby nadal28 » Mon Jun 20, 2016 7:42 pm

Hello,
Im having troubles with the method /v1/getPopadStats

This method requires HMAC authentication, I followed the guide steps and here is my code

Code: Select all

<?php

$tiempo = time();

$parametros = array(
   '_user_id' => '***',
   '_api_key' => '***',
   '_timestamp' => $tiempo,
   'start' => '2015-06-01'
   );

ksort($parametros);

$hash = hash_hmac('sha256', http_build_query($parametros), '***'); //The third parameter is my secret key

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.adf.ly/api.php?_api_key=***&_user_id=***&_timestamp='.$tiempo.'&start=2015-06-01&_hash='.$hash);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0 );

var_dump(curl_exec($ch));
curl_close($ch);

?>


It returns nothing, can you help me?

Thanks

Salzuela
Newbie
Posts: 1
Joined: Sun Mar 05, 2017 12:15 am

Re: Help with API in PHP

Postby Salzuela » Mon Mar 06, 2017 10:10 pm

I have the same problem with the API.
I use the example.php. With the getPublisherStats, all is right, but with the getPopadStats (and other procedures in the example.php), i have nothing.


Return to “Tools”

Who is online

Users browsing this forum: No registered users and 5 guests