Search code examples
javascriptapizapierzapier-cli

Zapier Cli - App works fine in Cli but not in Zapier UI


I have created an app in Zapier Cli, that calls Fancyhands API. Everything works fine in Cli as I get proper response from API as shown below.

enter image description here

However, when I push this app to Zapier and try to use it. The API gives error, that one of the parameters is not formatted properly.

enter image description here

However, this shouldn't be the case, as I am sending same parameters from both CLI and the UI. It looks like the Zapier UI is adding some extra encoding to the parameters. Kindly suggest whats going on here?


Solution

  • The root issue is that fancyhands expects a UTC timestamp for the call_window_start param (like 2020-02-29T11:00:00Z). On the other hand, Zapier takes datetime fields and sends them to the developer in bundle.inputData as TZ-aware (2020-03-02T05:09:08-05:00).

    The solution is therefore to remote the timezone data from the incoming timestamp. Maybe something like new Date(bundle.inputData.call_window_start).toISOString().