Created
March 15, 2019 08:55
-
-
Save kayalshri/5e826e08041bd0bbe89c1af76620d40e to your computer and use it in GitHub Desktop.
SMS Send via AWS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sendSMS(clientId,msg): | |
cmd = """wget "https://nxyz.com/LATEST/001?module=profile&clientId=%s" -O clientprofile.json""" % clientId | |
os.system(cmd) | |
dataDict = None | |
with open('clientprofile.json') as bIN: | |
dataDict = json.load(bIN) | |
mobile = dataDict.get('mobile') | |
mstatus = dataDict.get('phoneStatus') | |
## Validate Mobile Status | |
if mstatus == 0: | |
print(mobile,mstatus) | |
## Execute AWS SMS | |
cmd = """aws sns publish --phone-number +%s --message "%s" """ % (mobile,msg) | |
print(cmd) | |
os.system(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment