Ebay API for listing one seller's items - GetSellerList
Asked Answered
M

2

5

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,

Mis answered 17/12, 2013 at 12:20 Comment(1)
Hi Carl, How did you go with getting the seller items..?? Did you end up building a request/response class for this API..?? I'm just about to start building the classes for this one, I've used several of the other ebay api calls. If you still need help let me know and I'll see what I can do.Kerato
K
6

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.

Kerato answered 5/2, 2014 at 3:59 Comment(2)
Thanks. I managed to struggle through and get the API working with the .net control in the end, but my gosh this is an awkward service to call. Especially when it comes to getting detail.Mis
For anyone else struggling - one thing that I took too long to figure out too - if you're only interested in getting your own items, you can generate a token within the site itself and can generate a single user token through the developer site itself. You don't need to write any code to handle user token generationMis
T
1
<?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'
    );
Tooth answered 5/5, 2015 at 10:30 Comment(1)
I can't find the url for this request anywhere in the documentation or in your answer, could you provide it please?Steffaniesteffen

© 2022 - 2024 — McMap. All rights reserved.