python - 根据电话号码从 Excel 工作表中提取数据的双向 SMS
问题描述
我正在尝试使用一个 API,人们会在其中回答一个文本,要么只说 Y 或 N,然后他们说他们会根据该文本回复一个文本,提供个性化信息,例如你在代码中看到的他们的名字、约会日期等等在代码中,因此每个文本都与每个人的正确信息一起发送。到目前为止,这是我分析短信和制定回复的基础,但个性化信息是我目前遇到的问题。
@app.route("/sms", methods=['GET', 'POST'])
def incoming_sms():
body = request.values.get('Body', None)
for _yes = ['y','yes','Yes','Y']
for _no = ['n','No','no','N']
if body in for_yes:
response = notifications_client.send_sms_notification(
phone_number = 'From Excel',
template_id = '____',
personalisation = {
'first_name': '',
'appointment_date': '',
'GP Name': '',
解决方案
推荐阅读
- c# - 远程服务器返回错误:(413) Payload Too Large。.net 网络客户端
- python - 如何使用 pyignite 访问我的 ignite 缓存
- java - 在 Scala 中使用 java.util.Base64 的非法 base64 字符“a”
- bash - Make:同时设置 shell 和 source 一个文件?
- python - 我需要一种方法来查找字符串的所有实例,然后获取从该字符串末尾到另一个字符串的所有内容
- javascript - 表格每一行的订单按钮
- java - 春季启动JPA中的JPA复合键与序列
- python - 如何在python的for循环中同时检查两个条件?
- lua - roblox 中的单独位置数据存储如何工作?
- java - 找不到如何将 SAML 应用发布到 GSuite MarketPlace?