2016-03-23 16 views
0

EbaySDK用のタグを作成できないため、Ebay APIが誤解を招く可能性があります。 SDKのリファレンスは以下のとおりです。Ebay SDKからの販売アイテムの取得販売中 - 「必須入力エレメントが見つかりません」エラー

なぜ一部のリクエストに「入力」が必要なのですか? SDKの注意事項は、「コールタイプ」ごとに必要なものについてはっきりしていないようです。

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

) 

エラーです入力要素。

私は何かの要求を求めていないようですが、私は分かりません。

答えて

0

GetItemStatusコールでは、ItemIDを指定する必要があります。次のAPIリファレンスを参照してください。GetItemStatus

販売履歴を探しているとします。私はこれがあなたが使用すべき呼びだとは思わない。これは、ショッピングAPIにあるように見える関数呼び出しです。これは、製品検索ツールの多くです。

特定のアカウントの販売履歴を取得する場合は、おそらく 'GetOrders' APIコールを使用します。以下を参照してください。GetOrders

+0

答えはGetItemStatusがIDを必要とするため、ありがとうございます。 GetOrdersはログインした売り手にのみ不幸です。 – zzipper72

+0

良いニュースは、私は複数の販売リストリターンの解決策を見つけたと考えています。 (私はそれをテストしていませんが、ドキュメントはかなり明確に見えます)それは私が元々働いていたところでしたが、フィルタを適切に使う方法を逃していましたので、Activeリストを返すように見えるので、早く(誤って) - findCompletedItemsは、docs:itemFilter(2).name = SoldItemsOnly& itemFilter(2).value = true&の特定のフィルタを持つ販売アイテムを返します。http://developer.ebay.com/devzone/finding /CallRef/findCompletedItems.html#Response.searchResult.item.sellingStatus.sellingState – zzipper72

+0

あなたがそれを並べ替えて聞いてうれしい!私はあなたの顧客アカウントまたは顧客アカウントの売上を探していたと仮定していました。私の部分では間違った仮定:-) –

関連する問題