I have looked at many examples in PHP codes within there site BUT they keep using different techniques each time and is not straightforward at all!. I've downloaded the ebaySession.php and keys.php files. I have successfully integrated the ebaysession class and have made contact with ebay. But how to use the sendHttpRequest() method confuses me. There is no explanation to how to get a user account information.
Many tutorials also show that the constructor for the eBaySession class has the request token as the last parameter whereas my file has User token as the first parameter. There are many inconsistencies with the API documentation from eBay. I have a test user account with a token in place...
What I also don't understand is why eBaySession constructor requires the UserToken & callname when in ebay's example (s) the call name and usertoken was included in an XML string...
A SIMPLE question that I cannot see a clear answer within the eBay docs, How do I make a simple call then retrive the results / response in a variable? I have achieved this with a simple search query, but can't seem to get it working when it requires user information and authentication... ALSO the search example that eBay had uses a URL type query e.g.
// 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>';
That XML code was put in the sendHttpRequest() method. Why? there was another example that did the same which had a authToken inside the XML yet the authToken was defined within the class constructor...
Any general advice on using the eBay PHP API would be greatly appreciated.