Is this response normal in Amazon MWS reports? - amazon

Hi. I am trying Amazon MWS for the first time. I have referred to - https://docs.developer.amazonservices.com/en_UK/reports/Reports_Overview.html
I made a call as shown in the diagram on that page. I am using the scratchpad.
Called the Request Report with required fields. In this case ReportType -
"_GET_MERCHANT_LISTINGS_DATA_"
Then I called the GetReportRequestList with the "ReportRequestId"
returned from the previous call.
Finally I am calling the - "GetReport" with the "GeneratedReportId"
which I got from the call previous to this and I get the response as
the above image.
I have no idea how to parse and use it. Can't make any sense about the format returned in the final call (Shown in the image).
If anyone worked with this API. Please point me to the right direction.
Thanks in advance

Depending on the ReportType, you'll either get a XML file or a CSV file back. The ReportType enumeration page in the docs will tell you which is which. While the XML format is somewhat well documented here, the CSV files are not, but most should be self-explanatory. _GET_MERCHANT_LISTINGS_DATA_ returns such a CSV file. You may be confused by the fact that one of its fields contains some HTML.
Since you don't state which programming language you intend to use: You can open a CSV file in Excel (or LibreOffice). Please note that unlike most CSV files, these are separated by tabs, not by commas or semicolons. Also, to answer your initial question: yes, this is normal.

Related

XLS File Is Not Being Parsed Correctly

I have two XLS files. Both are server generated. One is from our bank (account statement) and the other is an internal ledger report from our company's web portal. I am trying to read both files within my Retool app.
The first one is read successfully using the following piece of code (ignore the splices. I am just getting rid of some useless rows).
As you can see, I am getting the correct data from this file (visible in the table).
Now if I try the second file, I get this:
As you can see, the parsed value is showing some strange values. I do not know what to do here. I would really appreciate it if someone could point me in the right direction.

How to append into txt file through karate.write(value,file.txt) function? [duplicate]

In my karate tests i need to write response id's to txt files (or any other file format such as JSON), was wondering if it has any capability to do this, I haven't seen otherwise in the documentation. In the case of no, is there a simple JavaScript function to do so?
Try the karate.write(value, filename) API but we don't encourage it. Also the file will be written only to the current "build" directory which will be target for Maven projects / stand-alone JAR.
value can be any data-type, and Karate will write the bytes (or plain-text) out. There is no built-in support for any other format.
Here is an example.
EDIT: for others coming across this answer in the future the right thing to do is:
don't write files in the first place, you never need to do this, and this question is typically asked by inexperienced folks who for some reason think that the only way to "save" a response before validation is to write it to a file. No, please don't waste your time - and please just match against the response. You can save it (or parts of it) to variables while you make other HTTP requests. And do not write your tests so that scenarios (or features) depend on other scenarios, this is a very bad practice. Also note that by default, Karate will dump all HTTP requests and responses in the log file (typically in target/karate.log) and also in the HTML report.
see if karate.write() works for you as per this answer
write a custom Java (or JS function that uses the JVM) to do what you want using Java interop
Also note that you can use karate.toCsv() to convert JSON into CSV if needed.
My justification for writing to a file is a different one. I am using karate explicitly to implement a mock. I want to expose an endpoint wherein the upstream system will send some basic data through json payload using POST/PUT method and karate will construct the subsequent payload file and stores it the specific folder, and this newly created payload file will be exposed through another GET call.

Is there a way to write to a text file using Karate

In my karate tests i need to write response id's to txt files (or any other file format such as JSON), was wondering if it has any capability to do this, I haven't seen otherwise in the documentation. In the case of no, is there a simple JavaScript function to do so?
Try the karate.write(value, filename) API but we don't encourage it. Also the file will be written only to the current "build" directory which will be target for Maven projects / stand-alone JAR.
value can be any data-type, and Karate will write the bytes (or plain-text) out. There is no built-in support for any other format.
Here is an example.
EDIT: for others coming across this answer in the future the right thing to do is:
don't write files in the first place, you never need to do this, and this question is typically asked by inexperienced folks who for some reason think that the only way to "save" a response before validation is to write it to a file. No, please don't waste your time - and please just match against the response. You can save it (or parts of it) to variables while you make other HTTP requests. And do not write your tests so that scenarios (or features) depend on other scenarios, this is a very bad practice. Also note that by default, Karate will dump all HTTP requests and responses in the log file (typically in target/karate.log) and also in the HTML report.
see if karate.write() works for you as per this answer
write a custom Java (or JS function that uses the JVM) to do what you want using Java interop
Also note that you can use karate.toCsv() to convert JSON into CSV if needed.
My justification for writing to a file is a different one. I am using karate explicitly to implement a mock. I want to expose an endpoint wherein the upstream system will send some basic data through json payload using POST/PUT method and karate will construct the subsequent payload file and stores it the specific folder, and this newly created payload file will be exposed through another GET call.

How to get the filename for an attachment if there already is another one with the same filename, instead of getting a random name?

In cases when two attachments with the same filename are attached to a Notes Document, the second file is renamed internally to something like ATTXXXX. Even if the first filename is deleted and document re-saved, the internal filename remains cryptic.
There doesn't seem to be any way to retrieve the original Filename through back-end functions. I have looked high and low in LS but also in the C++ API, and could find nothing. It seems to be a trick that can only be done in the front-end. I am not sure where the information in the file icon graphic is stored, and whether it is accessible. In simple cases it would be possible to do a rename, I suppose (i.e. there is a single attachment and a single file icon graphic).
Could anybody confirm that this is, indeed a limitation of Notes or is there a cool way to solve this?
This is causing me some headaches whilst processing a large number of documents. My customer has trouble believing that there are some things that can only be done in the front end.
You should be able to get the original filename, even with duplicates.
It is not when the file is attached that the name is changed, it is when you detatch it.
You are probably using the .Name property, try the .Source property of the EmbeddedObject, that should return the original filename.
From the help:
If the NotesEmbeddedObject is an embedded object or object link, this property returns the internal name that Notes uses to refer to the source document.
If the NotesEmbeddedObject is a file attachment, this property returns the file name of the original file.
Syntax
To get: source$ = notesEmbeddedObject.Source
It's in the CD records for the rich text -- you will see it if you use NotesPeek to examine the contents of the rich text item. But I don't think it's accessible through the NotesRichText navigator class, so I'm pretty sure you would have to go the C API and parse through the CD records. Or, the MIDAS Rich Text API can probably get it, but that's third party software. I.e., not free.

How to get access to the metaproperties of a file (aspecially a mp3 file) with vba

I'm creating an excel-sheets that reads the tags from the MP3-files situated in a folder. Yet the time apparently is or calculated from data inside the MetaProperties of a file or is inside those data. When I use the Property MetaProperties VBA always provokes an error, even in using a copy of the example in adapting the appropiate data. Thanx in advance for your solution.
Does this help?
http://technet.microsoft.com/en-us/library/ee176591.aspx
You didn't say what metadata you want, but this method offers a lot of information.
MP3's do not use MetaProperties at all. They actually use the last 256 bytes of the file to store album, track, etc information (the ID3 tag).
See here http://id3.org/id3v2.4.0-structure for more information.

Resources