1

これが私がやりたいことです:

  1. Amazon マーケットプレイスにアクセスする
  2. レポートを生成して CSV ファイルとして保存します。次の情報を含める必要があります: ORER-ID、購入日、SKU、製品名、販売価格、および配送情報

MWSはめちゃくちゃです。間違っていたら教えてください!!

最初にレポートを要求し、レポートが生成されるまで何らかの方法で待つ必要があると思います。

レポートが生成されたら、レポート ID を取得して、そこから情報を取得できるはずです。私は正しいですか?このプロセスを示すサンプルはありますか? 注意すべき落とし穴はありますか?

私は、API/オブジェクト指向プログラミングの知識が限られている中級 PHP プログラマーです。注文を 1 つずつプルするようにサイトをプログラムすることに成功しましたが、これによりシステムが抑制され、しばらくの間ロックされてしまいます。個々の注文に対して複数のリクエストを送信するのではなく、レポートに対して 1 つのリクエストを送信する必要があります。

4

2 に答える 2

1

C# を使用しているため、PHP についてはわかりませんが、次の手順が役立つことを願っています。

    /*  To generate a report follow the following steps:              
        * 
        *  1. Create a RequestReportRequest object and populate the required information (merchantID, start date, end date etc.) 
        *  2. Request the report by creating a RequestReportResponse object and executing the service RequestReport method using the object name you instantiated in step 1 and set
        *     string requestID = reportResponse.RequestReportResult.ReportRequestInfo.GeneratedReportId to hold the generated report ID. 
        *  3. Create a GetReportRequestListRequest object and populating the required information. 
        *  4. Request the status of the reports by creating a GetReportRequestListResponse object and executing the GetReportRequestList method using the object name you 
        *     instantiated in step 3. 
        *  5. Execute scheduled checks for the status every 60 seconds using a while loop and a System.Threading.Thread.Sleep(60000) call. This is often within the main program. 
        *  6. Create a foreach loop by creating a ReportRequestInfo object and looping over the GetReportRequestListResult.ReportRequestInfo objects within the 
        *     GetReportRequestListResponse object you instantiated in step 4. 
        *  7. Depending upon the status of the report complete any additional processing required. This is often within the main program
        *  8. Once the report returns _DONE_ the report is ready for download. this is often within the main program
        *  9. Request the report by creating a GetReportRequest object and set the report ID to match the GeneratedReportId object of the ReportRequestInfo object that was 
        *     instantiated in step 6. 
        * 10. Set the Report object of the GetReportRequest object instantiated in step 9 to System.IO.File.Open("filename", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite) in 
        *     order to download the report to disk in a streaming fashion. **NOTE** An error of "Uninitilized object reference" will be returned if this is not done! 
        * 11. Request the report by creating a GetReportResponse object and executing the service.GetReport method with the GetReportRequest object instantiated in step 9. 
        * 12. The report has been downloaded and processing can be passed off to other methods. 
        *
        */

これを機能させるには、しばらく試行錯誤が必要でした。各クラスが何であるか、より具体的にインスタンス化する必要がある 場所を理解すれば、API は問題ありません。

お探しのレポート タイプは次のとおりです: _GET_AMAZON_FULFILLED_SHIPMENTS_DATA_ 情報の大部分が含まれているためです。

ただし、これらの手順が役立つことを願っています-事前に知っていれば、1週間のデバッグを節約できたでしょう:)

于 2012-03-22T19:26:25.943 に答える
0

Temboo SDK の RetrieveReport 関数を使用すると、1 つのレポートのダウンロードに関連するすべての手順 (リクエスト、ステータスのポーリング、完了したレポート データの取得) を 1 回の呼び出しで実行できます。SDK は、Java、PHP、Python、Ruby、Node.js など、さまざまな言語で利用でき、オープン ダウンロードです。を見てみましょう:

https://www.temboo.com/library/Library/Amazon/Marketplace/Reports/RetrieveReport/

(完全な開示: 私は Temboo で働いています)

于 2013-03-22T16:25:58.537 に答える