cvs: peardoc /en/package/webservices services-ebay.xml /en/package/webservices/services-ebay example.xml getting-started.xml intro.xml

From: Date: Mon, 22 Nov 2004 22:06:48 +0000
Subject: cvs: peardoc /en/package/webservices services-ebay.xml /en/package/webservices/services-ebay example.xml getting-started.xml intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5186@lists.php.net to get a copy of this message
schst Mon Nov 22 17:06:48 2004 EDT Added files: /peardoc/en/package/webservices services-ebay.xml /peardoc/en/package/webservices/services-ebay example.xml getting-started.xml intro.xml Log: initial commit of some introductory documentation for Services_Ebay (or better the eBay webservice)

http://cvs.php.net/co.php/peardoc/en/package/webservices/services-ebay.xml?r=1.1&p=1 Index: peardoc/en/package/webservices/services-ebay.xml +++ peardoc/en/package/webservices/services-ebay.xml <!-- $Revision: 1.1 $ --> <sect1 id="package.webservices.services-ebay"> <title>Services_Ebay</title> <para> Object-oriented abstraction for eBay's XML API. </para> &package.webservices.services-ebay.intro; &package.webservices.services-ebay.example; &package.webservices.services-ebay.getting-started; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=webservices fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/en/package/webservices/services-ebay/example.xml?r=1.1&p=1 Index: peardoc/en/package/webservices/services-ebay/example.xml +++ peardoc/en/package/webservices/services-ebay/example.xml <!-- $Revision: 1.1 $ --> <refentry id="package.webservices.services-ebay.example"> <refnamediv> <refname>Example</refname> <refpurpose>Basic example of Services_Ebay</refpurpose> </refnamediv> <refsect1 id="package.webservices.services-ebay.example.refsect1"> <title>Basic example of Services_Ebay</title> <simpara> The following examples show how to use some basic features of Services_Ebay: </simpara> <example> <title>Using a proxy object</title> <programlisting role="php"> <![CDATA[require_once 'Services/Ebay.php'; // pass some authentication data $session = Services_Ebay::getSession($devId, $appId, $certId); $session->setToken($token); // create new proxy object $ebay = new Services_Ebay($session); // call a method echo $ebay->GeteBayOfficialTime();]]> </programlisting> </example> <example> <title>Working directly with a Call object</title> <programlisting role="php"> <![CDATA[require_once 'Services/Ebay.php'; // pass some authentication data $session = Services_Ebay::getSession($devId, $appId, $certId); $session->setToken($token); $call = Services_Ebay::loadAPICall('GetEbayOfficialTime'); $result = $call->call($session); echo $result;]]> </programlisting> </example> <example> <title>Using the model classes</title> <programlisting role="php"> <![CDATA[require_once 'Services/Ebay.php'; // pass some authentication data $session = Services_Ebay::getSession($devId, $appId, $certId); $session->setToken($token); // get an eBay item $item = $ebay->GetItem(4501333179, 2); // The Seller property is an object as well echo 'User-Id of the seller: '.$item->Seller->UserId.'<br />'; // convert the item to an array echo '<pre>'; print_r($item->toArray()); echo '</pre>'; // Use methods of the model $item->AddToDescription('I forgot some important information'); // Change the item $item->Title = 'The new title of the item'; $ebay->ReviseItem($item); ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=webservices fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/en/package/webservices/services-ebay/getting-started.xml?r=1.1&p=1 Index: peardoc/en/package/webservices/services-ebay/getting-started.xml +++ peardoc/en/package/webservices/services-ebay/getting-started.xml <!-- $Revision: 1.1 $ --> <refentry id="package.webservices.services-ebay.getting-started"> <refnamediv> <refname>Getting started</refname> <refpurpose>Getting started with the eBay webservice</refpurpose> </refnamediv> <refsect1 id="package.webservices.services-ebay.getting-started.refsect1"> <title>Developing eBay applications</title> <para> The eBay webservice is of course not free to use by the public. To develop and test your applications, you will have to register as an eBay developer (which is free of charge). Furthermore, you will not be able to test and develop on the eBay site, before your application has been certified. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.getting-started.sandbox"> <title>The eBay sandbox</title> <para> The eBay Developers Program Sandbox is a test environment that represents a &quot;mini&quot; eBay site. The Sandbox provides the most important features of the eBay site, allowing you to build and test your application in a non-production environment. The eBay Sandbox supports both API testing as well as site testing via the GUI interface. </para> <para> While developing your application, you will always be using the eBay sandbox, which can be accessed via web at <ulink url="&url.ebay.sandbox;">&url.ebay.sandbox;</ulink>. This site looks and behaves like any eBay website you are being used to. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.getting-started.usingsandbox"> <title>Using the sandbox</title> <para> To develop applications in the sandbox you will have to register at the <ulink url="&url.ebay.developer;">eBay developers program</ulink>. To do this, follow these steps: </para> <orderedlist> <listitem> <simpara> Register as an eBay user: </simpara> <para> In order to register as an eBay developer, you'll have to be an eBay user. As eBay users are valid on all international sites, it is sufficient if you have an eBay user id for your local eBay site, like ebay.com or ebay.de. </para> </listitem> <listitem> <simpara> Register as an eBay developer: </simpara> <para> Next, you will have to register as an eBay developer at the <ulink url="&url.ebay.developer.join;">eBay developer program</ulink>. This procedure can take some time, as they require you to enter a lot of information, so you should do this carefully. If you are developing an open source application using Services_Ebay, you should apply for an Individual license. </para> <para> After the registration has been finisehd, you will recieve three keys that you will need to authenticate your eBay application: DevID, AppID and CertID. You will need these keys later so you should save them somewhere. </para> </listitem> <listitem> <simpara> Create one or more test users: </simpara> <para> As the sandbox does not share any data with the eBay sites, you will have to create new users that you can use to add items, make transactions and give feedback. You can create as many users as you need for testing purposes, just use the <ulink url="&url.ebay.sandbox.register;">registration form</ulink> in the sandbox. </para> <para> You will need a valid email address for each of your users, as well as a valid US address and telephone number, you can easily get on by using <ulink url="&url.yellowpages;">YellowPages</ulink>. A credit card is not required, your test users will receive money from eBay they can spend in the sandbox. Of course, this is no real money, which has not use outside of the sandbox. </para> </listitem> <listitem> <simpara> Validate your test users: </simpara> <para> If you want your test users to sell items on eBay, you will need to validate them. This can be done using the <function>ValidateTestUserRegistration</function> API call, which is already supported by Services_Ebay. </para> </listitem> </orderedlist> </refsect1> <refsect1 id="package.webservices.services-ebay.getting-started.auth"> <title>Authentication and Authorization</title> <para> eBay's Auth&amp;Auth process is quite complex and can be the biggest hurdle for getting started with the webservice. To make an API call the following information is required: </para> <para> <itemizedlist> <listitem> <para>DevID (received after registration, unique per developer)</para> </listitem> <listitem> <para>AppID (received after registration, unique per application)</para> </listitem> <listitem> <para>CertID (received after registration, unique per application)</para> </listitem> <listitem> <para>Authentication Token, unique for each user of your application</para> </listitem> </itemizedlist> </para> <para> While you already are in possession of the first three tokens, you still need the last one to make an API call. If your application is used by more than one user (which is the case for web applications), eBay does not want your application to receive the usernames and passwords of your users. If a user authenticates, your application is supposed to redirect him to the eBay login page and pass an additional parameter (a so called RuName). The user will then enter his login information as he is used to on the eBay website and then authorize your application to make API calls on his behalf. </para> <para> After that, eBay will redirect the user back to your application and pass a unique token, which can be used to identify this user when your application is making API calls. This technique has several advantages: </para> <para> <itemizedlist> <listitem> <para>Single sign-on system for eBay applications</para> </listitem> <listitem> <para>When your application is hacked, no passwords are revealed</para> </listitem> <listitem> <para>The user only sees the login screen he is used to.</para> </listitem> </itemizedlist> </para> <para> As this authentication procedure is quite complex and requires various API calls to function there is an easier way, which can be used for testing. eBay provides the so called <ulink url="url.ebay.developer.singleusertool;">Single-User-Tool</ulink>, an HTML-based tool, which creates tokens that you can use to authenticate a user. All you need to do is submit your DevID, AppID and CertID and select whether the token will be used in the sandbox or production environment. </para> </refsect1> <refsect1 id="package.webservices.services-ebay.getting-started.services-ebay"> <title>Getting started with Services_Ebay</title> <para> Services_Ebay provides a lot of examples, which demonstrate how the API calls have to be used. After installing Services_Ebay, they will be located in the docs/ directory of your PEAR installation. In order to run the examples, you will have to supply the authentication credentials you received from eBay. The easiest way to do this, is to modify the <filename>config.php</filename> file, which is located in the <filename>examples</filename> folder. </para> <example> <title>The configuration file</title> <programlisting role="php"> <![CDATA[// DevID, AppID and CertID $devId = 'HFGHSK7JKKJ82JKJFJHF84LKH86Z3JFF71KJKH'; $appId = 'IUENVCLJEGBN62JLKKLJHD34KKJL-GDJHDGJHD'; $certId = 'GHKL67JKDJLKJGFBNMBCHGDLÖWJH241KKHJKKJ'; // Username and password, only required by some calls // that set up the Auth&Auth mechanism $username = 'YourTestUser'; $password = 'Secret Pass'; // Token as returned from the Single-User-Tool $token = 'AgAAAA.......3jfiEQ**'; ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=webservices fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/en/package/webservices/services-ebay/intro.xml?r=1.1&p=1 Index: peardoc/en/package/webservices/services-ebay/intro.xml +++ peardoc/en/package/webservices/services-ebay/intro.xml <!-- $Revision: 1.1 $ --> <refentry id="package.webservices.services-ebay.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose>Introduction to Services_Ebay</refpurpose> </refnamediv> <refsect1 id="package.webservices.services-ebay.intro.refsect1"> <title>Introduction to Services_Ebay</title> <para> Services_Ebay is an object-oriented abstraction layer for eBay's XML API. In addition to a SOAP-service, eBay provides an API, that does not follow any standards except wrapping all webservice calls and parameters in XML. This webservice still is more powerful than eBay's SOAP server and in addition has been heavily tested by real-life applications. </para> <para> eBay's webservice enables you to use all of eBay's features (except bidding on items) in your own PHP applications. The features range from adding new items to managing the transaction, payment and shipping. Currently there are about 70 method calls available, all accept a range of parameters. </para> <para> Services_Ebay (as of version 0.7.0) already provides wrappers for 50 methods as well as some model classes which help you working with the results from the calls. </para> <para> To use this package you will need PHP5 with cURL support enabled and should be familiar with PHP5's exception handling. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=webservices fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#5186) next »