Skip to main content

Hello,

I am using rest web services package - 3.21.3

Requirement - To download pdf file

Issue -  I am able to hit the end url and get response as byte stream, but if i check download file and give the path to be downloaded its not working(path is with file name)

Error : Api response is empty because file does not exist

 

Is it issue with the package? or am i missing anything

Have you tried using Browser: Download file if this is a simple GET request?

Another suggestion is using Python and either the Requests or cURL functions. Let me know if you need an example.


Please do share an example if possible


How about this?
 

This simple automation prompts for a filename, then uses a GET request to download the file to the temp folder. This is only a sample as it has no error handling.

If you’re performing simple GETs, I would still recommend the Browser: Download file action instead of using Python.


Sorry i might not have given all the details here. I need to do this download file option itself if possible

If i check download file option i am getting below error. If the option is not checked i am getting response value
(file path : C:\Robotics\Downloads\2bd82f58-d8d1-454e-9d46-9937ca5e3e40.pdf)

I tried different approach of sending response and writing it to pdf, but i need to pass api key here
API key is in credential and i am only able to do this if its sent in string format - I could not pursue this option

 


Your line that sets the “headers” variable is going to return a dictionary variable. If I use print(type(headers)) it reports “<class ‘dict’>”.

However, if I change that line to this:

headers = "{'X-Myndshft-Api-Key':'" + listElement 0] + "'}"

...it reports as “<class ‘str’>”, which is what you need. You’re building a string this way, not a dictionary.


Reply