📧Python ve Twilio ile SMS server oluşturma

Twilio ile SMS server oluşturma

from flask import Flask, request, redirect
from twilio.twiml.messaging_response import MessagingResponse

app = Flask(__name__)

@app.route("/sms", methods=['POST'])
def sms_reply():
    """Respond to incoming calls with a simple text message."""
    
    # Use this data in your application logic
    from_number = request.form['From']
    to_number = request.form['To']
    body = request.form['Body']

    # Start our TwiML response
    resp = MessagingResponse()

    # Add a message
    resp.message("The Robots are coming! Head for the hills!")

    return str(resp)

if __name__ == "__main__":
    app.run(debug=True)
circle-info

🚨 Türkiyeden yurt dışına SMS göndermek pahalı, twilio Turkiye numarası sunmuyor!

References

Receiving and processing an SMS with Twilio in Pythonarrow-up-right

How to Receive an SMS in Python with Twilioarrow-up-right

Last updated

Was this helpful?