Skip to content

Commit 3780df8

Browse files
authored
Merge pull request #30 from nexmo-community/tony-messages
Initial versions of inbound message handler and delivery receipt handler.
2 parents 8b16f55 + f83c90b commit 3780df8

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

messages/delivery-receipt.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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/delivery-receipt", methods=['POST'])
8+
def delivery_receipt():
9+
data = request.get_json()
10+
pprint(data)
11+
return "200"
12+
13+
if __name__ == '__main__':
14+
app.run(host="www.example.org", port=3000)

messages/inbound-message.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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-sms", methods=['POST'])
8+
def inbound_message():
9+
data = request.get_json()
10+
pprint(data)
11+
return "200"
12+
13+
if __name__ == '__main__':
14+
app.run(host="www.example.org", port=3000)
15+

0 commit comments

Comments
 (0)