The answer to your question consists of two parts.
Part 1 - Calling the Amazon API
Most MWS requests do not require any file (be it plain text or XML) to send to Amazon. For example, all parameters necessary to send send RequestReport can (and should) be sent as normal parameters. I'm not sure what Amazon would do if you sent the file along with it, like I never tried. But then again ... why do you need it?
One of the calls for which you want to send a file is a call to SubmitFeed , where this file is the actual feed that will be sent. It depends on the type of feed you submit if Amazon expects it to be plain text or XML.
Part 2 - Processing Amazon API responses
When you retrieve information back from the Amazon API, it is usually in XML format (there are several calls that may return plain text instead). You will need to decode this data to get the information.
To make this a little clearer, I will describe a typical process for you:
The process of getting all your ads with Amazon:
- Make a
RequestReport call on Amazon. No XML Attached Decrypt the XML you return (this is RequestReportResponse ). If all goes well, you will receive RequestReportId as part of the response, and Amazon will begin processing your request.
Amazon may take several minutes to actually generate a report, in cases of very complex or large requests, or during busy hours, it may take up to an hour or more. Therefore, we need to find out when the request made by us is really made.
Poke Amazon API with a GetReportRequestList call requesting the status of your request with ReportRequestIdList.Id.1={YourRequestIdHere} . This also does not require an XML attachment.
Decrypt the XML you are returning. (this is GetReportRequestListResponse )
If its ReportProcessingStatus not _DONE_ , wait at least 45 seconds, and then repeat from step 3. If the report is really executed, you will see a valid GeneratedReportId in the response. If it is missing, you need to make an additional call to GetReportList to find its identifier.
Call GetReport to finally get the report using ReportId={YourGeneratedReportIdHere}
Decode everything that you return. Depending on the type of report requested, the response may be XML or plain text.
This process is explained in detail (and with a beautiful flowchart) in the Amazon Marketplace Web Services Reporting API Reference (version 2009-01-01)
To finally answer your question about getting active ads from Amazon MWS: None of the three calls require you to submit XML to Amazon. The data you receive from Amazon will be in XML format (with a possible exception step 6, if you requested a simple text report).
source share