Search code examples
c#sdkebay-api

Get Existing Item Specifics from eBay API


I am using eBay API to list new / update existing product using C#. I need to know a way to get Item Specifics for an Item so that when I update the product, the specifics are not lost.

I am using DetailLevelCodeType.ReturnAll with GetSellerListCall() to bring down all details. What I understand from the documentation, if I use DetailLevelCodeType.ItemReturnAttributes using the GetItem() call, I can get the same.

My question is if we have any way to get all data including Item Specifics using the GetSellerList() call?

Below is the sample code I am using -

 GetSellerListCall call = new GetSellerListCall(_context);
        call.DetailLevelList.Add(DetailLevelCodeType.ReturnAll);
        call.Pagination = new PaginationType() { EntriesPerPage = 20 };
        call.EndTimeFrom = DateTime.UtcNow;
        call.EndTimeTo = DateTime.UtcNow.AddDays(1);

        do
        {
            call.Pagination.PageNumber++;

            ItemTypeCollection items = call.GetSellerList();

            foreach (ItemType item in items)
            {
                //Perform My Action
            }
        }
        while (call.HasMoreItems);

Thanks in advance.


Solution

  • I did not find any solution with the GetSellerListCall() and hence moved on by making an extra call to GetItem() using the sample below. Hope this helps.

    GetItemCall call = new GetItemCall(_context);
    call.IncludeItemSpecifics = true;
    call.DetailLevelList.Add(DetailLevelCodeType.ItemReturnAttributes);
    
    ItemType _itemSpecific = call.GetItem('Item ID from eBay');