Solved

REST Hook not performing action and apparently doesn't accept the data pushed to hookUrl? But no error message.

  • 8 January 2021
  • 5 replies
  • 28 views

Userlevel 1

Some background:

I have got everything set up to use REST Hooks except the last part.

I have the subscription and delete subscription API endpoints set up and working.

I receive the hookUrl parameter upon subscription.

If I post to hookUrl without any data I get an action triggered (though with blank data, so no use there).

The problem:

If I post to hookUrl with data in the body of the request, the response still says OK but no action is triggered.  There must some error going on but I’m not being told about it. 

Can someone give me insight into exactly what my POST data should look like?  The documentation doesn’t quite say it.  It says an array, but I am providing an array in “body”, just like the array I was using previously for “polling” mode but still getting this silent error.

icon

Best answer by Randall Coding 8 January 2021, 20:39

SOLVED

I solved the issue by sending just a single object in body instead of an array to the hookUrl provided by Zapier.

View original

5 replies

Userlevel 7
Badge +10

@Randall Coding - When you post to hookUrl, Zapier will acknowledge the request before running the actual function that handles it. So, in order to see what’s going wrong, I suggest you take a look at the Monitoring section.

Userlevel 1

SOLVED

I solved the issue by sending just a single object in body instead of an array to the hookUrl provided by Zapier.

Userlevel 1

@Randall Coding - When you post to hookUrl, Zapier will acknowledge the request before running the actual function that handles it. So, in order to see what’s going wrong, I suggest you take a look at the Monitoring section.

Hi @ikbelkirasan .  Thanks, but all I saw in the monitoring section was graph that I could barely read.  I couldn’t glean any request / response details from it. 

Looks like I solved this though.  Instead of posting an array to the hookUrl, I’m now posting a single JSON object as the POST “body”.  That worked.

Userlevel 7
Badge +10

Oh awesome! Glad you figured it out :)

Userlevel 1

Oh awesome! Glad you figured it out :)

Thanks.  I would add a fix it note here for the documentation.  It seems really ambiguous or misleading on this point to a new user. 

It says the following

You may need to put the response inside an array. We expect that the perform function returns a bare array of objects.

https://platform.zapier.com/docs/faq#how-do-i-define-rest-hooks-and-use-the-embedded-tester-with-them

That lead me to believe I should have posted an array rather than a single object (similar to what polling wants).

I also didn’t see anywhere explaining what type of data the hookUrl expects to be posted to it besides that blurb.  Making that more explicit will help future users incorporate this feature, along with having some helpful response messages saying if the format is incorrect.

Reply