Expand my Community achievements bar.

Unreadable response from postman with pdf generated from renderPDFForm service- Adobe Live Cycle

Avatar

Level 3

Hi Team,

I have the requirement where I have to generate the adaptive pdf as resultant pdf. I have used the renderPDFForm service of FormService to generate the adaptive pdf. But when I am hitting the REST API from the postman am getting 200 response code with unreadable response. There is another team who is consuming our REST API in order to get the adaptive pdf and stored it in the database.

 

I wanted to understand how upstream consume our REST API that's having unreadable response.

 

 

9 Replies

Avatar

Employee Advisor

@Amreen1 

Could you elaborate "adaptive pdf"?

Do you want to merge the data from the adaptive form into a pdf? You can leverage DoR service to generate the output pdf and the resultant pdf can be fetched/downloaded via API call from Postman.

Avatar

Employee Advisor

@Amreen1 @Amreenkhan 

I just got your latest response. It seems you're using the JEE process to fetch/convert the PDF. The above-mentioned solution is specific to the Adaptive form use cases.

Avatar

Level 3

Thanks @Pulkit_Jain_ @gbedekar  for quick response. Really appreciate . 
Actually the problem is that there is another team who is consuming our REST API for ex: "https://hostname:port/rest/services/xyz:1.0" . When I am hitting this url through postman it is giving 200 code but unreadable response   The other consuming teams expecting readable output response from postman as below Screen shot. can we not get the readable response? OR how other team consume REST API

Amreen1_1-1729778428653.png

 

 

Avatar

Employee Advisor

@Amreen1 

Ok, so you're getting the pdf as a response.

Do you have the header response content-type set to "application/pdf" as this seems to be set to text/xml.

You should be able to download/save the output as a pdf.

Avatar

Level 3

hi @Pulkit_Jain_ , 

Correct, content-type set to "application/pdf"  has not there. I am able to download the pdf while hitting the url from browser. 

do u have any idea,

when I am hitting the same API from browser its giving 302 response code while in postman its having 200 response code.

why there is different response code having the same API.

Avatar

Employee Advisor

@Amreen1 

Didn't get your last response.

Did you try to change the content type header to "application/pdf" to see if that helps?

Avatar

Administrator

@Amreen1  Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni