Skip to content

Commit b4e9d9f

Browse files
author
Tony Bedford
committed
Add webhook server
1 parent 816f57e commit b4e9d9f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

messages/webhook-server.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env python3
2+
from flask import Flask, request, jsonify
3+
from pprint import pprint
4+
5+
app = Flask(__name__)
6+
7+
@app.route("/webhooks/inbound-message", methods=['POST'])
8+
def inbound_message():
9+
data = request.get_json()
10+
pprint(data)
11+
return "200"
12+
13+
@app.route("/webhooks/message-status", methods=['POST'])
14+
def message_status():
15+
data = request.get_json()
16+
pprint(data)
17+
return "200"
18+
19+
if __name__ == '__main__':
20+
app.run(host="www.example.org", port=3000)

0 commit comments

Comments
 (0)