Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Python SMS API:
- from smsapi import SmsApi
- username = "USERNAME"
- password = "PASSWORD"
- sms = SmsApi(username, password)
- total_points = sms.get_points()['points']
- print("You have", total_points, "points left")
- import sqlite3
- myDB = sqlite3.connect("Clients.db")
- dbCursor = myDB.cursor()
- list_of_client_numbers = dbCursor.execute('''SELECT mobNumber FROM clientsTable''')
- for eachRecord in list_of_client_numbers:
- sms = sms.send_sms(
- recipient=eachRecord,
- sender_name="YOUR COMPANY NAME",
- message="MESSAGE",
- eco=False)
- myDB.close()
- total_points = sms.get_points()['points']
- print("You have", total_points, "points left")
- sms = sms.send_sms(
- recipient="91902000xxxx",
- message="test message"
- )
- from __future__ import print_function
- import time
- import karix
- from karix.rest import ApiException
- from karix.configuration import Configuration
- from karix.api_client import ApiClient
- from pprint import pprint
- # Configure HTTP basic authorization: basicAuth
- config = Configuration()
- config.username = 'YOUR_USERNAME'
- config.password = 'YOUR_PASSWORD'
- # create an instance of the API class
- api_instance = karix.MessageApi(api_client=ApiClient(configuration=config))
- message = karix.CreateMessage(source="<source>", destination=["<destination>"], text="Sent from python SDK")
- try:
- api_response = api_instance.send_message(message=message)
- pprint(api_response)
- except ApiException as e:
- print("Exception when calling MessageApi->send_message: %sn" % e)
Add Comment
Please, Sign In to add comment