def receive(): """Respond to POST data received from SMSified.""" if request.method == 'POST': data = json.loads(request.data) text = data['inboundSMSMessageNotification']['inboundSMSMessage'] process(text) return "Success!"
def issue(): """Receive an incoming SMS message issue.""" if request.method == "POST": try: data = loads(request.data) text = data["inboundSMSMessageNotification"]["inboundSMSMessage"] except: return "Error." finally: process(text) return "Success!" return "Not a POST request."
def issue(): """Receive an incoming SMS message issue.""" if request.method == 'POST': try: data = loads(request.data) text = data['inboundSMSMessageNotification']['inboundSMSMessage'] except: return "Error." finally: process(text) return 'Success!' return "Not a POST request."