Skip to main content
Best answer

How to return an custom output with status code in Zapier rest hook perform?

  • December 29, 2020
  • 2 replies
  • 756 views

codetycon

I am using Zapier web builder to create a Zapier APP. I have rest hooks, when I subscribing for a hook API sends a verification challenge code, this comes in the perform

Here is the content that I am receiving in query string :

hub.mode=subscribe&hub.challenge=97890257&hub.verify_token=12345

Zapier returning below back to api:

{"id": "732a8cfc-1dcc-4b54-9a55-7d21e0858ad6", "request_id": "5feb0139-a858-4fbc-b32d-47e13ff472a0", "attempt": "5feb0139-a858-4fbc-b32d-47e13ff472a0", "status": "success"}

I want to modify the return response and status code.

Please advise?

Thanks

Best answer by ikbelkirasan

@codetycon - As far as I understand it, when a new webhook request is received, Zapier would automatically respond with a 200 response like the one shown above before passing the request content to the app. Unfortunately, it’s not possible to change this behavior. Therefore, it is not possible to support webhooks that need verification like yours.

One way around it would be a proxy/middleware that handles the verification part and forwards any other requests to the actual Zapier webhook URL. You might want to take a look at Cloudflare Workers which I’ve personally used to implement this kind of integration.

 

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.

2 replies

AndrewJDavison_Luhhu
Forum|alt.badge.img+10

Tagging @ikbelkirasan for this one.


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

@codetycon - As far as I understand it, when a new webhook request is received, Zapier would automatically respond with a 200 response like the one shown above before passing the request content to the app. Unfortunately, it’s not possible to change this behavior. Therefore, it is not possible to support webhooks that need verification like yours.

One way around it would be a proxy/middleware that handles the verification part and forwards any other requests to the actual Zapier webhook URL. You might want to take a look at Cloudflare Workers which I’ve personally used to implement this kind of integration.