从 Ebay SDK 销售中获取已售商品 - 出现 "Missing required input element" 错误

Get sold items from Ebay SDK Selling - getting "Missing required input element" Error

我无法为 EbaySDK 创建标签,因此 Ebay API 可能会产生误导。 SDK 参考如下。

为什么有些请求需要 "input"?在哪里可以找到它们? SDK 注释似乎不清楚每个 "call type".

需要什么

按照 http://devbay.net/sdk/guides/getting-started/basic-usage.html#working-with-responses 中的示例,我正在尝试获取已售商品的列表。由于 Ebay 仅保留 90 天的数据,因此我对我的请求没有任何限制。

他们的示例请求是:

// 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);
     }
  }

我的比较简单(而且显然不完整)

$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)
}

这是严重的错误

  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] => 
    )

)

错误:缺少必需的输入元素。

我好像不是在要求什么,但我不知道。

GetItemStatus 调用要求您提供 ItemID。请参阅以下 API 参考资料:GetItemStatus

您声明您正在查找销售历史记录。我不相信这是你应该使用的电话。这是一个看似在购物中的函数调用API,它更像是一个产品搜索工具

如果您希望获得特定客户的销售历史记录,您可能希望使用 'GetOrders' API 电话。请参阅以下内容:GetOrders