Pandas 我想要一种在WhatsApp上使用Twilio而不使用Sandox发送消息的方法。你能帮我找到解决办法吗?
我正在为一家非常小的公司制作一款提醒应用程序,该公司既没有Facebook商业页面,也没有我可以链接以获取WhatsApp API的网站。你能给我建议一个替代的方法,通过它我可以利用Twilio,但避免使用沙箱。我已经做这个项目大约一年了,但仍然不能成功地解决这个问题。请帮我解决这个问题。 我还包括下面的代码片段以供参考Pandas 我想要一种在WhatsApp上使用Twilio而不使用Sandox发送消息的方法。你能帮我找到解决办法吗?,pandas,dataframe,twilio,Pandas,Dataframe,Twilio,我正在为一家非常小的公司制作一款提醒应用程序,该公司既没有Facebook商业页面,也没有我可以链接以获取WhatsApp API的网站。你能给我建议一个替代的方法,通过它我可以利用Twilio,但避免使用沙箱。我已经做这个项目大约一年了,但仍然不能成功地解决这个问题。请帮我解决这个问题。 我还包括下面的代码片段以供参考 import pandas as pd from twilio.rest import Client import datetime from datetime import
import pandas as pd
from twilio.rest import Client
import datetime
from datetime import date, timedelta
values=variables
df=pd.DataFrame(values)
df.drop(index=df.index[0],
axis=0,
inplace=True)
df.index = df.index-1
df['AMC_Start_Date']=df['AMC_Start_Date'].apply(lambda x:x.replace('/','-'))
df['AMC_End_Date']=df['AMC_End_Date'].apply(lambda x:x.replace('/','-'))
d1=date.today()
d1=pd.to_datetime(d1)
d2=df['AMC_Start_Date']
d2=pd.to_datetime(d2)
df['AMC_Start_Date'] = pd.to_datetime(df["AMC_Start_Date"])
df['AMC_End_Date'] = pd.to_datetime(df["AMC_End_Date"])
d2=df['AMC_Start_Date']
d3=df['AMC_End_Date']
t=d1-d2
s=d1-d3
account_sid=‘’
auth_token = 'a7'
client = Client(account_sid, auth_token)
def alert2():
from datetime import date, timedelta
dt = date.today() - timedelta(856)
t2=df['AMC_Start_Date']
t2=pd.to_datetime(t2,format='%Y-%m-%d')
t3=df['AMC_End_Date']
t3=pd.to_datetime(t3,format='%Y-%m-%d')
dt1=date.today()-timedelta(989)
num=['whatsapp:+9198--------','whatsapp:+91900-------']
i1=[i for i, e in enumerate(df['AMC_Start_Date']) if e == dt]
i2=[i for i, e in enumerate(df['AMC_End_Date']) if e == dt1]
NULL=[]
for j in range(len(num)):
if i1!=NULL and i2!=NULL:
strings1 = [str(integer) for integer in i1]
a_string = "". join(strings1)
an_integer = int(a_string)
a=df['Name_and_Address'][an_integer]
strings2 = [str(integer) for integer in i2]
a_string2 = "". join(strings2)
an_integer2 = int(a_string2)
b=df['Name_and_Address'][an_integer2]
body='Servicing scheduled today for {}'.format(a)
message = client.messages.create( from_='whatsapp:+141--------', body=body, to=num[j])
body='The service ends after two days for {}'.format(b)
message = client.messages.create( from_='whatsapp:+141-------', body=body, to=num[j])
elif i1!=NULL:
strings1 = [str(integer) for integer in i1]
a_string = "". join(strings1)
an_integer = int(a_string)
a=df['Name_and_Address'][an_integer]
body='Servicing scheduled today for {}'.format(a)
message = client.messages.create( from_='whatsapp:+141-------', body=body, to=num[j])
elif i2!=NULL:
strings2 = [str(integer) for integer in i2]
a_string2 = "". join(strings2)
an_integer2 = int(a_string2)
b=df['Name_and_Address'][an_integer2]
body='The service ends after two days for {}'.format(b)
message = client.messages.create( from_='whatsapp:+141------', body=body, to=num[j])
else:
body='There are no tasks scheduled for today'
message = client.messages.create( from_='whatsapp:+141-------', body=body, to=num[j])
alert2()
这里是Twilio开发者福音传道者 在生产中使用WhatsApp API的唯一方法是使用自己的数量,并且没有沙箱限制。说明书并没有说你需要一个Facebook页面或网站。您确实需要:
- a
- 完成
如果没有Facebook Business Manager帐户,则无法使用API。如果您不能创建其中一个,那么我不知道您可以如何使用API。我现在有一个Facebook业务id,但没有该组织的网站。有什么办法可以解决这个问题吗?最好是和谁谈谈,谁可以用一种更为手动的方式来指导你完成这个过程,也许可以避免需要一个网站。