Hi!
How can i make a web Api which its response is a zip of many pdfs.
Regards,
Rebeca
Discussion posts and replies are publicly visible
Hi,
Could you please elaborate more about the scenario where you exactly want to implement such functionality? Where do you want to use? Just a small brief so that we can provide different solutions based on the scenario.
hi!
Via a web api in your body we pass the information of the pdfs you want to download in a zip then in Appian you choose the pdfs and they are compressed in a zip, the zip will be the document that returns the webapi ,
This service is performed from angular (front) , in angular we select the documents (three documents for example), then it´s is called to Appian’s web api and zip is created (because the documents/pdfs to be compressed are in a folder document in appian, previously created).
Hi Rebeca,
I think you can achieve this by starting the process on WebAPI (POST Method) call. You can pass PDF information as a parameter to this process and process can get the document IDs of those documents. Then you can use the plugin Add documents to Zip (https://community.appian.com/b/appmarket/posts/add-documents-to-zip?CommentId=192c55d7-a7f2-4d17-9a2f-3b4c300ff2c6) to generate the zip document. All the nodes is this process should be chained so that you can retrieve the Zip document ID in the webAPI and same document can be returned in the response body. Something like below:
with( a!startProcess( processModel: cons!APNSB_TESTAPI_PM, processParameters: a!fromJson( http!request.body ), onSuccess: a!httpResponse( statusCode: 200, body: todocument( fv!processInfo.pv.testDoc ) ), onError: a!httpResponse( statusCode: 500, headers: { a!httpHeader(name: "Content-Type", value: "application/json") }, body: a!toJson( { error: "There was an error starting the process" } ) ) ) )
Yogesh
Thanks! :)