Skip to content

Instantly share code, notes, and snippets.

@erdimeola
Last active September 28, 2016 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erdimeola/27647bf0bb9903e9ae73e00ad2b5f083 to your computer and use it in GitHub Desktop.
Save erdimeola/27647bf0bb9903e9ae73e00ad2b5f083 to your computer and use it in GitHub Desktop.
Bulutfon SMS Gönderme
import requests, json
class BulutfonClient(object):
def __init__(self, key, sms_title):
self.key = key
self.sms_title = sms_title
self.SMS_ENDPOINT = "https://api.bulutfon.com/messages"
def send_transactional_sms(self, to_number, text):
data = {
"access_token" : self.key,
"title" : self.SMS_TITLE,
"receivers" : to_number,
"content" : text
}
response = requests.post(self.SMS_ENDPOINT, data=data)
result = json.loads(response.content)
if result.get("success") == True:
return True
else:
return False
client = BulutfonClient("API MASTER KEY", "SMS TITLE")
result = client.send_transactional_sms("Numara","Mesaj")
if result:
print "SMS Başarılı"
else:
print "SMS Başarısız"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment