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
Release files for smsapi-client 2.9.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| smsapi_client-2.9.7.tar.gz | 13.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| smsapi_client-2.9.7-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 34.9 kB
Release files / smsapi_client-2.9.7.tar.gz
| Download URL | smsapi_client-2.9.7.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95dfe1fe1f4a5902c1529f063366df8311c21c817744b0e3bf47d703caeb3486
|
|
BLAKE2b-256 checksum How to use checksums |
10c072bbc7bd193823453999c4da0a0e975160c424c65d1e4c93fbf96c1fe65c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / smsapi_client-2.9.7-py2.py3-none-any.whl
| Download URL | smsapi_client-2.9.7-py2.py3-none-any.whl |
|---|---|
| Size | 21.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b347ea6e43ed6e9c26d933ddfd6a4df65afd74806aaffbf41dc5a138cd6b6972
|
|
BLAKE2b-256 checksum How to use checksums |
af5c94ca19c6d266c3169beb76cecd4fd24fbad8d0ccf0cafd2b8da47a1111f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|