-
Notifications
You must be signed in to change notification settings - Fork 76
/
sms.py
30 lines (24 loc) · 824 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
import requests
import json
URL = 'https://www.sms4india.com/api/v1/sendCampaign'
# get request
def sendPostRequest(reqUrl, apiKey, secretKey, useType, phoneNo, senderId, textMessage):
req_params = {
'apikey':apiKey,
'secret':secretKey,
'usetype':useType,
'phone': phoneNo,
'message':textMessage,
'senderid':senderId
}
return requests.post(reqUrl, req_params)
# get response
def sms(name,mobileno,subjectname):
response = sendPostRequest(URL, '18Q54I39P0TBAK53Z5G4M26XU5DL1KMU', '7R2M2FZP75LXZ380', 'stage', '+91'+mobileno, '[email protected]', 'Your ward '+ name +' was present in '+subjectname+' lecture' )
print(response.text)
"""
Note:-
you must provide apikey, secretkey, usetype, mobile, senderid and message values
and then requst to api
"""
# print response if you want