PHP APISimpleSearch eBay Developers Program http://developer.ebay.com Last updated: October 29, 2004 Written by: Madhu Gupta and Adam Trachtenberg (developer-relations@ebay.com) ------------------------------------------------------------ ################################################################################ # # eBay API Sample for PHP - eBaySimpleSearch # # Copyright © 1995-2004 eBay Inc. All Rights Reserved. ## ################################################################################ readme.txt for eBaySimpleSearch Overview -------------------------- eBaySimpleSearch for PHP is a sample implementation of the eBay XML API. This sample code is designed to guide developers in building applications using PHP, and is not supported as a production application. The key points demonstrated in this application are: 1. Generation of an XML document. 2. Generation of a valid HTTPS post to the eBay API Gateway 3. Parsing error and successful responses with a standard parser. eBaySimpleSearch consists of the following files :apiSession.php A class which manages the eBay Session. It is responsible for Generating the HTTPS post with eBay headers, and XML body, and returning the XML response to apiCallBase. :apiCallBase.php The base API class which handles all generic API logic. It generates the request XML, parses Errors from the XML response, and acts as a general handler for all API calls :apiCallGetSearchResults.php A child class extended from apiCallBase. It implements its own result processing logic to parse out the search results. :ebaySimpleSearch.phtml The HTML page front end to the application. Use this page to test the application. Setup Requirements: --------------------------- 1. Install PHP http://www.php.net/downloads.php Enable the curl and domxml extensions. 2. Install any web server that supports PHP. Apache can be dowloaded at http://httpd.apache.org/ Getting Started: --------------------------- 1 - eBaySimpleSearch consists of the following files -apiSession.php -apiCallBase.php -apiCallGetSearchResults.php -ebaySimpleSearch.phtml 2. Place all files in a directory accessible by your web server. With Apache, this is the htdocs directory. 3. Edit eBaySimpleSearch.php to specify your test userid and password with the following variables: $ebayToken 4. Edit apiSession.php to specify your developer keys for the following variables lines 64-66: $this->eBayDeveloper $this->eBayApplication $this->eBayCertificate 4. In your browser window, navigate to your web server directory where you have saved the files, and to eBaySimpleSearch.phtml. For example: http://localhost/PHPSamples/eBaySimpleList.phtml Other Notes: ---------------------------- This sample was built an tested on a Windows XP platform using PHP 4.3.9 for Win32 and Apache 1.3.31 for Windows. eBay API Developer Support and Evangelism October 2004 eBay, Inc. eBay Developer Program http://developer.ebay.com/