-3

This is the documentation for the API call for the Ebay API, but I can't seem to find an example of how to construct the URI... http://developer.ebay.com/Devzone/XML/docs/Reference/ebay/PlaceOffer.html also I was wondering if anybody has found anything like a stock brokers API or other online businesses.

This is the example URI ebay provides for searching for products, however the documentation isn't very straight forward on how the other URI's can be constructed with this basic layout

var url = "http://svcs.ebay.com/services/search/FindingService/v1"+
   "?OPERATION-NAME=findItemsByKeywords"+
   "&SERVICE-VERSION=1.0.0"+
   "&SECURITY-APPNAME=myKey"+
   "&GLOBAL-ID=EBAY-US"+
   "&RESPONSE-DATA-FORMAT=XML"+
   "&REST-PAYLOAD"+
   "&keywords=harry%20potter%20phoenix"+
   "&paginationInput.entriesPerPage=15";

If you do know of something, could you link me or perhaps share the URI?

leppie
  • 115,091
  • 17
  • 196
  • 297
Jacob Edward
  • 181
  • 1
  • 2
  • 10

1 Answers1

0

seems like you are mixing up the eBay API's... the example you posted is for the Finding API this API can be called by those simple URL's, nearly all other APIs are SOAP based, and require some special HEADER and XML post bodies...

the PlaceOffer Call belongs to the Trading API... i already prepared an example within another topic:

php api ebay integration

edit regarding comments:

you will need to POST a XML based request that will look somehow like this:

<soap:Envelope encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" mlns="urn:ebay:apis:eBLBaseComponents" xmlns:soap="http://schemas.xmlsoap.org soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Header>
       <RequesterCredentials>****</RequesterCredentials>
   </soap:Header>
   <soap:Body>
       <PlaceOfferRequest>
           <Version>899</Version>
           <Offer>
            <Action>Bid</Action>
               <ItemID>YOUR ITEM ID</ItemID>
               <MaxBid>YOUR MAX BID AMOUNT</MaxBid>
           </Offer>
       </PlaceOfferRequest>
   </soap:Body>

Response ( error since i used invalid max bid / item ids)

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
 <soapenv:Fault>
  <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Server</faultcode>
  <faultstring>Input data is invalid.</faultstring>
  <faultactor>http://www.ebay.com/ws/websvc/eBayAPI</faultactor>
  <detail>
   <FaultDetail>
    <ErrorCode>37</ErrorCode>
    <Severity>Error</Severity>
    <DetailedMessage>Input data for tag &lt;Offer.MaxBid&gt; is invalid or missing. Please check API documentation.</DetailedMessage>
   </FaultDetail>
  </detail>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>
Community
  • 1
  • 1
Thomas
  • 121
  • 5
  • Unfortunately I can't read PHP, but it seems like what I need to do is construct the proper XML and then convert it into a URI to make a call, is that correct? – Jacob Edward Dec 09 '14 at 23:41
  • if you follow the link to: https://ebay-sdk.intradesys.com/ebay_api_sdk_test_tool?load=d82c8d1619ad8176d665453cfb2e55f0 you can login with an ebay account and test the call itself. it will show you the XML post and response body that you need to construct. i have updated my answer – Thomas Dec 10 '14 at 11:46
  • Thanks, I found this between the last time I commented https://developer.ebay.com/DevZone/build-test/test-tool/default.aspx which provides the headers and the xml for each function. Now I just need to figure out how to encode the headers and the xml into a request, I'm using the Google Apps Script Server API environment (which uses an extended version of Javascript) for making the request. Have any idea? I know how to encode JSON to make a request, but I've never done Headers and XML for an API request... – Jacob Edward Dec 10 '14 at 20:32