<?php
$offset = 0;
$limit = 10;
$url = "http://api.1318amethyst.com/api/v1.1/affiliates?all_details=1&offset=$offset&limit=$limit";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"auth_token:6d4888962feba3c669176b81edacb185",
"accept:application/json",
));
$raw_response = curl_exec($ch);
$response = json_decode($raw_response);
$error = curl_error($ch);
$tmp_file = 'h3.txt';
if ($error) {
$response->error = curl_error($ch);
} else {
file_put_contents($tmp_file, $raw_response);
//$this->file_transfer->send_file($tmp_file, $tmp_file);
}
curl_close($ch);
echo $raw_response;
?>
There are 0 comments