-
Notifications
You must be signed in to change notification settings - Fork 0
/
sms.py
32 lines (26 loc) · 961 Bytes
/
sms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#send sms via way2sms api
from tkinter import *
import requests
import json
URL = 'https://www.way2sms.com/api/v1/sendCampaign'
def sendPostRequest(reqUrl, apiKey, secretKey, useType, phoneNo, senderId, textMessage):
req_params = {
'apikey':apiKey,
'secret':secretKey,
'usetype':useType,
'phone': phoneNo,
'message':textMessage,
'senderid':senderId
}
print(requests.post(reqUrl, req_params).text)
window = Tk()
window.geometry("320x240")
window.title("way2sms")
number = Label(window,text="Number:").place(x=20,y=20)
in_number = Entry(window)
in_number.place(x=120,y=20)
message = Label(window,text="Message:").place(x=20,y=60)
in_message = Text(window,width=20,height=5)
in_message.place(x=120,y=60)
send = Button(window,text="SEND",command= lambda: sendPostRequest(URL,'315BFI7KHV7VBQRAN3QG8O9Q97FFISHM','I7RQIX0GDDGJ4FUS','stage',in_number.get(),'[email protected]',in_message.get(1.0,"end"))).place(x=160,y=180)
window.mainloop()