Posts Tagged: advertisers

Coding ThirdPartyAPI
hitpath API: Read Advertisers Record
May 15, 2023
0
, ,
<?php $offset = 0; $limit = 10; $url = "http://api.1318amethyst.com/api/v1.1/advertisers?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:XXXXXXXXXXXXXXXX", "accept:application/json", )); $raw_response = curl_exec($ch); $response = json_decode($raw_response); $error = curl_error($ch); $tmp_file = 'h1.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; ?>