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:ioBHxsE-N_JZt_4edZOQWnRVKO7BA2EyyDE3f8W5ryXvpMCFErFIBm5KMo], @nil=], document=[Document:117890], label=loan, actions=, version=-1]
How can I get the document from here?
I also created the web api to download the document where the response is the url like "">mysite.com/.../56831"
But I do not want to get the link to download the document.
Is there any other way to get the document through web api?
Thanks in advance,
Brinda Sateesh.
Discussion posts and replies are publicly visible
Hi Stephan,
Thanks for your reply. I created the web api. 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. This web api I have created is downloading the document. How can I save it in a folder using the process model in the target environment? Any suggestions?
My example uses Google Charts to create QR code images which is actually just downloading a file.
Thank you Stephan. I will try your method and let you know.
Hi Stefan,
I tried your method. 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:
The requested URL cannot be found
The external system did not find the requested URL or is refusing to allow access HTTP/1.1 404 404
Any suggestions please?
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?
I have folders like "Test PDF files", "Test Image Files", and "Test Word Files" in "Test Knowledge Center". All the folders are inheriting the security of "Test KC". So, the security is same for all the folders and the user has editor access to all folders. But I can move the pdf files and images files, but not the word files. I even tried moving the word file to PDF Files folder. Even then I am not able to download. I am not able to figure out the issue. Have you tried moving the word files using web api? Any suggestions would be of great help.
You might want to change this line in your API.
local!extensionWhitelist: {"pdf", "txt", "png", "jpg", "jpeg"},
Thank you very much, it worked. I was creating webapi's before from scratch. So I didn't look in the coding or templates. Now I think I can migrate the document as per my plan.