Skip to main content

SmsAPI client

Project description

smsapi-python

Build Status PyPI

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

Apache 2.0 License

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

smsapi-client-2.9.6.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

smsapi_client-2.9.6-py2.py3-none-any.whl (21.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file smsapi-client-2.9.6.tar.gz.

File metadata

  • Download URL: smsapi-client-2.9.6.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

File hashes

Hashes for smsapi-client-2.9.6.tar.gz
Algorithm Hash digest
SHA256 62a9852979d1d70f6afd093cd09079621bb12c576a4d4f07b7fcb0999b4f1a18
MD5 8f81d938e375e19ef1e6e37fe3b55ec0
BLAKE2b-256 f102f446bf8eff04e3057145d853518d02338c7eff5adfe89f37ed144dd528b1

See more details on using hashes here.

File details

Details for the file smsapi_client-2.9.6-py2.py3-none-any.whl.

File metadata

  • Download URL: smsapi_client-2.9.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

File hashes

Hashes for smsapi_client-2.9.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2b7137271267ab5e3ad0c3ae45ff7eef5462cfa56fc4d578ee4af92bc5a49799
MD5 42c3b1b478eb7427ee9ab369b11ef1eb
BLAKE2b-256 345078060aebb4e9d398a8d9673a7369e1ee61050edfa72344af070379b931d4

See more details on using hashes here.

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