0

如何检索传入 SMS 发件人的电话号码?我想获取此 SMS 发件人过去发送的旧记录。

我目前正在我的 Twilio 烧瓶应用程序 webhook 上执行此操作:

@app.route("/")
def hello():

    return "Home'!"

@app.route("/sms", methods=['GET','POST'])
def sms_reply():

    # Fetch the message
    msg = request.form.get('Body')
    # Fetch the phone number?? How to do this?   

    return str(resp)
4

1 回答 1

0

找到了答案:

incoming_number = request.form.get('From')
于 2022-01-17T18:24:40.320 回答