Solution: Webhook receiver Python 3.7

Development | Programming languages
  • 5.0 (3 ratings)
Last updated 02/2019
Author
Description
Who make a Webhook receiver in Python 3?
Attachments
No attachments.
Solutions
Code: receiver.py
from flask import Flask, request, abort
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
    if request.method == 'POST':
        print(request.json)
        return '', 200
    else:
        abort(400)
if __name__ == '__main__':
    app.run()

Start up Postman, and do New Request, POST, URL is http://127.0.0.1:5000/webhook, in Body select "raw" and JSON, and put this in: {"id" : "1123"} and his SEND, and the webhook receiver will print {'id': '1123'}.


on February 08th, 2019 (8:59 pm)
What masters said
You must sign in to comment!!
All comments
Postman link please..
on February 08th, 2019 (9:03 pm)

Awesome! Very responsive and got the job done quick and correct



on February 08th, 2019 (9:06 pm)
:)
on February 15th, 2019 (3:48 pm)