0

I am implementing a Zapier Integration's polling trigger. I have built a trigger and an API which serves the data correctly. However my concern is about: how to make sure that I provide the new data only, when zapier polls.

I know about the deduplication mechanism. I provide ids in all the items and Zapier makes sure that one item is used only once. However in my application the items can go into hundreds very quickly and in months they will be in thousands and beyond. I want an optimised solution where I serve only the items which will eventually be used by Zapier, thus reducing the memory usage in my application.

Some timestamp can be save for every call, which I can store inside my application but that will not be a foolproof solution. Same API can be used by user in multiple zaps, plus there are sample calls etc.

Yasir Hussain
  • 33
  • 1
  • 5

1 Answers1

0

Great question! The simplest way to do this is to add a date parameter to your API that lets you filter for items created after that date.

Then, in your Zapier code, provide that param for all trigger calls. I'd set the time to 24 hours ago. So, when a trigger fires, it'll only get items created in the last 24 hours. That could be a big list, but items will cycle out after a day.

xavdid
  • 5,092
  • 3
  • 20
  • 32
  • Isn't 24 hours going to be an overkill? No way to find out inside zapier cli app when the last call was made? – Yasir Hussain Sep 03 '20 at 06:53
  • You can't see the last poll time as far as I know. The main thing is that you don't want to miss any items, so you need to err on the side of too much data and over-fetch the items to be safe. – xavdid Sep 04 '20 at 05:46