Solved

Get PDF From REST SmartObjects

  • 30 October 2019
  • 2 replies
  • 18 views

Hello, i have a problem regarding on how to get pdf file from REST smartobject

 

i have an api that return a pdf file in which the return type is HttpResponseMessage, i've tested it using swagger and it successfully fetch me the pdf file correctly. when i convert it into smartobjects via REST and implement it in workflow, the output mapping only available is ResponseCode, different from k2 built in load PDF smartobjects which return pdf file.

see screenshoot for example13043iEE76DA4D58F59518.png

 

any solution for this? or is there any format needded to get the file correctly?

 

Thanks

icon

Best answer by andiak 30 October 2019, 10:02

View original

2 replies

Badge +7

Hello  @andiak ,

 

Please thoroughly go through this document and subheadings herein:

https://help.k2.com/onlinehelp/K2Cloud/UserGuide/Update_10/default.htm#Create/K2Designer/Controls/SaveAsPDF/SaveAsPDFControl.htm

 

pdf creation is a string of solutions that takes yours in consideration

https://community.k2.com/t5/K2-Five/pdf-creation/td-p/109255

 

Also, try installing the latest fixpack from this link https://help.k2.com/kb002104

 

All the best.

Hello thanks for your reply.

 

i've found the solution after i read the REST documentation and the links you gave to me.

i'll post the solution here just in case someone else need it:

 

Your SMO needs to return Base64 String and then use the Get File From Content function in context browser

don't forget to set the file format in the function input (File Name).

 

cheers

Reply