I am trying to use my Flask server to receive webhooks from a Zap, but getting an error when I test:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functionssrule.endpoint])(**req.view_args)
TypeError: receive_webhook() missing 1 required positional argument: 'request'
Here is my handler for the webhook:
@app.route("/webhook", methods=s'POST'])
def receive_webhook(request):
print(request.json)
return request.json
It seems like Zapier is calling my handler with no argument. Shouldn’t it be passing the payload as that argument or am I misunderstanding something here?
Thanks for any assistance.