亚马逊MWS(PHP) - 如何申请工作亚马逊、工作、MWS、PHP

2023-09-11 11:24:39 作者:你蹲下来亲我

我想拉在PHP报告为积极的房源。

I am trying to pull a report in PHP for active listings.

我已经取得了进展,但是,我不明白这是如何工作并没有什么,有可以解释它。

I've made progress, however, I cannot understand how this works and there is nothing out there that can explain it.

例如,在从PHP库提供的样品,我看到不少的XML文件。当您运行RequestReportResponse样本,并生成XML文件,还是XML文件告诉RequestReportResponse怎么做基于价值和功能?

For example, in the Samples provided from the PHP library, I see quite a few XML files. When you run the RequestReportResponse sample, does that generate the XML file, or does the XML file tell the RequestReportResponse what to do based on values and functions?

我问,因为,与MWS便签 - 我选择所有必要的字段,提交再刷新我的卖家中心部分亚马逊报告页面,它显示了一个未决的报告

I am asking because, with the MWS Scratchpad - I select all the necessary fields, submit it then refresh the Amazon Reports page of my seller central section and it shows a pending report.

我只是问了XML内容如何影响报告或报表如何能影响XML。

I'm just asking how the XML content affects the report or how the report can affect the XML.

感谢所有,我AP preciate任何帮助。

Thanks all, I appreciate any help.

推荐答案

在回答你的问题有两个部分。

The answer to your question comes in two parts.

第1部分 - 调用亚马逊API

大多数MWS请求的不需要的任何文件(不论是纯文本或XML)被发送到亚马逊。举例来说,需要做的所有参数发送 RequestReport 可以(而且必须)被发送作为常规参数。我不知道亚马逊会做,如果你没有与它一起提交的文件,因为我从来没有尝试过。但话说回来......为什么你会吗?

Most MWS requests do not require any file (be it plain text or XML) to be sent to Amazon. For example, all parameters needed to do send RequestReport can (and must) be sent as regular parameters. I'm not sure what Amazon would do if you did submit a file along with it as I've never tried. But then again... why would you?

一说的话费确实需要要发送的文件是 SubmitFeed 调用文件所在的实际进提交。这取决于饲料要提交如果亚马逊希望它是纯文本或XML类型。

One of the calls that does require a file to be send is the SubmitFeed call where that file is the actual feed to be submitted. It depends on the type of feed you're submitting if Amazon expects it to be plain text or XML.

第2部分 - 处理Amazon的API响应

当你从亚马逊的API获取信息回来,它通常是XML格式(也有几个电话可能返回明文代替)。你需要去code这个数据来获取您的信息了。

When you get information back from Amazon's API, it usually is in XML format (there are a few calls that may return plaintext instead). You will need to decode this data to get your information out.

要使它更清楚一点,我将概述一个典型的过程给你:

To make it a bit clearer, I'll outline a typical process for you:

让所有房源从亚马逊的过程:

请在 RequestReport 调用亚马逊。没有XML连接

德$ C C,你又回到了XML $(这是一个 RequestReportResponse )。如果一切顺利,你会得到一个 RequestReportId 作为响应的一部分,亚马逊将开始处理您的请求。 Do a RequestReport call to Amazon. No XML attached

Decode the XML that you're getting back (it is a RequestReportResponse). If all went well, you'll get a RequestReportId as part of the response, and Amazon will start processing your request.

亚马逊可能需要几分钟的时间来真正创建报告,在非常复杂的或大的请求的情况下,或在高活动时间实际上可能需要长达一个小时或更长时间。因此,我们需要找出当我们提出的要求,实际上是完成的。

Amazon may need a few minutes to actually create the report, in cases of very complex or large requests or during high activity hours it may actually take up to an hour or more. So we need to find out when the request we made is actually done.

戳亚马逊的API与 GetReportRequestList 电话询问您的要求与 ReportRequestIdList.Id.1 = {YourRequestIdHere}状态。这也不需要一个XML附件

Poke Amazon API with a GetReportRequestList call asking for the status of your request with ReportRequestIdList.Id.1={YourRequestIdHere}. This also does not need a XML attachment.

德$ C C,你又回到了XML $。 (这是一个 GetReportRequestListResponse

Decode the XML that you're getting back. (it is a GetReportRequestListResponse)

如果它的 ReportProcessingStatus 不是 _DONE _ ,等待至少45秒钟,然后从步骤3.如果重复该报告实际上是做了,你会看到一个有效的 GeneratedReportId 的响应。如果它丢失了,你需要做一个额外的 GetReportList 打电话找其ID。

If its ReportProcessingStatus is not _DONE_, wait for at least 45 seconds, then repeat from step 3. If the report is actually done, you'll see a valid GeneratedReportId in the response. If it is missing, you'll need to do an extra GetReportList call to find its ID.

呼叫 GetReport 来最终获取与 ReportId = {YourGeneratedReportIdHere}报告

德code不管你要回来。根据报告您所请求的类型,响应可以是XML或纯文本。

Decode whatever you're getting back. Depending on the type of report you requested, the response may be XML or plain text.

此过程中详细Amazon商城网络服务报告API部分参考(版本2009-01-01)

要最后就回答你的问题,以获得来自亚马逊MWS积极的房源: 无三个电话要求您的发送XML 的亚马逊。你的的数据来自Amazon 的将是XML格式的(有可能是个例外步骤6,如果你要求一个纯文本报告)。

To finally answer your question with respect to getting active listings from Amazon MWS: None of the three calls require you to send XML to Amazon. The data you receive from Amazon will be in XML format (with the possible exception step 6 if you requested a plain text report).