Hi!
We are currently passing in a folderId over a WebAPI call to Appian - from there we are using a!startProcess to run the Document Zipper smart service to zip the folder and output the resulting documentId.
Is there a way to allow the resulting zip document to be downloaded via the WebAPI call, or will I have to use some workaround like using an additional GET method to pull the document after using POST to run the smart service?
Thanks!
Discussion posts and replies are publicly visible
As long as you are chaining all the way through your process model this could be potentially possible. Then, in the onsuccess parameter of a!startProcess you should return:
a!httpResponse( headers: if( http!request.queryParameters.attachment, a!httpHeader( name: "Content-Disposition", value: concat( "attachment; filename=""", document(fv!processInfo.pv.documentId, "name"), ".", document(fv!processInfo.pv.documentId, "extension"), """" ) ), {} ), body: todocument(fv!processInfo.pv.documentId) )
I have never done this and our API template creates the general download document requests as a GET but I think it is worth attempting. Otherwise, you will most likely need to make two calls.
Can I call the web api link in a!safeLink
I recommend against it. If you need to download a document, you can use a!documentDownloadLink()