skip to Main Content

I need to understand the big picture about how APIs work. For example, I can retreive a listing from ebay using a url like this:

http://open.api.ebay.com/Shopping?callname=GetCategoryInfo&appid=************************************&siteid=3&CategoryID=-1&version=729&IncludeSelector=ChildCategories

However much of the documentaion is about XML. I’ve never used XML before and I don’t understand the process of using it to get ebay info. I’m guessing I would use a langauge like PHP to make an XML request and get an XML response.

However, using urls seems a lot easier/less of alearning curve. So I’d like to know, is it possible to to everything that can be done via XML by using urls instead? (Both in general and specifically with ebay)

As a practical example, I want to get the details of a store for a particular user, like this:

http://open.api.ebay.com/Shopping?
callname=GetStore&appid=************************&siteid=3&UserID=yolandeyoo

The parameters may well be nonsense, but the only info I can find about GetStore in the docs talks about XML.

For example, a sample input is given as:

<?xml version="1.0" encoding="utf-8"?>
<GetStoreRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <!-- Call-specific Input Fields -->
  <CategoryStructureOnly> boolean </CategoryStructureOnly>
  <LevelLimit> int </LevelLimit>
  <RootCategoryID> long </RootCategoryID>
  <UserID> UserIDType (string) </UserID>
  <!-- Standard Input Fields -->
  <ErrorLanguage> string </ErrorLanguage>
  <MessageID> string </MessageID>
  <Version> string </Version>
  <WarningLevel> WarningLevelCodeType </WarningLevel>
</GetStoreRequest>

So, the short version of my question is: Can I call GetStore from the ebay API using a URL, or do I need to use XML please?

Also, please could someone give me the code, either as a url or as xml, to get the details of the store with userID of yolandeyoo?

3

Answers


  1. You already ARE using a URL to retrieve data from the eBay API. You built sample request URLs above.

    As for the response, if you don’t want XML, you can request your returned data in JSON format.

    Whether XML or JSON (or maybe SOAP), you need to use some programming language to retrieve and parse the results.

    Login or Signup to reply.
  2. URLs and XML are not either/or things.

    If you use contacting someone to get information as an analogy, using URLs is like deciding to use a phone to contact the person, while XML is equivalent to talking to them in English instead of some other language. You can’t ignore one to just use the other.

    I’d suggest spending some time researching both these components to get a better feel for what’s going on here

    Login or Signup to reply.
  3. Short answer is no, you can’t send just an URL.

    As stated in the API docs, this API developers decided to request a POST with an XML payload.

    The Trading API expects calls to use the HTTP POST call method.

    The HTTP POST call method supports the use of XML format requests. The XML request/response format follows standard XML syntax conventions. Please see w3schools.com XML Syntax Rules for more information.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search