Skip to main content

I have pdf document embedded in XML file for EDI orders.

I want to create document based on embedded file and attach document to order.

We are using 23R2,  must be handled through REST-API

Hi,

You need to tell us more about the use case for us to understand what can be done. Where is the XML/EDI/PDF? What tools/languages/platforms/libraries do you have available to pull this off? What is the trigger point for what to do? How large are those files? How often should this be done? Why does it have to be handled via a REST API? Who calls that, and when? Where is the REST API? What competences do you have? Etc.

 


We receive XML file with Order info and Customers Purchase Order (PDF ) embedded in XML file.

We use software called Lobster to pick up and convert XML into to IFS standard message to create incoming customer order. But we would like to get embedded PDF from XML and make attachment to incoming customer order.
File is not that big, approx 50Kb

This process should run frequently, m 2-300 times / day.


Doesn't need to be REST-API, thought that REST-API is interface to use in 23R2.
I think we have good knowledge in integrations and REST-API


Extracting the PDF from the XML is something you need to figure out. I assume it's either stored Base64 encoded or as a CDATA tag with binary data. Once you have the PDF as a byte array/stream of bytes, we have many REST APIs that can be used to upload that as a file in Docman. I would recommend you first try with our Premium API CreateAndImportDocument.

Good luck!
 


Thanks for you help.

I tried to use CreateAndImportDocument, but I get error message.

Error while uploading the file. Detail: Failed to set the file information. ORA-20115: EdmFile.The \"EDM File\" has already been removed by another user.

Document revision exists in Docman.

 



 

 


That projection is for creating new document, you cannot use it to upload a file to an existing document revision. Also, the If-Match header doesn't look right, it should say "Etag here", as I remember it (but please check the details in the API docs). The file name should be Base64 URL encoded and it looks light you might have done that.

 


I use this path to upload file.
https://HOST/int/ifsapplications/projection/v1/CreateAndImportDocument.svc/EdmFileSet(DocClass='LOCAL_01',DocNo='1534778',DocSheet='1',DocRev='0',DocType='ORIGINAL',FileNo=1)/FileData

It’s not correct?


Ah, you are right. You can use that entityset to upload a file if you make sure the file reference exists. Does it? Also, which value did you use for the if-match header?


I use Etag and * for If-match

 

Is it possible to send PDF file as base 64 encoded to REST-API, if so can you send which REST-API I should use?

 

Thanks.

 


Is it possible to send PDF file as base 64 encoded to REST-API, if so can you send which REST-API I should use?
 

There might be REST APIs that accepts the file content as a Base64 encoded string, but it's hard to find such an API. There is no general capability of the platform that makes that possible in all APIs that accepts files to be uploaded. Unless someone else replies here, you are on your own there. It might be possible to add an option in our CreateAndImportDocument API for handling this. If this sounds useful I suggest you file an idea in the Ideas section here on IFS Community.


Reply