API + PHP + CURL not working anymore?!

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.
Post Reply
mt11
Newbie
Posts: 4
Joined: Fri Feb 12, 2016 1:53 pm

API + PHP + CURL not working anymore?!

Post by mt11 » Mon May 31, 2021 4:13 pm

The last 5 days our simpel API script is not working anymore and it is returning 301 error messages, nothing changed here

I am at a loss as I do not know why this is happing

Any help is VERY welcome!

code:

function api_adfly( $url ) {
$apiURL = 'http://api.adf.ly/api.php?';

$query = array(
'key' => 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk',
'uid' => 'uuuuuu',
'advert_type' => 'int',
'domain' => 'adf.ly'
);

$apiURL = $apiURL . http_build_query( $query ) . '&url=' . $url;

$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $apiURL );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );

$data = curl_exec( $ch );
curl_close( $ch );

return $data;
}

SupportAdFly
Senior Member
Posts: 320
Joined: Tue Aug 21, 2018 1:03 pm

Re: API + PHP + CURL not working anymore?!

Post by SupportAdFly » Tue Jun 01, 2021 8:48 am

mt11 wrote:
Mon May 31, 2021 4:13 pm
The last 5 days our simpel API script is not working anymore and it is returning 301 error messages, nothing changed here

I am at a loss as I do not know why this is happing

Any help is VERY welcome!

code:

function api_adfly( $url ) {
$apiURL = 'http://api.adf.ly/api.php?';

$query = array(
'key' => 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk',
'uid' => 'uuuuuu',
'advert_type' => 'int',
'domain' => 'adf.ly'
);

$apiURL = $apiURL . http_build_query( $query ) . '&url=' . $url;

$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $apiURL );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );

$data = curl_exec( $ch );
curl_close( $ch );

return $data;
}
Hi,

For technical issues, you could contact the support team, so they could look at your site.

Post Reply