ThirdPartyAPI

Coding php ThirdPartyAPI
hitpath API: Read Affiliates Record
May 15, 2023
0
, ,
<?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; ?>
Coding php ThirdPartyAPI
hitpath API: Read Campaigns Record
May 15, 2023
0
, ,
<?php $offset = 0; $limit = 10; $url = "http://api.1318amethyst.com/api/v1.1/campaigns?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 = 'h2.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; ?>
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; ?>