Hello! When sending a document via a Web API, I am aware that the document is sent via binary streaming. When received by the calling system, the document itself is received. Is there a configuration of httpHeaders in Appian that would send the binary string itself? We are wanting to call the Appian Web API, receive the binary string, and write it to an external (to Appian) DB table. We are trying to achieve this with a Web API so the external system can do most of the heavy lifting; Appian would only fetch the document and return the binary string. Thank you!
Discussion posts and replies are publicly visible
Glenn -
can you be a little more precise in your language?
It helps to understand exactly which system your sending from or calling from.
As written, the exact nature of your use case is unclear.
Thanks!
Hi Robert Shankin!
My apologies for the lack of clarity! I am trying to migrate approximately 350K documents from Appian to an external application. As the business has a number of production applications within Appian, we are trying to minimize the load (and any disruptions to other applications) on Appian while the migration is occurring.
Each document has some additional metadata (Appian Doc ID, Document Type, Audit fields, etc.) in a AppianBusiness DB table, so my thought was to migrate that table (as there is a data migration occurring as well), create a Web API to take in the Appian document ID as a parameter, and return the document to the external application that is making the call. Due to some other constraints at the moment, the external application would be writing the document to a DB table as a binary string. I was hoping I would be able to return the binary string from the Web API.
I hope this is a little more clear! Thank you!
Thanks - I follow you now, glennw
So - if you're already leveraging the database with good reason - I wonder if you might consider base64 instead of binary.Typically, as I understand it, in general, a better use case for binary is when you're intent is to stream the binary string to an immediate materialization of a document. (I'm open to dialog on that point, though).
If the 3rd party system supports base64 to document conversion you're practically home free.
Check out this shared component, base64 document database tools. When you visit the shared component page, make sure to scoll down to the bottom and grab the documentation on how to operate the smart services enabled by the plugin.With the "insert document as base64 into database" smart service, you can insert the document as well as all the metadata you want into a single table in one statement. From there, the third party system can pick up this data and hopefully convert the base64 string back into doc.
Keep in mind with your volume, these strings - binary or base64 are going to get large - make sure you account for the disk you'll use and clean up when you can.
Does that help?Thanks,Rob