Unanswered question

How to save generated report through REST api calls?

Neoload Documentation https://www.neotys.com/documents/doc/neoload/latest/en/ht...

****************************************************************************************************************
Says that in order to generate a report through REST calls I have to send this parameters.

POST http://localhost:7400/Results/v1/Service.svc/GenerateReport HTTP/1.1
Content-Type: application/json
{ "d": {
“ApiKey”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
"TestResultName": "testA",
"ComparisonReport": true,
"OtherTestResultName": "testB",
"CustomReportContents": true,
"Format": "PDF"
}}

****************************************************************************************************************

QUESTION: Is there a parameter to specify where to save the report? Is there a field to specify a directory in the END Point?

Shahboz S.
Shahboz S.

Shahboz S.

Level
0
56 / 100
points

Answers

christophe M.
christophe M.

christophe M.

Level
4
5000 / 5000
points
Team

Dear Shahboz,

The GenerateReport returns a report ID that must be used as the input of DownloadReport that returns the report binary (PDF content for a PDF or a Zip file content for the HTML format).

Shahboz S.
Shahboz S.

Shahboz S.

Level
0
56 / 100
points

I am also sending a POST request to http:/localhost:7400/Results/v1/Service.svc/DownloadReport

{
"d":
{
"ReportId": "{{ReportId}}",
"ApiKey": "{{APIkey}}"
}
}

Does this api accept parameter where I can pass in where to save the downloaded file??

christophe M.
christophe M.

christophe M.

Level
4
5000 / 5000
points
Team

The response of the API Call to DownloadReport returns the bytes.

This is the responsibility of the client calling the API to write the bytes to a file on disk.

Shahboz S.
Shahboz S.

Shahboz S.

Level
0
56 / 100
points

Is there any example on how to save the file and decode the binary to pdf using powershell? I understand it's our responsibility to save it to file, do you have example scripts that shows the saving and decoding the pdf file in powershell???

venkat R.
venkat R.

venkat R.

Level
0
47 / 100
points

You can use CURL
curl -H "Content-Type: application/json" -X POST http://localhost:7400/Results/v1/Service.svc/GenerateReport -d "{\"TestResultName\": \"FirstTest31\",\"Format\": \"PDF\"}"

then get the reportID. make another CURL Post request

curl -H "Content-Type: application/json" -X POST http://localhost:7400/Results/v1/Service.svc/DownloadReport -d "{\"ReportId\": \"fb517607-1dd8-4ce2-b4fc-bc829b62383f\"}" >> TestResults.pdf