Hi,
I have a requirement where I need to download pdf documents using API service. Through postman I was able to get the response and decoded into table for multiple attachments.
But unable to convert the response into pdf document. Please help me to sort it out .
Attached is the postman response
Hi @Rajitha_Reddy ,
Welcome to the community.
It sounds like you are trying to download PDF documents using an API service and are able to get a response in Postman, but are having trouble converting the response into a PDF document. To help you with this, I would need to see the specific response you are receiving in Postman.
However, based on your description, it sounds like the response you are receiving may be in a format such as JSON or XML that needs to be parsed and then converted into a PDF document. You could use a programming language such as Python or Java to parse the response and then convert it into a PDF document.
Hope this will help.
Kindly mark this thread as solution if this helps you.
Cheers
Welcome to the community
What kind of response are you getting?
File link or byte array?if first you have link…if second use this to convert
Hope this helps
Cheers
Thanks for quick response Ashish.
I have receiving a response in the form of JSON format. After that I’m using deserialize activity to convert json response into object.
Then I am trying split the object into table format since I have more than 1 document.
I’m converting into base64 string and then to array bytes. After this by using invoke code activity I am using write all bytes to save it as jpeg/pdf
Thanks Anil.
I m getting JSON response and file content is in image/jpeg. Actual requirement through UI is need to download pdf scanned documents, api service is available so trying for the same.
As you mentioned I already followed the same code
through vb script and even through c# code but while opening jpeg or pdf getting error as failed to load document.
In http request activity…you have an option to provide the response file path …which will let you save the response file directly…did you happen to try that?
Cheers
Yes tried response path option as well but no luck Anil.
Just to confirm…what did you give content type as any?
I see you are getting a filename…is it like a link? Or you are again getting a content stream to deserialize?
If its base64
Dim base64String As String = "your base64 string here"
Dim byteArray As Byte() = Convert.FromBase64String(base64String)
Dim byteStream As New MemoryStream(byteArray)
Dim image As Image = Image.FromStream(byteStream)
Dim filePath As String = "path to your output file here"
image.Save(filePath)
Cheers
Thank you all for quick help…
The problem has been resolved. I was trying to save a file in network shared folder path . Later I changed to local folder path and able to save image as suggested by API team.
Thanks again
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.