0

I cant create a tag for EbaySDK, so Ebay API may be misleading. The SDK reference is below.

Why do some requests require "input" and where can they be found? The SDK notes don't seem clear on whats required per "call type".

Following the examples from http://devbay.net/sdk/guides/getting-started/basic-usage.html#working-with-responses I'm attempting to get a list of sold items. Since Ebay only keeps 90 days data, I've put no restrictions on my request.

Their example request is:

// Create the API request object.
 $request = new Types\FindItemsByKeywordsRequest();
// Assign the keywords.
 $request->keywords = 'Harry Potter';
// Output the response from the API.
  if ($response->ack !== 'Success') {
     foreach ($response->errorMessage->error as $error) {
       printf("Error: %s\n", $error->message);
     }
    } else {
      foreach ($response->searchResult->item as $item) {
         printf("(%s) %s:%.2f\n", $item->itemId, $item->title, $item->sellingStatus->currentPrice->value);
     }
  }

mine is a bit more simple (and apparently incomplete)

$request = new Types\GetItemStatusRequestType;
$response = $service->getItemStatus();
if ($response->Ack !== 'Success') {
    if (isset($response->Errors)) {
        foreach ($response->Errors as $error) {
            printf("Error: %s\n", $error->ShortMessage);
        }
    }
} else {
    print_r($response->getItemStatus); //should return all avail values (works with other types of requests)
}

Here is the nasty error

  DTS\eBaySDK\Shopping\Types\GetItemStatusResponseType Object
(
   [values:DTS\eBaySDK\Types\BaseType:private] => Array
       (
          [Timestamp] => DateTime Object
            (
                [date] => 2016-03-23 00:28:28.391000
                [timezone_type] => 2
                [timezone] => Z
            )

        [Ack] => Failure
        [Errors] => DTS\eBaySDK\Types\UnboundType Object
            (
                [data:DTS\eBaySDK\Types\UnboundType:private] => Array
                    (
                        [0] => DTS\eBaySDK\Shopping\Types\ErrorType Object
                            (
                                [values:DTS\eBaySDK\Types\BaseType:private] => Array
                                    (
                                        [ShortMessage] => Missing required input element.
                                        [LongMessage] => Required input element is missing from the request.
                                        [ErrorCode] => 1.19
                                        [SeverityCode] => Error
                                        [ErrorParameters] => DTS\eBaySDK\Types\UnboundType Object
                                            (
                                                [data:DTS\eBaySDK\Types\UnboundType:private] => Array
                                                    (
                                                        [0] => DTS\eBaySDK\Shopping\Types\ErrorParameterType Object
                                                            (
                                                                [values:DTS\eBaySDK\Types\BaseType:private] => Array
                                                                    (
                                                                        [ParamID] => 0
                                                                        [Value] => ItemID
                                                                    )

                                                                [attachment:DTS\eBaySDK\Types\BaseType:private] => Array
                                                                    (
                                                                        [data] => 
                                                                        [mimeType] => 
                                                                    )

                                                            )

                                                    )

                                                [position:DTS\eBaySDK\Types\UnboundType:private] => 0
                                                [class:DTS\eBaySDK\Types\UnboundType:private] => DTS\eBaySDK\Shopping\Types\ErrorType
                                                [property:DTS\eBaySDK\Types\UnboundType:private] => ErrorParameters
                                                [expectedType:DTS\eBaySDK\Types\UnboundType:private] => DTS\eBaySDK\Shopping\Types\ErrorParameterType
                                            )

                                        [ErrorClassification] => RequestError
                                    )

                                [attachment:DTS\eBaySDK\Types\BaseType:private] => Array
                                    (
                                        [data] => 
                                        [mimeType] => 
                                    )

                            )

                    )

                [position:DTS\eBaySDK\Types\UnboundType:private] => 0
                [class:DTS\eBaySDK\Types\UnboundType:private] => DTS\eBaySDK\Shopping\Types\GetItemStatusResponseType
                [property:DTS\eBaySDK\Types\UnboundType:private] => Errors
                [expectedType:DTS\eBaySDK\Types\UnboundType:private] => DTS\eBaySDK\Shopping\Types\ErrorType
            )

        [Build] => E949_CORE_APILW_17769283_R1
        [Version] => 949
    )

[attachment:DTS\eBaySDK\Types\BaseType:private] => Array
    (
        [data] => 
        [mimeType] => 
    )

)

Error: Missing required input element.

It seems I'm not asking the request for something, but I have no idea.

Cray
  • 2,774
  • 7
  • 22
  • 32
zzipper72
  • 945
  • 2
  • 10
  • 24

1 Answers1

0

The GetItemStatus call requires you provide an ItemID. See the following API reference: GetItemStatus

You state you are looking for a sales history. I don't believe this is the call you should be using. This is a function call that appears to be in the shopping API, which is more of a product search tool.

You probably want to be using 'GetOrders' API call if you are looking to get a particular accounts sales history. See the following: GetOrders

Nate M.
  • 822
  • 6
  • 14
  • The answer is the GetItemStatus needs an Id, thank you. The GetOrders is unfortunate only specific to the logged in seller. – zzipper72 Mar 24 '16 at 00:24
  • The good news is, I believe I've found the solution for multiple sold listing returns. (I haven't tested it but the documentations seems pretty clear) It was where I was working originally but missed how to use the filter properly so I ruled it out early(wrongly) since it only seem to return Active listings. - The findCompletedItems will return sold items with a specific filter, per the docs: itemFilter(2).name=SoldItemsOnly& itemFilter(2).value=true&, found at: http://developer.ebay.com/devzone/finding/CallRef/findCompletedItems.html#Response.searchResult.item.sellingStatus.sellingState – zzipper72 Mar 24 '16 at 00:28
  • Glad to hear you sorted it out! I was assuming you were looking for sales for your or a clients account. Bad assumption on my part :-) – Nate M. Mar 24 '16 at 01:31
  • I would suggest specifying your date boundaries. eBay retains data long past 90 days, although the older the data, the less confidence you may have in retrieving it; I have no idea what algorithms they use for keeping vs. discarding. Just one example I picked at random: listing 231780378406 ended on December 17, 2015 but is still fully retrievable. – acg_so Apr 06 '16 at 20:48