Question

Anyone out there with experience with the Ebay API? I'm essentially trying to list all items for one shop on their website, so it's not going to be a public service usage. The GetSellerList method seems to be the way to go, but the documentation on the Ebay Website itself is very scant and not really well done at all.

http://developer.ebay.com/DevZone/XML/docs/reference/ebay/GetSellerList.html

I'm in the process of trying out the code samples and the problem I'm hitting now is whether or not I need a UserToken or not. #PITA

Thanks,

Was it helpful?

Solution

Here is about the minimum request I used that worked for me:

<?xml version="1.0" encoding="utf-8"?>
<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>--Enter your AuthToken here--</eBayAuthToken>
  </RequesterCredentials>
  <ErrorLanguage>en_US</ErrorLanguage>
  <WarningLevel>High</WarningLevel>
  <StartTimeFrom>2013-06-01T21:59:59.005Z</StartTimeFrom> 
  <StartTimeTo>2013-09-26T21:59:59.005Z</StartTimeTo>
  <EndTimeFrom>2013-09-26</EndTimeFrom>
  <EndTimeTo>2013-11-26</EndTimeTo>
  <GranularityLevel>Coarse</GranularityLevel>
  <UserID>--Enter your seller's name here--</UserID>
  <Pagination>
    <EntriesPerPage>200</EntriesPerPage>
    <PageNumber>1</PageNumber>
  </Pagination>
  <OutputSelector>ItemArray.Item.ItemID</OutputSelector>
  <OutputSelector>ItemArray.Item.Quantity</OutputSelector>
  <OutputSelector>ItemArray.Item.Title</OutputSelector>
  <OutputSelector>ItemArray.Item.PrimaryCategory.CategoryID</OutputSelector>
  <OutputSelector>ItemArray.Item.PrimaryCategory.CategoryName</OutputSelector>
</GetSellerListRequest>

I also had to add these headers to the request:

X-EBAY-API-APP-NAME             -- Add yours here --
X-EBAY-API-CALL-NAME            GetSellerList
X-EBAY-API-REQUEST-ENCODING     XML
X-EBAY-API-SITEID               0
X-EBAY-API-DEV-NAME             -- Add yours here --
X-EBAY-API-CERT-NAME            -- Add yours here --
X-EBAY-API-COMPATIBILITY-LEVEL  825

I'm not sure which of the "-- Add yours here --" entries are public and which are private, so I'll aire on the side of caution and I'll let you get them for yourself.. :-)

With no eBayAuthToken entered, you get the following error:

   <Errors>
      <ShortMessage>Auth token is invalid.</ShortMessage>
      <LongMessage>Validation of the authentication token in API request failed.</LongMessage>
      <ErrorCode>931</ErrorCode>
      <SeverityCode>Error</SeverityCode>
      <ErrorClassification>RequestError</ErrorClassification>
   </Errors>

I hope this helps.

OTHER TIPS

<?xml version="1.0" encoding="utf-8"?>
<GetSellerListRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>$authToken</eBayAuthToken>
  </RequesterCredentials>
  <ErrorLanguage>en_US</ErrorLanguage>
  <WarningLevel>High</WarningLevel>
  <StartTimeFrom>2015-01-01T00:00:00.005Z</StartTimeFrom> 
  <StartTimeTo>2015-03-31T23:59:59.005Z</StartTimeTo>
  <EndTimeFrom>2015-03-31T23:59:59.005Z</EndTimeFrom>
  <EndTimeTo>2015-05-31T23:59:59.005Z</EndTimeTo>
  <GranularityLevel>Coarse</GranularityLevel>
  <UserID>----testuser----</UserID>
  <Pagination>
    <EntriesPerPage>200</EntriesPerPage>
    <PageNumber>1</PageNumber>
  </Pagination>
  <OutputSelector>ItemArray.Item.ItemID</OutputSelector>
  <OutputSelector>ItemArray.Item.Quantity</OutputSelector>
  <OutputSelector>ItemArray.Item.Title</OutputSelector>
  <OutputSelector>ItemArray.Item.PrimaryCategory.CategoryID</OutputSelector>
  <OutputSelector>ItemArray.Item.PrimaryCategory.CategoryName</OutputSelector>
</GetSellerListRequest>

Header Request Values

$headers = array(
        'X-EBAY-API-SITEID:'.SITEID,
        'X-EBAY-API-CALL-NAME:GetSellerList',
        'X-EBAY-API-REQUEST-ENCODING:'.RESPONSE_ENCODING,
        'X-EBAY-API-COMPATIBILITY-LEVEL:' . API_COMPATIBILITY_LEVEL,
        'X-EBAY-API-DEV-NAME:' . API_DEV_NAME,
        'X-EBAY-API-APP-NAME:' . API_APP_NAME,
        'X-EBAY-API-CERT-NAME:' . API_CERT_NAME,
        'Content-Type: text/xml;charset=utf-8'
    );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top