This question has been asked before, however the answers did not match the api im using.
Essentially the API i am using is split up into different functions just to get ALL domain names owned by 1 customer i selected. As the array is in soap and comes out in arrays im having to put them in loops. This makes it extremely slow with 400 results and having to loop through each individually with seperate queries 3 times or so. I am hoping i can run them in 1 instead of multiple queries however it seems far past my coding abilities.
//include the required files
require_once('includes/config.php');
require_once('classes/reseller_api.php');
//initialise the base reseller_api object
$reseller_api = new reseller_api();
//construct the request data
//send the request
$response = $reseller_api->call('GetDomainList', $request);
$decodedresponse = json_encode( $response, true );
$decoded_response = json_decode( $decodedresponse, true );
$loadeddata = $decoded_response['APIResponse']['DomainList'];
foreach ($loadeddata as $key => $value) {
$domainnameis = $value['DomainName'];
$domainnamestatus = $value['Status'];
$domainnameexpiry = $value['Expiry'];
$domainnameexpiry2 = date('d-m-Y',strtotime($domainnameexpiry));
?>
<tr>
<?php
/// GET THE DOMAIN NAME OWNER ID
$request2 = array(
'DomainName' => $value['DomainName']
);
$response2 = $reseller_api->call('DomainInfo', $request2);
if (isset($response2->APIResponse->DomainDetails)) {
$domainownerident = $response2->APIResponse->DomainDetails->RegistrantContactIdentifier;
/// NOW IF THE OWNER ID CAME BACK, GRAB THE NAME OF THE OWNER
$request3 = array(
'ContactIdentifier' => $domainownerident
);
$response3 = $reseller_api->call('ContactInfo', $request3);
/// NOW WE HAVE THE OWNER, SEE IF ITS OWNED BY HEAD OFFICE AND LAUNCH IT
if ($response3->APIResponse->ContactDetails->FirstName == "Reece") {
?>
<td <?php echo $domainbckstyle; ?>><?php echo $domainnameis; ?></td>
<td><?php echo $regback; ?></td>
<td <?php echo $domainbckstyle; ?>><?php echo $domainnameexpiry2; ?></td>
</tr>
<?php }}}} ?>
API Documentation here: http://docdro.id/jzpZNdv