Hi,
Zapier allows Create and Search actions. But what about Do type actions? I have an API method that will be used at the end of a Zap (so does not need to pass anything to another action step).My API currently either returns an empty OK (200) or a BadRequest (400) with the error as a string.
I currently get this:
“Invalid API Response: - Got a non-object result, expected an object from create”
How do I go about creating the action in the Zapier developer console re: dealing with the return result? I guess I have to switch to code mode but what would my code look like to deal with errors and OKs?
My code currently looks like this:
...
return z.request(options)
.then((response) => {
response.throwForStatus();
const results = response.json;
// You can do any parsing you need for results here before returning them
return results;
});
Thank you,
Steve