<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/discussions/f/integrations/11068/sending-documents-to-external-system-through-a-webapi-call</link><description>Hello, Is it possible to send documents to an external system through a WebAPI call? I was playing with http response header &amp;#39;Content-Disposition&amp;#39; with header value being &amp;#39; attachment; filename=finename.pdf&amp;quot; &amp;#39;. But I don&amp;#39;t get to understand how to embed</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/77953?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2020 13:41:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02d4aed6-d4f7-4905-b846-0b2047c88998</guid><dc:creator>Thenmozhi Mohanakrishnan</dc:creator><description>&lt;p&gt;Is it possible to send 2 different documents using this?&amp;nbsp;If yes, how?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/74846?ContentTypeID=1</link><pubDate>Fri, 19 Jun 2020 10:57:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:30461676-f4a4-41ba-bb9c-6db3828a2fe0</guid><dc:creator>Jacob Rank</dc:creator><description>&lt;p&gt;To transfer a document between environments, try exposing a web API on the source that returns the document, and then use an integration object on the target environment to call that endpoint. You can create a service account on the source environment and generate an API key for it, then use that API key in the integration (via an HTTP connected system) to authenticate. You can run a process model or call the integration from a SAIL form when you want to pull the document over.&lt;/p&gt;
&lt;p&gt;If you want to need to initiate the transfer from the source environment rather than pull it from the target environment, just reverse this design and put the wep API to receive a document on the target and the integration to send the document on the source.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/74844?ContentTypeID=1</link><pubDate>Fri, 19 Jun 2020 06:03:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:26214ae0-0f9f-444f-902d-31ec69f1e282</guid><dc:creator>arunramanathtm</dc:creator><description>&lt;p&gt;Hi Jacob, I&amp;nbsp;have a requirement wherein I need to transfer an Appian document from one environment (cloud) to another (one premise). I&amp;#39;m&amp;nbsp;following the method suggested by the link you shared.&lt;/p&gt;
&lt;p&gt;I try to download file using safelink.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It works only when I logged in to the other environment from where the document is being sent.&lt;/p&gt;
&lt;p&gt;If I log out, I get AUTHENTICATION FAILED message.&lt;/p&gt;
&lt;p&gt;Is there any way to fix this?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/64225?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 06:54:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c058506d-59f7-4b90-93e0-5ea7d9c9821c</guid><dc:creator>Dude</dc:creator><description>&lt;p&gt;&lt;code&gt;with(&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp; local!pathArray: fn!cast(&amp;#39;type!{&lt;a&gt;www.appian.com/.../2009}Text&lt;/a&gt;, http!request.pathSegments),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp; local!document: tointeger(index(local!pathArray, 1, null)),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp; /* We don&amp;#39;t want to serve arbitrary documents because it could be a security risk */&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp; local!extensionWhitelist: {&amp;quot;pdf&amp;quot;, &amp;quot;txt&amp;quot;, &amp;quot;png&amp;quot;, &amp;quot;jpg&amp;quot;, &amp;quot;jpeg&amp;quot;},&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp; if(&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*The path must be only 1 value, the document ID, and that ID must be a number.Otherwise, we return a 404 Not Found*/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; or(&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length(local!pathArray) &amp;lt;&amp;gt; 1,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isnull(local!document),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; not(contains(local!extensionWhitelist, document(local!document, &amp;quot;extension&amp;quot;)))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a!httpResponse(&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statusCode: 404,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; body: &amp;quot;404 Not Found&amp;quot;,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; headers: {}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a!httpResponse(&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*If the query parameter &amp;quot;attachment&amp;quot; is set to true,set an HTTP header that tells the client that the body of the response should be downloaded. This overrides the default content-disposition of &amp;quot;inline; filename=&amp;lt;filename&amp;gt;.&amp;lt;extension&amp;gt;&amp;quot;. We will automatically set the content-type and length.*/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; headers: if(&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http!request.queryParameters.attachment,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a!httpHeader(&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: &amp;quot;Content-Disposition&amp;quot;,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value: concat(&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;attachment; filename=&amp;quot;&amp;quot;&amp;quot;,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document(local!document, &amp;quot;name&amp;quot;),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;.&amp;quot;,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document(local!document, &amp;quot;extension&amp;quot;),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;&amp;quot;&amp;quot;&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; body: todocument(local!document)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp; )&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;)&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/57244?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 13:07:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:65fdec5f-1936-4324-b483-226d814bbe16</guid><dc:creator>Jacob Rank</dc:creator><description>Support for returning documents from Web APIs in 18.1 includes streaming the content to the client (whether that&amp;#39;s a browser or another system). The entire document is never loaded into memory like it might have been with prior workarounds, so there shouldn&amp;#39;t be any reason to need a plugin when you need to download or return a document from Appian.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/57242?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 12:39:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4f7d8273-988f-4f82-b991-5ce4b97321a6</guid><dc:creator>Shubham Aware</dc:creator><description>Hi  ,&lt;br /&gt;
&lt;br /&gt;
It&amp;#39;s possible you can send document but it may cause low performance and process break issue.&lt;br /&gt;
I would recommend you to use plugin for sending doc.&lt;br /&gt;
&lt;br /&gt;
You can send small size doc by API call.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/57240?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 12:02:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:669fddea-449b-4f25-a838-5dd6e452d40a</guid><dc:creator>Jacob Rank</dc:creator><description>We added the ability to download/return documents using web APIs in 18.1: &lt;a href="https://docs.appian.com/suite/help/18.1/Appian_Release_Notes.html#web-apis"&gt;docs.appian.com/.../Appian_Release_Notes.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/48471?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 00:06:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3da8ee37-6087-41c1-a552-a8ff31f16786</guid><dc:creator>aloks0189</dc:creator><description>As per my understanding, in such case you need to go for customization/plugins option, but i would not recommend you to do so.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/48453?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 09:48:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6f29dc67-f49e-4b1d-a6e9-ddedcb7adc02</guid><dc:creator>GouthamKrishna</dc:creator><description>Please note that I also want this service to be available to client side user as a clickable link, where, user may want to click this service URL anticipating to download a document. In this case, I don&amp;#39;t think we can ingest any base64 conversion mechanisms into this model, can we?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/48452?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 09:44:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7754df9d-fcbd-4913-a297-920f6b3a9c7e</guid><dc:creator>aloks0189</dc:creator><description>Yes, it should work. But i would not recommend you processing big files, because this may cause Performance Issue/Leakage.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/48451?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 09:35:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a8935e41-8a7c-4f40-856c-578cc195c571</guid><dc:creator>GouthamKrishna</dc:creator><description>Thanks   I had this work around in mind. But do you think base64 conversion is scallable for big files? I have never tried that anyway...&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/48450?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 09:25:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e6af571d-64a6-414c-85c6-1e671f3db4d7</guid><dc:creator>aloks0189</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&amp;nbsp;As of now, there are no such way to send a document to an external system through Web-API, but yes you can have a try on this. You can try the following approach for your R&amp;amp;D purpose, before we come to a conclusion:&lt;br /&gt; &lt;br /&gt; =&amp;gt; Try to convert the document to Base64 format, and send this as an input to the External System using Web-API through POST call.&lt;br /&gt; =&amp;gt; Once the content got Delivered to External Service, you need to again convert this Base64 to Document.&lt;br /&gt; &lt;br /&gt; Problem Statement in this approach:&lt;br /&gt; =&amp;gt; Conversion of Document to Base64 in Appian&lt;br /&gt; =&amp;gt; The External System must be capable of converting Base64 to Document again.&lt;br /&gt; &lt;br /&gt; Hope this information will help you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending documents to external system through a WebAPI call</title><link>https://community.appian.com/thread/48444?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 07:32:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:98816482-180e-417c-b441-cd1d4922b716</guid><dc:creator>GouthamKrishna</dc:creator><description>&lt;p&gt;Updated the response code as I want to send a pdf file as attachment...&lt;/p&gt;
&lt;p&gt;&lt;em&gt;a!httpResponse( &lt;/em&gt;&lt;br /&gt;&lt;em&gt; headers: {&lt;/em&gt;&lt;br /&gt;&lt;em&gt; a!httpHeader(&lt;/em&gt;&lt;br /&gt;&lt;em&gt; name: &amp;quot;Content-Type&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; value: &amp;quot;application/pdf&amp;quot;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; ),&lt;/em&gt;&lt;br /&gt;&lt;em&gt; a!httpHeader(&lt;/em&gt;&lt;br /&gt;&lt;em&gt; name: &amp;quot;Content-Disposition&amp;quot;,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; value: &lt;em&gt;&amp;quot;attachment; filename=filename.pdf&amp;quot;&lt;/em&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; ) &lt;/em&gt;&lt;br /&gt;&lt;em&gt; },&lt;/em&gt;&lt;br /&gt;&lt;em&gt; body: {&lt;/em&gt;&lt;br /&gt;&lt;em&gt; todocument(121281) /*this is a pdf file from Appian*/&lt;/em&gt;&lt;br /&gt;&lt;em&gt; }&lt;/em&gt;&lt;br /&gt;&lt;em&gt; )&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>