<?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>Web API to get document by document ID</title><link>https://community.appian.com/discussions/f/general/19348/web-api-to-get-document-by-document-id</link><description>Hi, 
 I need to create a web api which would take document ID as input and should give the document. I tried using document download function in the web api and the response I am getting is as follows: 
 [@attributes=[@anyAttribute=[_documentDownloadLink</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75859?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 13:40:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8eaca97f-5fcc-44f7-97ae-a6a17e4dd582</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This is expected behavior. My suggestion is to implement it similar to this discussion, but download the file on user request instead automatically.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75858?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 13:37:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8f9d9607-9cb7-4ed9-9f41-9f1ced52b7d1</guid><dc:creator>arunramanathtm</dc:creator><description>&lt;p&gt;Using document id stored in database ,Through safe url,&amp;nbsp;i can&amp;nbsp;download files from&amp;nbsp;my on-premise site (that are stored in cloud env). This happens only when i logged in to cloud env also. When I logged out from cloud env, i&amp;#39;m unable to download the document.&amp;nbsp;I get the below error message on a new browser tab:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;{&amp;quot;resource&amp;quot;:&amp;quot;\/suite\/webapi\/downloadReports\/12229&amp;quot;,&amp;quot;error&amp;quot;:&amp;quot;APNX-1-4187-000&amp;quot;,&amp;quot;message&amp;quot;:&amp;quot;Authentication failed. Please check your credentials and try again.&amp;quot;,&amp;quot;title&amp;quot;:&amp;quot;An Error Has Occurred&amp;quot;}&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75857?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 13:25:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:94cf950c-0f01-4ba2-960f-b19abbf62d48</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;So, your issue is that your users hav no permission to access the cloud env, right? Then, you could start a process via startProcessLink which the user clicks on. The document is downloaded via in that&amp;nbsp;process and a chained task form shows the download link.&lt;/p&gt;
&lt;p&gt;Does that help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75856?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 13:20:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e6e78d94-7566-405c-bf99-ad8e23ec6f56</guid><dc:creator>arunramanathtm</dc:creator><description>&lt;p&gt;&lt;a href="/members/stefanh791"&gt;Stefan Helzle&lt;/a&gt; Hi Stefan, I&amp;nbsp;have&amp;nbsp;a requirement wherein we have two environments&amp;nbsp; - one on cloud and one on premise and&amp;nbsp;documents are stored in cloud environment. I&amp;#39;ve stored the document ids in the database. The on-premise users have to download certain files from cloud environment.&amp;nbsp; What is the best way to implement this?&amp;nbsp; I&amp;#39;ve tried using&amp;nbsp; the document link as web api and downloading it using safe url. but&amp;nbsp;authentication cannot be done in this way. Please suggest some work around&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75756?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2020 16:14:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c9237f08-a0cf-404d-a8ed-f06309862a37</guid><dc:creator>Brinda</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;Thank you very much, it worked.&amp;nbsp; I was creating webapi&amp;#39;s before from scratch.&amp;nbsp; So I didn&amp;#39;t look in the coding or templates.&amp;nbsp; Now I think I can migrate the document as per my plan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75741?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2020 10:13:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e347dec4-86bb-419b-a8a7-dc7e041bf2da</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You might want to change this line in your API.&lt;/p&gt;
&lt;p&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;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75740?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2020 09:51:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0c8bef52-2bfd-428d-8374-ab610eb836ad</guid><dc:creator>Brinda</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;I have&amp;nbsp; folders like &amp;quot;Test PDF files&amp;quot;, &amp;quot;Test Image Files&amp;quot;, and &amp;quot;Test Word Files&amp;quot; in &amp;quot;Test Knowledge Center&amp;quot;.&amp;nbsp; All the folders are inheriting the security of &amp;quot;Test KC&amp;quot;.&amp;nbsp; So, the security is same for all the folders and the user has editor access to all folders.&amp;nbsp; But I can move the pdf files and images files, but not the word files.&amp;nbsp; I even tried moving the word file to PDF Files folder. Even then I am not able to download.&amp;nbsp; I am not able to figure out the issue.&amp;nbsp; Have you tried moving the word files using web api?&amp;nbsp; Any suggestions would be of great help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75715?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 17:58:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:85f546e8-73d5-41b5-bab6-c3e7a26ef155</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;This is not a file type issue. Are the word files in another folder inside Appian? Does the user doing the calls have permission to this folder?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75714?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 17:24:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:465aeb1e-e0c1-4981-bd11-7591c0bf6b9c</guid><dc:creator>Brinda</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;I tried your method.&amp;nbsp; It is working fine for image files and PDF documents and saving them to the folder, but when I tried the same for word file (DOCX), it is giving the following error:&lt;/p&gt;
&lt;div class="FieldLayout---field_layout FieldLayout---inMessageLayout"&gt;
&lt;div class="FieldLayout---input_below"&gt;
&lt;div class="RichTextDisplayWidget---inMessageLayout RichTextDisplayWidget---error"&gt;
&lt;p class="ParagraphText---richtext_paragraph ParagraphText---default_direction ParagraphText---align_start ParagraphText---inMessageLayout ParagraphText---error elements---global_p"&gt;&lt;strong class="StrongText---richtext_strong StrongText---inMessageLayout StrongText---error"&gt;The requested URL cannot be found&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="FieldLayout---field_layout FieldLayout---inMessageLayout appian-context-last-in-list"&gt;
&lt;div class="FieldLayout---accessibilityhidden"&gt;&lt;span class="FieldLayout---field_label FieldLayout---inMessageLayout FieldLayout---error" id="2dfc214ad0840c1551b3f66595b7d768"&gt;error-result-guidance&lt;/span&gt;&lt;/div&gt;
&lt;div class="FieldLayout---input_below"&gt;
&lt;div class="RichTextDisplayWidget---inMessageLayout RichTextDisplayWidget---error"&gt;
&lt;p class="ParagraphText---richtext_paragraph ParagraphText---default_direction ParagraphText---align_start ParagraphText---inMessageLayout ParagraphText---error elements---global_p"&gt;The external system did not find the requested URL or is refusing to allow access HTTP/1.1 404 404&lt;/p&gt;
&lt;p class="ParagraphText---richtext_paragraph ParagraphText---default_direction ParagraphText---align_start ParagraphText---inMessageLayout ParagraphText---error elements---global_p"&gt;Any suggestions please?&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75690?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 06:25:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:99ea57dc-69ca-454b-98bd-8f090b1f0bed</guid><dc:creator>Brinda</dc:creator><description>&lt;p&gt;Thank you Stephan.&amp;nbsp; I will try your method and let you know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75688?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 05:50:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:34f4b0ef-14c2-4e09-9aa0-f6ea6232f5c1</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;My example uses Google Charts to create QR code images which is actually just downloading a file.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/Bildschirmfoto-2020_2D00_07_2D00_30-um-07.48.25.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75686?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2020 05:22:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:64947f5d-6895-43d7-873b-270d15c64ea8</guid><dc:creator>Brinda</dc:creator><description>&lt;p&gt;Hi Stephan,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&amp;nbsp; I created the web api.&amp;nbsp; Actually I am using this web api to move the document from one appian environment to other. I am going to build a process model in the target environment, call this web api and save the document in a folder.&amp;nbsp; This web api I have created is downloading the document.&amp;nbsp; How can I save it in a folder using the process model in the target environment?&amp;nbsp; Any suggestions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Web API to get document by document ID</title><link>https://community.appian.com/thread/75679?ContentTypeID=1</link><pubDate>Wed, 29 Jul 2020 16:43:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f5a8ebae-c72b-42c7-ba90-ee726454e3d3</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/Bildschirmfoto-2020_2D00_07_2D00_29-um-18.43.18.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>