Skip to main content
Best answer

download file locally from Zapier app Action - Fattura24

  • November 18, 2020
  • 6 replies
  • 1850 views

In my Zapier App - that’s Fattura24, I would like to add an action called ‘GetFile’.
First of all y add an Input field in which I could enter a document Id;

then I call my API in a way like this:

endpoint: URL: https://www.app.fattura24.com/api/v0.3/GetFile

params: { apiKey: xxxxxxxxxx,

              docId: 123456 }

 

The result of this call is actually a PDF file identified by docId.

I would like to build a method by which the user can download (or prompted to do so) the file in his desktop. Any suggestion?

Thanks to all

Best answer by ikbelkirasanBest answer by ikbelkirasan

Hi @Davide - While this might not be possible with a custom integration action, you might want to consider the following options:

  • Build a zap that saves the file to the user’s Dropbox (or Google Drive etc..) folder that’s automatically syncing with their computer.
  • Build a zap that sends them the download link in an email or in a Slack message.
View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

6 replies

ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • Answer
  • November 19, 2020

Hi @Davide - While this might not be possible with a custom integration action, you might want to consider the following options:

  • Build a zap that saves the file to the user’s Dropbox (or Google Drive etc..) folder that’s automatically syncing with their computer.
  • Build a zap that sends them the download link in an email or in a Slack message.

  • Author
  • Beginner
  • 9 replies
  • November 20, 2020

Actually I need only something like opening an URL in a new browser tab, with a string like this  in address bar:

 

https://www.app.fattura24.com/api/v0.3/GetFile?apiKey=xxxx&docId=123456

 

any suggestion?


ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • November 20, 2020

@Davide The problem here is that Zapier doesn’t work in Request-Response fashion so you can’t actually respond to HTTP requests with a custom response.


  • Author
  • Beginner
  • 9 replies
  • November 24, 2020
ikbelkirasan wrote:

Hi @Davide - While this might not be possible with a custom integration action, you might want to consider the following options:

  • Build a zap that saves the file to the user’s Dropbox (or Google Drive etc..) folder that’s automatically syncing with their computer.
  • Build a zap that sends them the download link in an email or in a Slack message.


At last I solved by adding two steps in my Zap:

  1. Zapier webhooks to post my request;
  2. Email by Zapier to send the result of the previous step as attachment

Thank you very much for your support


  • Author
  • Beginner
  • 9 replies
  • November 25, 2020

@ikbelkirasan 
Now I’d like to build my GetFile action in a way that its result looks like the result I get by using Webhooks, that is the object ‘File’ ?

 

I tried to add this in my scripting:

 

 // Action 'Get File'
    get_file_pre_write: function(bundle)
    {
     var pjson = require('package.json');
     var fields = bundle.action_fields_full;
     var keys = Object.keys(fields);
     var docId = fields[docId];
     var apiKey = bundle.request.params.apiKey;

     bundle.request.params =
     {
         apiKey: apiKey,
         docId: docId,
         source: 'F24-Zap ' + pjson.version
     };
     return bundle.request

    },

    get_file_post_write: function(bundle)
    {
       return bundle.response;
    },

When I test this code as a result I don’t get the File


ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • November 26, 2020

@Davide Unfortunately, I haven’t built app in the Legacy Web Builder. However, it might be useful to look at this example app: https://github.com/zapier/zapier-platform/blob/master/example-apps/files/triggers/newFile.js