Files
notifications-api/app/notifications/receive_notifications.py
Martyn Inglis a7fd624db5 Added simple logging endpoint for fire text inbound SMS calls
- logs post data
- OK to log all as not currently in use so no real user data expected.
2017-06-01 08:21:18 +01:00

28 lines
860 B
Python

from flask import Blueprint
from flask import current_app, jsonify
from flask import request
from app.errors import register_errors
receive_notifications_blueprint = Blueprint('receive_notifications', __name__)
register_errors(receive_notifications_blueprint)
@receive_notifications_blueprint.route('/notifications/sms/receive/mmg', methods=['POST'])
def receive_mmg_sms():
post_data = request.get_json()
post_data.pop('MSISDN', None)
current_app.logger.info("Recieve notification form data: {}".format(post_data))
return "RECEIVED"
@receive_notifications_blueprint.route('/notifications/sms/receive/firetext', methods=['POST'])
def receive_firetext_sms():
post_data = request.form
current_app.logger.info("Received Firetext notification form data: {}".format(post_data))
return jsonify({
"status": "ok"
}), 200