I looked at a lot of examples in PHP codes on this site, BUT they continue to use different methods every time, and it's not easy at all! I downloaded the ebaySession.php and keys.php files. I successfully integrated the ebaysession class and made contact with ebay. But how to use the sendHttpRequest () method confuses me. There is no explanation of how to get user account information.
Many tutorials also show that the constructor for the eBaySession class has a request token as the last parameter, while my file has a user token as the first parameter. There are many inconsistencies with the eBay API documentation. I have a test user account with a token in place ...
I also don't understand why the eBaySession constructor requires a UserToken & callname when in the ebay examples the call name and usertoken were included in the XML string ...
A SIMPLE question to which I do not see a clear answer in eBay docs: how can I make a simple call and then get the results / answer in a variable? I achieved this with a simple search query, but I canβt get it to work when user information and authentication are required ... ALSO the search example that eBay had was using a request like URL, for example
// Construct the findItemsByKeywords HTTP GET call $apicall = "$endpoint?"; $apicall .= "OPERATION-NAME=findItemsByKeywords"; $apicall .= "&SERVICE-VERSION=$version"; $apicall .= "&SECURITY-APPNAME=$appid"; $apicall .= "&GLOBAL-ID=$globalid"; $apicall .= "&keywords=$safequery";
Then another example uses:
///Build the request Xml string $requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>'; $requestXmlBody .= '<FetchTokenRequest xmlns="urn:ebay:apis:eBLBaseComponents">'; $requestXmlBody .= "<SessionID>$theID</SessionID>"; $requestXmlBody .= '</FetchTokenRequest>';
This XML code has been placed in the sendHttpRequest () method. What for? there was another example that did the same thing where authToken was inside XML, but authToken was defined in the constructor of the class ...
Any general advice on using the PHP eBay API will be greatly appreciated.
source share