Skip to main content

Python Client Nimba SMS API

Project description

nimbasms-python

A Python module for communicating with Nimba SMS API.

Installation

pip install nimbasms

Usage

from nimbasms import Client

ACCOUNT_SID = 'XXXX'
AUTH_TOKEN = 'XXXX'
client = Client(ACCOUNT_SID, AUTH_TOKEN)

# Get your account balance
response = client.accounts.get()
if response.ok:
    my_account = response.data
    print('My Account balance : {}'.format(my_account['balance']))

# Get All messages
response = client.messages.list()
if response.ok:
    all_messages = response.data
    print('There are {} messages in your account.'.format(len(all_messages)))

# Get only last 10 messages
response = client.messages.list(limit=10)
if response.ok:
    some_messages = some_messages.data
    print('Here are the last 10 messages in your account:')
    for m in some_messages:
        print(m)

# send mesage...
print('Sending a message...')
response = client.messages.create(to=['XXXX'],
            sender_name='YYYY', message='Hi Nimba!')
if response.ok:
    print('message response : {}'.format(response.data))

Credit

Nimba SMS

Project details


Download files

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

Source Distribution

nimbasms-0.0.1.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

nimbasms-0.0.1-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page