SmsAPI client
Project description
smsapi-python
Client for SMSAPI.
COMPATIBILITY
Compatible with Python 2.7+, 3.+.
REQUIREMENTS
requests
INSTALLATION
If You have pip installed:
sudo pip install smsapi-client
else You can install manually:
git clone https://github.com/smsapi/smsapi-python-client.git
cd smsapi-python
python setup.py install
Client instance
If You are smsapi.pl customer You should import
from smsapi.client import SmsApiPlClient
else You need to use client for smsapi.com
from smsapi.client import SmsApiComClient
Credentials
Access Token
from smsapi.client import SmsApiPlClient
token = "XXXX"
client = SmsApiPlClient(access_token=token)
Examples
Send SMS
from smsapi.client import SmsApiPlClient
token = "XXXX"
client = SmsApiPlClient(access_token=token)
send_results = client.sms.send(to="phone number", message="text message")
for result in send_results:
print(result.id, result.points, result.error)
- You can find more examples in "examples" directory in project files.
Error handling
from smsapi.client import SmsApiPlClient
from smsapi.exception import SmsApiException
token = "XXXX"
client = SmsApiPlClient(access_token=token)
try:
contact = client.sms.send(to="123123")
except SmsApiException as e:
print(e.message, e.code)
LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
smsapi-client-2.4.2.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for smsapi_client-2.4.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c851cdb7daf7410ebdac2d857384a2ed36f23d7416544b8fe704e64c7da2d6f |
|
MD5 | 0f1e6c4e0e05e44a93c2d2d7952edfd8 |
|
BLAKE2b-256 | 51cabb261aae114ddeeb4e099295615091ad4eaf2820482315771e97c8322427 |