@app.route('/sms/receive', methods=['POST'])
def receive_sms():
 sender = request.values.get('From')
 body = request.values.get('Body')
 message = 'Hello, {}, you said: {}'.format(sender, body)
 response = twiml.Response()
 response.message(message)
 return (str(response), 200, {'Content-Type': 'application/xml'})

@ app . route ( '/sms/receive' , methods = [ 'POST' ] ) def receive_sms ( ) : sender = request . values . get ( 'From' ) body = request . values . get ( 'Body' ) message = 'Hello, {}, you said: {}' . format ( sender , body ) response = twiml . Response ( ) response . message ( message ) return ( str ( response ) , 200 , { 'Content-Type' : 'application/xml' } )
receives an sms message and replies with a simple greeting .