douyudouchao6779 2016-03-23 01:29
浏览 41
已采纳

从Ebay SDK Selling获取已售商品 - 获取“Missing required input element”错误

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
", $error->message);
     }
    } else {
      foreach ($response->searchResult->item as $item) {
         printf("(%s) %s:%.2f
", $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
", $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.

  • 写回答

1条回答 默认 最新

  • drxrgundk062317205 2016-03-23 22:09
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog