Skip to main content

A module to send sms using the Sinch REST apis, www.sinch.com

Project description

Installation

pip install sinchsms

Usage example

import time
from sinchsms import SinchSMS

number = '+46000000001'
message = 'Hello from Sinch!'

client = SinchSMS(your_app_key, your_app_secret)

print("Sending '%s' to %s" % (message, number))
response = client.send_message(number, message)
message_id = response['messageId']

response = client.check_status(message_id)
while response['status'] != 'Successful':
    print(response['status'])
    time.sleep(1)
    response = client.check_status(message_id)
print(response['status'])

Note

You will need a Sinch account for getting your application key and secret. Visit www.sinch.com to get started.

Using as command line script

./sinchsms.py
usage: sinchsms.py <application key> <application secret> send <number> <message> <from_number>
       sinchsms.py <application key> <application secret> status <message_id>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
sinchsms-1.0.4.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page