Hi all new to php and this forum i have been looking around and im very impressed most questions get answered not like on some of the forums around.
Is there any one kind enough to help me out i have an api call via php and would like to output the results to owlcarousel where do i start with this.
Code i have is:
<?php
error_reporting(E_ALL); // Turn on all errors, warnings and notices for easier debugging
// API request variables
$endpoint = 'http://svcs.ebay.com/services/search/FindingService/v1'; // URL to call
$version = '1.0.0'; // API version supported by your application
$appid = 'YourAppID'; // Replace with your own AppID
$globalid = 'EBAY-GB'; // Global ID of the eBay site you want to search (e.g., EBAY-DE)
$query = 'tools'; // You may want to supply your own query
$safequery = urlencode($query); // Make the query URL-friendly
// Construct the findItemsByKeywords HTTP GET call
$apicall = "$endpoint?";
$apicall .= "OPERATION-NAME=findItemsIneBayStores";
$apicall .= "&SERVICE-VERSION=$version";
$apicall .= "&SECURITY-APPNAME=$appid";
$apicall .= "&GLOBAL-ID=$globalid";
$apicall .= "&keywords=$safequery";
$apicall .= "&storeName=yourstorename";
$apicall .= "&paginationInput.entriesPerPage=6";
$apicall .= "&paginationInput.pageNumber=1";
// Load the call and capture the document returned by eBay API
$resp = simplexml_load_file($apicall);
// Check to see if the request was successful, else print an error
if ($resp->ack == "Success") {
$results = '';
// If the response was loaded, parse it and build links
foreach ($resp->searchResult->item as $item) {
$pic = $item->galleryURL;
$link = $item->viewItemURL;
$title = $item->title;
$price = $item->currentPrice;
// For each SearchResultItem node, build a link and append it to $results
$results .= "<div id='item'><div class='img-wrap' align='center'><img src=\"$pic\" class='itemimg'></div> <div class='itemtxt' align='center'><a href=\"$link\">$title</a>$price</div></div>";
}
}
// If the response does not indicate 'Success,' print an error
else {
$results = "<h3>Oops! The request was not successful. Make sure you are using a valid ";
$results .= "AppID for the Production environment.</h3>";
}
?>
<html>
<head>
<body>
<table>
<tr>
<td>
<div id="result">
<?php echo $results;?>
</div>
</td>
</tr>
</table>
</body>
</html>
Im sure is pretty basic but being new to this i have no idea where to start,
any advice would be much appreciated.
thanks